From cc25bdf82c1f293cd89c45c4b666861ed8a72838 Mon Sep 17 00:00:00 2001 From: Serge Bazanski Date: Thu, 25 Oct 2018 14:02:58 +0200 Subject: [PATCH] vendorify --- go/Gopkg.lock | 409 + go/Gopkg.toml | 74 + .../github.com/PuerkitoBio/purell/.gitignore | 5 + .../github.com/PuerkitoBio/purell/.travis.yml | 7 + .../github.com/PuerkitoBio/purell/LICENSE | 12 + .../github.com/PuerkitoBio/purell/README.md | 187 + .../github.com/PuerkitoBio/purell/purell.go | 379 + .../github.com/PuerkitoBio/urlesc/.travis.yml | 15 + .../github.com/PuerkitoBio/urlesc/LICENSE | 27 + .../github.com/PuerkitoBio/urlesc/README.md | 16 + .../github.com/PuerkitoBio/urlesc/urlesc.go | 180 + .../github.com/StackExchange/wmi/LICENSE | 20 + .../github.com/StackExchange/wmi/README.md | 6 + .../StackExchange/wmi/swbemservices.go | 260 + go/vendor/github.com/StackExchange/wmi/wmi.go | 486 + .../asaskevich/govalidator/.travis.yml | 14 + .../asaskevich/govalidator/CONTRIBUTING.md | 63 + .../github.com/asaskevich/govalidator/LICENSE | 21 + .../asaskevich/govalidator/README.md | 490 + .../asaskevich/govalidator/arrays.go | 58 + .../asaskevich/govalidator/converter.go | 64 + .../asaskevich/govalidator/error.go | 36 + .../asaskevich/govalidator/numerics.go | 97 + .../asaskevich/govalidator/patterns.go | 97 + .../asaskevich/govalidator/types.go | 616 + .../asaskevich/govalidator/utils.go | 264 + .../asaskevich/govalidator/validator.go | 1213 + .../asaskevich/govalidator/wercker.yml | 15 + .../github.com/cenkalti/backoff/.gitignore | 22 + .../github.com/cenkalti/backoff/.travis.yml | 10 + go/vendor/github.com/cenkalti/backoff/LICENSE | 20 + .../github.com/cenkalti/backoff/README.md | 30 + .../github.com/cenkalti/backoff/backoff.go | 66 + .../github.com/cenkalti/backoff/context.go | 60 + .../cenkalti/backoff/exponential.go | 158 + .../github.com/cenkalti/backoff/retry.go | 78 + .../github.com/cenkalti/backoff/ticker.go | 84 + .../github.com/cenkalti/backoff/tries.go | 35 + .../github.com/digitalocean/go-netbox/AUTHORS | 14 + .../digitalocean/go-netbox/LICENSE.md | 195 + .../go-netbox/copyright_header.txt | 13 + .../circuits_choices_list_parameters.go | 128 + .../circuits_choices_list_responses.go | 70 + .../circuits_choices_read_parameters.go | 148 + .../circuits_choices_read_responses.go | 70 + ..._circuit_terminations_create_parameters.go | 151 + ...s_circuit_terminations_create_responses.go | 81 + ..._circuit_terminations_delete_parameters.go | 152 + ...s_circuit_terminations_delete_responses.go | 70 + ...ts_circuit_terminations_list_parameters.go | 427 + ...its_circuit_terminations_list_responses.go | 81 + ..._terminations_partial_update_parameters.go | 173 + ...t_terminations_partial_update_responses.go | 81 + ...ts_circuit_terminations_read_parameters.go | 152 + ...its_circuit_terminations_read_responses.go | 81 + ..._circuit_terminations_update_parameters.go | 173 + ...s_circuit_terminations_update_responses.go | 81 + ...ircuits_circuit_types_create_parameters.go | 151 + ...circuits_circuit_types_create_responses.go | 81 + ...ircuits_circuit_types_delete_parameters.go | 152 + ...circuits_circuit_types_delete_responses.go | 70 + .../circuits_circuit_types_list_parameters.go | 253 + .../circuits_circuit_types_list_responses.go | 81 + ...circuit_types_partial_update_parameters.go | 173 + ..._circuit_types_partial_update_responses.go | 81 + .../circuits_circuit_types_read_parameters.go | 152 + .../circuits_circuit_types_read_responses.go | 81 + ...ircuits_circuit_types_update_parameters.go | 173 + ...circuits_circuit_types_update_responses.go | 81 + .../circuits_circuits_create_parameters.go | 151 + .../circuits_circuits_create_responses.go | 81 + .../circuits_circuits_delete_parameters.go | 152 + .../circuits_circuits_delete_responses.go | 70 + .../circuits_circuits_list_parameters.go | 604 + .../circuits_circuits_list_responses.go | 81 + ...uits_circuits_partial_update_parameters.go | 173 + ...cuits_circuits_partial_update_responses.go | 81 + .../circuits_circuits_read_parameters.go | 152 + .../circuits_circuits_read_responses.go | 81 + .../circuits_circuits_update_parameters.go | 173 + .../circuits_circuits_update_responses.go | 81 + .../netbox/client/circuits/circuits_client.go | 827 + .../circuits_providers_create_parameters.go | 151 + .../circuits_providers_create_responses.go | 81 + .../circuits_providers_delete_parameters.go | 152 + .../circuits_providers_delete_responses.go | 70 + .../circuits_providers_graphs_parameters.go | 152 + .../circuits_providers_graphs_responses.go | 81 + .../circuits_providers_list_parameters.go | 430 + .../circuits_providers_list_responses.go | 81 + ...its_providers_partial_update_parameters.go | 173 + ...uits_providers_partial_update_responses.go | 81 + .../circuits_providers_read_parameters.go | 152 + .../circuits_providers_read_responses.go | 81 + .../circuits_providers_update_parameters.go | 173 + .../circuits_providers_update_responses.go | 81 + .../dcim/dcim_choices_list_parameters.go | 128 + .../dcim/dcim_choices_list_responses.go | 70 + .../dcim/dcim_choices_read_parameters.go | 148 + .../dcim/dcim_choices_read_responses.go | 70 + .../netbox/client/dcim/dcim_client.go | 4834 + .../dcim_connected_device_list_parameters.go | 180 + .../dcim_connected_device_list_responses.go | 81 + ...cim_console_connections_list_parameters.go | 311 + ...dcim_console_connections_list_responses.go | 81 + ...onsole_port_templates_create_parameters.go | 151 + ...console_port_templates_create_responses.go | 81 + ...onsole_port_templates_delete_parameters.go | 152 + ...console_port_templates_delete_responses.go | 70 + ..._console_port_templates_list_parameters.go | 253 + ...m_console_port_templates_list_responses.go | 81 + ...ort_templates_partial_update_parameters.go | 173 + ...port_templates_partial_update_responses.go | 81 + ..._console_port_templates_read_parameters.go | 152 + ...m_console_port_templates_read_responses.go | 81 + ...onsole_port_templates_update_parameters.go | 173 + ...console_port_templates_update_responses.go | 81 + .../dcim_console_ports_create_parameters.go | 151 + .../dcim_console_ports_create_responses.go | 81 + .../dcim_console_ports_delete_parameters.go | 152 + .../dcim_console_ports_delete_responses.go | 70 + .../dcim_console_ports_list_parameters.go | 282 + .../dcim/dcim_console_ports_list_responses.go | 81 + ...console_ports_partial_update_parameters.go | 173 + ..._console_ports_partial_update_responses.go | 81 + .../dcim_console_ports_read_parameters.go | 152 + .../dcim/dcim_console_ports_read_responses.go | 81 + .../dcim_console_ports_update_parameters.go | 173 + .../dcim_console_ports_update_responses.go | 81 + ...server_port_templates_create_parameters.go | 151 + ..._server_port_templates_create_responses.go | 81 + ...server_port_templates_delete_parameters.go | 152 + ..._server_port_templates_delete_responses.go | 70 + ...e_server_port_templates_list_parameters.go | 253 + ...le_server_port_templates_list_responses.go | 81 + ...ort_templates_partial_update_parameters.go | 173 + ...port_templates_partial_update_responses.go | 81 + ...e_server_port_templates_read_parameters.go | 152 + ...le_server_port_templates_read_responses.go | 81 + ...server_port_templates_update_parameters.go | 173 + ..._server_port_templates_update_responses.go | 81 + ..._console_server_ports_create_parameters.go | 151 + ...m_console_server_ports_create_responses.go | 81 + ..._console_server_ports_delete_parameters.go | 152 + ...m_console_server_ports_delete_responses.go | 70 + ...im_console_server_ports_list_parameters.go | 282 + ...cim_console_server_ports_list_responses.go | 81 + ..._server_ports_partial_update_parameters.go | 173 + ...e_server_ports_partial_update_responses.go | 81 + ...im_console_server_ports_read_parameters.go | 152 + ...cim_console_server_ports_read_responses.go | 81 + ..._console_server_ports_update_parameters.go | 173 + ...m_console_server_ports_update_responses.go | 81 + ..._device_bay_templates_create_parameters.go | 151 + ...m_device_bay_templates_create_responses.go | 81 + ..._device_bay_templates_delete_parameters.go | 152 + ...m_device_bay_templates_delete_responses.go | 70 + ...im_device_bay_templates_list_parameters.go | 253 + ...cim_device_bay_templates_list_responses.go | 81 + ...bay_templates_partial_update_parameters.go | 173 + ..._bay_templates_partial_update_responses.go | 81 + ...im_device_bay_templates_read_parameters.go | 152 + ...cim_device_bay_templates_read_responses.go | 81 + ..._device_bay_templates_update_parameters.go | 173 + ...m_device_bay_templates_update_responses.go | 81 + .../dcim_device_bays_create_parameters.go | 151 + .../dcim/dcim_device_bays_create_responses.go | 81 + .../dcim_device_bays_delete_parameters.go | 152 + .../dcim/dcim_device_bays_delete_responses.go | 70 + .../dcim/dcim_device_bays_list_parameters.go | 282 + .../dcim/dcim_device_bays_list_responses.go | 81 + ...m_device_bays_partial_update_parameters.go | 173 + ...im_device_bays_partial_update_responses.go | 81 + .../dcim/dcim_device_bays_read_parameters.go | 152 + .../dcim/dcim_device_bays_read_responses.go | 81 + .../dcim_device_bays_update_parameters.go | 173 + .../dcim/dcim_device_bays_update_responses.go | 81 + .../dcim_device_roles_create_parameters.go | 151 + .../dcim_device_roles_create_responses.go | 81 + .../dcim_device_roles_delete_parameters.go | 152 + .../dcim_device_roles_delete_responses.go | 70 + .../dcim/dcim_device_roles_list_parameters.go | 311 + .../dcim/dcim_device_roles_list_responses.go | 81 + ..._device_roles_partial_update_parameters.go | 173 + ...m_device_roles_partial_update_responses.go | 81 + .../dcim/dcim_device_roles_read_parameters.go | 152 + .../dcim/dcim_device_roles_read_responses.go | 81 + .../dcim_device_roles_update_parameters.go | 173 + .../dcim_device_roles_update_responses.go | 81 + .../dcim_device_types_create_parameters.go | 151 + .../dcim_device_types_create_responses.go | 81 + .../dcim_device_types_delete_parameters.go | 152 + .../dcim_device_types_delete_responses.go | 70 + .../dcim/dcim_device_types_list_parameters.go | 575 + .../dcim/dcim_device_types_list_responses.go | 81 + ..._device_types_partial_update_parameters.go | 173 + ...m_device_types_partial_update_responses.go | 81 + .../dcim/dcim_device_types_read_parameters.go | 152 + .../dcim/dcim_device_types_read_responses.go | 81 + .../dcim_device_types_update_parameters.go | 173 + .../dcim_device_types_update_responses.go | 81 + .../dcim/dcim_devices_create_parameters.go | 151 + .../dcim/dcim_devices_create_responses.go | 81 + .../dcim/dcim_devices_delete_parameters.go | 152 + .../dcim/dcim_devices_delete_responses.go | 70 + .../dcim/dcim_devices_list_parameters.go | 1039 + .../dcim/dcim_devices_list_responses.go | 81 + .../dcim/dcim_devices_napalm_parameters.go | 152 + .../dcim/dcim_devices_napalm_responses.go | 81 + .../dcim_devices_partial_update_parameters.go | 173 + .../dcim_devices_partial_update_responses.go | 81 + .../dcim/dcim_devices_read_parameters.go | 152 + .../dcim/dcim_devices_read_responses.go | 81 + .../dcim/dcim_devices_update_parameters.go | 173 + .../dcim/dcim_devices_update_responses.go | 81 + ...interface_connections_create_parameters.go | 151 + ..._interface_connections_create_responses.go | 81 + ...interface_connections_delete_parameters.go | 152 + ..._interface_connections_delete_responses.go | 70 + ...m_interface_connections_list_parameters.go | 282 + ...im_interface_connections_list_responses.go | 81 + ...e_connections_partial_update_parameters.go | 173 + ...ce_connections_partial_update_responses.go | 81 + ...m_interface_connections_read_parameters.go | 152 + ...im_interface_connections_read_responses.go | 81 + ...interface_connections_update_parameters.go | 173 + ..._interface_connections_update_responses.go | 81 + ...m_interface_templates_create_parameters.go | 151 + ...im_interface_templates_create_responses.go | 81 + ...m_interface_templates_delete_parameters.go | 152 + ...im_interface_templates_delete_responses.go | 70 + ...cim_interface_templates_list_parameters.go | 311 + ...dcim_interface_templates_list_responses.go | 81 + ...ace_templates_partial_update_parameters.go | 173 + ...face_templates_partial_update_responses.go | 81 + ...cim_interface_templates_read_parameters.go | 152 + ...dcim_interface_templates_read_responses.go | 81 + ...m_interface_templates_update_parameters.go | 173 + ...im_interface_templates_update_responses.go | 81 + .../dcim/dcim_interfaces_create_parameters.go | 151 + .../dcim/dcim_interfaces_create_responses.go | 81 + .../dcim/dcim_interfaces_delete_parameters.go | 152 + .../dcim/dcim_interfaces_delete_responses.go | 70 + .../dcim/dcim_interfaces_graphs_parameters.go | 152 + .../dcim/dcim_interfaces_graphs_responses.go | 81 + .../dcim/dcim_interfaces_list_parameters.go | 485 + .../dcim/dcim_interfaces_list_responses.go | 81 + ...im_interfaces_partial_update_parameters.go | 173 + ...cim_interfaces_partial_update_responses.go | 81 + .../dcim/dcim_interfaces_read_parameters.go | 152 + .../dcim/dcim_interfaces_read_responses.go | 81 + .../dcim/dcim_interfaces_update_parameters.go | 173 + .../dcim/dcim_interfaces_update_responses.go | 81 + .../dcim_inventory_items_create_parameters.go | 151 + .../dcim_inventory_items_create_responses.go | 81 + .../dcim_inventory_items_delete_parameters.go | 152 + .../dcim_inventory_items_delete_responses.go | 70 + .../dcim_inventory_items_list_parameters.go | 514 + .../dcim_inventory_items_list_responses.go | 81 + ...ventory_items_partial_update_parameters.go | 173 + ...nventory_items_partial_update_responses.go | 81 + .../dcim_inventory_items_read_parameters.go | 152 + .../dcim_inventory_items_read_responses.go | 81 + .../dcim_inventory_items_update_parameters.go | 173 + .../dcim_inventory_items_update_responses.go | 81 + .../dcim_manufacturers_create_parameters.go | 151 + .../dcim_manufacturers_create_responses.go | 81 + .../dcim_manufacturers_delete_parameters.go | 152 + .../dcim_manufacturers_delete_responses.go | 70 + .../dcim_manufacturers_list_parameters.go | 253 + .../dcim/dcim_manufacturers_list_responses.go | 81 + ...manufacturers_partial_update_parameters.go | 173 + ..._manufacturers_partial_update_responses.go | 81 + .../dcim_manufacturers_read_parameters.go | 152 + .../dcim/dcim_manufacturers_read_responses.go | 81 + .../dcim_manufacturers_update_parameters.go | 173 + .../dcim_manufacturers_update_responses.go | 81 + .../dcim/dcim_platforms_create_parameters.go | 151 + .../dcim/dcim_platforms_create_responses.go | 81 + .../dcim/dcim_platforms_delete_parameters.go | 152 + .../dcim/dcim_platforms_delete_responses.go | 70 + .../dcim/dcim_platforms_list_parameters.go | 311 + .../dcim/dcim_platforms_list_responses.go | 81 + ...cim_platforms_partial_update_parameters.go | 173 + ...dcim_platforms_partial_update_responses.go | 81 + .../dcim/dcim_platforms_read_parameters.go | 152 + .../dcim/dcim_platforms_read_responses.go | 81 + .../dcim/dcim_platforms_update_parameters.go | 173 + .../dcim/dcim_platforms_update_responses.go | 81 + .../dcim_power_connections_list_parameters.go | 311 + .../dcim_power_connections_list_responses.go | 81 + ...ower_outlet_templates_create_parameters.go | 151 + ...power_outlet_templates_create_responses.go | 81 + ...ower_outlet_templates_delete_parameters.go | 152 + ...power_outlet_templates_delete_responses.go | 70 + ..._power_outlet_templates_list_parameters.go | 253 + ...m_power_outlet_templates_list_responses.go | 81 + ...let_templates_partial_update_parameters.go | 173 + ...tlet_templates_partial_update_responses.go | 81 + ..._power_outlet_templates_read_parameters.go | 152 + ...m_power_outlet_templates_read_responses.go | 81 + ...ower_outlet_templates_update_parameters.go | 173 + ...power_outlet_templates_update_responses.go | 81 + .../dcim_power_outlets_create_parameters.go | 151 + .../dcim_power_outlets_create_responses.go | 81 + .../dcim_power_outlets_delete_parameters.go | 152 + .../dcim_power_outlets_delete_responses.go | 70 + .../dcim_power_outlets_list_parameters.go | 282 + .../dcim/dcim_power_outlets_list_responses.go | 81 + ...power_outlets_partial_update_parameters.go | 173 + ..._power_outlets_partial_update_responses.go | 81 + .../dcim_power_outlets_read_parameters.go | 152 + .../dcim/dcim_power_outlets_read_responses.go | 81 + .../dcim_power_outlets_update_parameters.go | 173 + .../dcim_power_outlets_update_responses.go | 81 + ..._power_port_templates_create_parameters.go | 151 + ...m_power_port_templates_create_responses.go | 81 + ..._power_port_templates_delete_parameters.go | 152 + ...m_power_port_templates_delete_responses.go | 70 + ...im_power_port_templates_list_parameters.go | 253 + ...cim_power_port_templates_list_responses.go | 81 + ...ort_templates_partial_update_parameters.go | 173 + ...port_templates_partial_update_responses.go | 81 + ...im_power_port_templates_read_parameters.go | 152 + ...cim_power_port_templates_read_responses.go | 81 + ..._power_port_templates_update_parameters.go | 173 + ...m_power_port_templates_update_responses.go | 81 + .../dcim_power_ports_create_parameters.go | 151 + .../dcim/dcim_power_ports_create_responses.go | 81 + .../dcim_power_ports_delete_parameters.go | 152 + .../dcim/dcim_power_ports_delete_responses.go | 70 + .../dcim/dcim_power_ports_list_parameters.go | 282 + .../dcim/dcim_power_ports_list_responses.go | 81 + ...m_power_ports_partial_update_parameters.go | 173 + ...im_power_ports_partial_update_responses.go | 81 + .../dcim/dcim_power_ports_read_parameters.go | 152 + .../dcim/dcim_power_ports_read_responses.go | 81 + .../dcim_power_ports_update_parameters.go | 173 + .../dcim/dcim_power_ports_update_responses.go | 81 + .../dcim_rack_groups_create_parameters.go | 151 + .../dcim/dcim_rack_groups_create_responses.go | 81 + .../dcim_rack_groups_delete_parameters.go | 152 + .../dcim/dcim_rack_groups_delete_responses.go | 70 + .../dcim/dcim_rack_groups_list_parameters.go | 311 + .../dcim/dcim_rack_groups_list_responses.go | 81 + ...m_rack_groups_partial_update_parameters.go | 173 + ...im_rack_groups_partial_update_responses.go | 81 + .../dcim/dcim_rack_groups_read_parameters.go | 152 + .../dcim/dcim_rack_groups_read_responses.go | 81 + .../dcim_rack_groups_update_parameters.go | 173 + .../dcim/dcim_rack_groups_update_responses.go | 81 + ...cim_rack_reservations_create_parameters.go | 151 + ...dcim_rack_reservations_create_responses.go | 81 + ...cim_rack_reservations_delete_parameters.go | 152 + ...dcim_rack_reservations_delete_responses.go | 70 + .../dcim_rack_reservations_list_parameters.go | 546 + .../dcim_rack_reservations_list_responses.go | 81 + ..._reservations_partial_update_parameters.go | 173 + ...k_reservations_partial_update_responses.go | 81 + .../dcim_rack_reservations_read_parameters.go | 152 + .../dcim_rack_reservations_read_responses.go | 81 + ...cim_rack_reservations_update_parameters.go | 173 + ...dcim_rack_reservations_update_responses.go | 81 + .../dcim/dcim_rack_roles_create_parameters.go | 151 + .../dcim/dcim_rack_roles_create_responses.go | 81 + .../dcim/dcim_rack_roles_delete_parameters.go | 152 + .../dcim/dcim_rack_roles_delete_responses.go | 70 + .../dcim/dcim_rack_roles_list_parameters.go | 282 + .../dcim/dcim_rack_roles_list_responses.go | 81 + ...im_rack_roles_partial_update_parameters.go | 173 + ...cim_rack_roles_partial_update_responses.go | 81 + .../dcim/dcim_rack_roles_read_parameters.go | 152 + .../dcim/dcim_rack_roles_read_responses.go | 81 + .../dcim/dcim_rack_roles_update_parameters.go | 173 + .../dcim/dcim_rack_roles_update_responses.go | 81 + .../dcim/dcim_racks_create_parameters.go | 151 + .../dcim/dcim_racks_create_responses.go | 81 + .../dcim/dcim_racks_delete_parameters.go | 152 + .../dcim/dcim_racks_delete_responses.go | 70 + .../client/dcim/dcim_racks_list_parameters.go | 691 + .../client/dcim/dcim_racks_list_responses.go | 81 + .../dcim_racks_partial_update_parameters.go | 173 + .../dcim_racks_partial_update_responses.go | 81 + .../client/dcim/dcim_racks_read_parameters.go | 152 + .../client/dcim/dcim_racks_read_responses.go | 81 + .../dcim/dcim_racks_units_parameters.go | 152 + .../client/dcim/dcim_racks_units_responses.go | 81 + .../dcim/dcim_racks_update_parameters.go | 173 + .../dcim/dcim_racks_update_responses.go | 81 + .../dcim/dcim_regions_create_parameters.go | 151 + .../dcim/dcim_regions_create_responses.go | 81 + .../dcim/dcim_regions_delete_parameters.go | 152 + .../dcim/dcim_regions_delete_responses.go | 70 + .../dcim/dcim_regions_list_parameters.go | 340 + .../dcim/dcim_regions_list_responses.go | 81 + .../dcim_regions_partial_update_parameters.go | 173 + .../dcim_regions_partial_update_responses.go | 81 + .../dcim/dcim_regions_read_parameters.go | 152 + .../dcim/dcim_regions_read_responses.go | 81 + .../dcim/dcim_regions_update_parameters.go | 173 + .../dcim/dcim_regions_update_responses.go | 81 + .../dcim/dcim_sites_create_parameters.go | 151 + .../dcim/dcim_sites_create_responses.go | 81 + .../dcim/dcim_sites_delete_parameters.go | 152 + .../dcim/dcim_sites_delete_responses.go | 70 + .../dcim/dcim_sites_graphs_parameters.go | 152 + .../dcim/dcim_sites_graphs_responses.go | 81 + .../client/dcim/dcim_sites_list_parameters.go | 604 + .../client/dcim/dcim_sites_list_responses.go | 81 + .../dcim_sites_partial_update_parameters.go | 173 + .../dcim_sites_partial_update_responses.go | 81 + .../client/dcim/dcim_sites_read_parameters.go | 152 + .../client/dcim/dcim_sites_read_responses.go | 81 + .../dcim/dcim_sites_update_parameters.go | 173 + .../dcim/dcim_sites_update_responses.go | 81 + .../dcim_virtual_chassis_create_parameters.go | 151 + .../dcim_virtual_chassis_create_responses.go | 81 + .../dcim_virtual_chassis_delete_parameters.go | 152 + .../dcim_virtual_chassis_delete_responses.go | 70 + .../dcim_virtual_chassis_list_parameters.go | 195 + .../dcim_virtual_chassis_list_responses.go | 81 + ...rtual_chassis_partial_update_parameters.go | 173 + ...irtual_chassis_partial_update_responses.go | 81 + .../dcim_virtual_chassis_read_parameters.go | 152 + .../dcim_virtual_chassis_read_responses.go | 81 + .../dcim_virtual_chassis_update_parameters.go | 173 + .../dcim_virtual_chassis_update_responses.go | 81 + .../extras/extras_choices_list_parameters.go | 128 + .../extras/extras_choices_list_responses.go | 70 + .../extras/extras_choices_read_parameters.go | 148 + .../extras/extras_choices_read_responses.go | 70 + .../netbox/client/extras/extras_client.go | 885 + ...tras_export_templates_create_parameters.go | 151 + ...xtras_export_templates_create_responses.go | 81 + ...tras_export_templates_delete_parameters.go | 152 + ...xtras_export_templates_delete_responses.go | 70 + ...extras_export_templates_list_parameters.go | 253 + .../extras_export_templates_list_responses.go | 81 + ...ort_templates_partial_update_parameters.go | 173 + ...port_templates_partial_update_responses.go | 81 + ...extras_export_templates_read_parameters.go | 152 + .../extras_export_templates_read_responses.go | 81 + ...tras_export_templates_update_parameters.go | 173 + ...xtras_export_templates_update_responses.go | 81 + .../extras/extras_graphs_create_parameters.go | 151 + .../extras/extras_graphs_create_responses.go | 81 + .../extras/extras_graphs_delete_parameters.go | 152 + .../extras/extras_graphs_delete_responses.go | 70 + .../extras/extras_graphs_list_parameters.go | 253 + .../extras/extras_graphs_list_responses.go | 81 + ...extras_graphs_partial_update_parameters.go | 173 + .../extras_graphs_partial_update_responses.go | 81 + .../extras/extras_graphs_read_parameters.go | 152 + .../extras/extras_graphs_read_responses.go | 81 + .../extras/extras_graphs_update_parameters.go | 173 + .../extras/extras_graphs_update_responses.go | 81 + ...ras_image_attachments_create_parameters.go | 151 + ...tras_image_attachments_create_responses.go | 81 + ...ras_image_attachments_delete_parameters.go | 152 + ...tras_image_attachments_delete_responses.go | 70 + ...xtras_image_attachments_list_parameters.go | 195 + ...extras_image_attachments_list_responses.go | 81 + ...e_attachments_partial_update_parameters.go | 173 + ...ge_attachments_partial_update_responses.go | 81 + ...xtras_image_attachments_read_parameters.go | 152 + ...extras_image_attachments_read_responses.go | 81 + ...ras_image_attachments_update_parameters.go | 173 + ...tras_image_attachments_update_responses.go | 81 + .../extras_recent_activity_list_parameters.go | 253 + .../extras_recent_activity_list_responses.go | 81 + .../extras_recent_activity_read_parameters.go | 152 + .../extras_recent_activity_read_responses.go | 81 + .../extras_topology_maps_create_parameters.go | 151 + .../extras_topology_maps_create_responses.go | 81 + .../extras_topology_maps_delete_parameters.go | 152 + .../extras_topology_maps_delete_responses.go | 70 + .../extras_topology_maps_list_parameters.go | 311 + .../extras_topology_maps_list_responses.go | 81 + ...topology_maps_partial_update_parameters.go | 173 + ..._topology_maps_partial_update_responses.go | 81 + .../extras_topology_maps_read_parameters.go | 152 + .../extras_topology_maps_read_responses.go | 81 + .../extras_topology_maps_render_parameters.go | 152 + .../extras_topology_maps_render_responses.go | 81 + .../extras_topology_maps_update_parameters.go | 173 + .../extras_topology_maps_update_responses.go | 81 + .../netbox/client/ipam/ip_am_client.go | 1788 + .../ipam/ip_amaggregates_create_parameters.go | 151 + .../ipam/ip_amaggregates_create_responses.go | 81 + .../ipam/ip_amaggregates_delete_parameters.go | 152 + .../ipam/ip_amaggregates_delete_responses.go | 70 + .../ipam/ip_amaggregates_list_parameters.go | 372 + .../ipam/ip_amaggregates_list_responses.go | 81 + ..._amaggregates_partial_update_parameters.go | 173 + ...p_amaggregates_partial_update_responses.go | 81 + .../ipam/ip_amaggregates_read_parameters.go | 152 + .../ipam/ip_amaggregates_read_responses.go | 81 + .../ipam/ip_amaggregates_update_parameters.go | 173 + .../ipam/ip_amaggregates_update_responses.go | 81 + .../ipam/ip_amchoices_list_parameters.go | 128 + .../ipam/ip_amchoices_list_responses.go | 70 + .../ipam/ip_amchoices_read_parameters.go | 148 + .../ipam/ip_amchoices_read_responses.go | 70 + .../ip_amip_addresses_create_parameters.go | 151 + .../ip_amip_addresses_create_responses.go | 81 + .../ip_amip_addresses_delete_parameters.go | 152 + .../ip_amip_addresses_delete_responses.go | 70 + .../ipam/ip_amip_addresses_list_parameters.go | 662 + .../ipam/ip_amip_addresses_list_responses.go | 81 + ...mip_addresses_partial_update_parameters.go | 173 + ...amip_addresses_partial_update_responses.go | 81 + .../ipam/ip_amip_addresses_read_parameters.go | 152 + .../ipam/ip_amip_addresses_read_responses.go | 81 + .../ip_amip_addresses_update_parameters.go | 173 + .../ip_amip_addresses_update_responses.go | 81 + ...refixes_available_ips_create_parameters.go | 173 + ...prefixes_available_ips_create_responses.go | 81 + ...mprefixes_available_ips_read_parameters.go | 152 + ...amprefixes_available_ips_read_responses.go | 81 + ...es_available_prefixes_create_parameters.go | 173 + ...xes_available_prefixes_create_responses.go | 81 + ...ixes_available_prefixes_read_parameters.go | 152 + ...fixes_available_prefixes_read_responses.go | 81 + .../ipam/ip_amprefixes_create_parameters.go | 151 + .../ipam/ip_amprefixes_create_responses.go | 81 + .../ipam/ip_amprefixes_delete_parameters.go | 152 + .../ipam/ip_amprefixes_delete_responses.go | 70 + .../ipam/ip_amprefixes_list_parameters.go | 749 + .../ipam/ip_amprefixes_list_responses.go | 81 + ...ip_amprefixes_partial_update_parameters.go | 173 + .../ip_amprefixes_partial_update_responses.go | 81 + .../ipam/ip_amprefixes_read_parameters.go | 152 + .../ipam/ip_amprefixes_read_responses.go | 81 + .../ipam/ip_amprefixes_update_parameters.go | 173 + .../ipam/ip_amprefixes_update_responses.go | 81 + .../ipam/ip_amrirs_create_parameters.go | 151 + .../client/ipam/ip_amrirs_create_responses.go | 81 + .../ipam/ip_amrirs_delete_parameters.go | 152 + .../client/ipam/ip_amrirs_delete_responses.go | 70 + .../client/ipam/ip_amrirs_list_parameters.go | 314 + .../client/ipam/ip_amrirs_list_responses.go | 81 + .../ip_amrirs_partial_update_parameters.go | 173 + .../ip_amrirs_partial_update_responses.go | 81 + .../client/ipam/ip_amrirs_read_parameters.go | 152 + .../client/ipam/ip_amrirs_read_responses.go | 81 + .../ipam/ip_amrirs_update_parameters.go | 173 + .../client/ipam/ip_amrirs_update_responses.go | 81 + .../ipam/ip_amroles_create_parameters.go | 151 + .../ipam/ip_amroles_create_responses.go | 81 + .../ipam/ip_amroles_delete_parameters.go | 152 + .../ipam/ip_amroles_delete_responses.go | 70 + .../client/ipam/ip_amroles_list_parameters.go | 253 + .../client/ipam/ip_amroles_list_responses.go | 81 + .../ip_amroles_partial_update_parameters.go | 173 + .../ip_amroles_partial_update_responses.go | 81 + .../client/ipam/ip_amroles_read_parameters.go | 152 + .../client/ipam/ip_amroles_read_responses.go | 81 + .../ipam/ip_amroles_update_parameters.go | 173 + .../ipam/ip_amroles_update_responses.go | 81 + .../ipam/ip_amservices_create_parameters.go | 151 + .../ipam/ip_amservices_create_responses.go | 81 + .../ipam/ip_amservices_delete_parameters.go | 152 + .../ipam/ip_amservices_delete_responses.go | 70 + .../ipam/ip_amservices_list_parameters.go | 398 + .../ipam/ip_amservices_list_responses.go | 81 + ...ip_amservices_partial_update_parameters.go | 173 + .../ip_amservices_partial_update_responses.go | 81 + .../ipam/ip_amservices_read_parameters.go | 152 + .../ipam/ip_amservices_read_responses.go | 81 + .../ipam/ip_amservices_update_parameters.go | 173 + .../ipam/ip_amservices_update_responses.go | 81 + .../ip_amvlan_groups_create_parameters.go | 151 + .../ipam/ip_amvlan_groups_create_responses.go | 81 + .../ip_amvlan_groups_delete_parameters.go | 152 + .../ipam/ip_amvlan_groups_delete_responses.go | 70 + .../ipam/ip_amvlan_groups_list_parameters.go | 311 + .../ipam/ip_amvlan_groups_list_responses.go | 81 + ...amvlan_groups_partial_update_parameters.go | 173 + ..._amvlan_groups_partial_update_responses.go | 81 + .../ipam/ip_amvlan_groups_read_parameters.go | 152 + .../ipam/ip_amvlan_groups_read_responses.go | 81 + .../ip_amvlan_groups_update_parameters.go | 173 + .../ipam/ip_amvlan_groups_update_responses.go | 81 + .../ipam/ip_amvlans_create_parameters.go | 151 + .../ipam/ip_amvlans_create_responses.go | 81 + .../ipam/ip_amvlans_delete_parameters.go | 152 + .../ipam/ip_amvlans_delete_responses.go | 70 + .../client/ipam/ip_amvlans_list_parameters.go | 575 + .../client/ipam/ip_amvlans_list_responses.go | 81 + .../ip_amvlans_partial_update_parameters.go | 173 + .../ip_amvlans_partial_update_responses.go | 81 + .../client/ipam/ip_amvlans_read_parameters.go | 152 + .../client/ipam/ip_amvlans_read_responses.go | 81 + .../ipam/ip_amvlans_update_parameters.go | 173 + .../ipam/ip_amvlans_update_responses.go | 81 + .../ipam/ip_amvrfs_create_parameters.go | 151 + .../client/ipam/ip_amvrfs_create_responses.go | 81 + .../ipam/ip_amvrfs_delete_parameters.go | 152 + .../client/ipam/ip_amvrfs_delete_responses.go | 70 + .../client/ipam/ip_amvrfs_list_parameters.go | 401 + .../client/ipam/ip_amvrfs_list_responses.go | 81 + .../ip_amvrfs_partial_update_parameters.go | 173 + .../ip_amvrfs_partial_update_responses.go | 81 + .../client/ipam/ip_amvrfs_read_parameters.go | 152 + .../client/ipam/ip_amvrfs_read_responses.go | 81 + .../ipam/ip_amvrfs_update_parameters.go | 173 + .../client/ipam/ip_amvrfs_update_responses.go | 81 + .../go-netbox/netbox/client/net_box_client.go | 171 + .../secrets_choices_list_parameters.go | 128 + .../secrets/secrets_choices_list_responses.go | 70 + .../secrets_choices_read_parameters.go | 148 + .../secrets/secrets_choices_read_responses.go | 70 + .../netbox/client/secrets/secrets_client.go | 526 + ...s_generate_rsa_key_pair_list_parameters.go | 128 + ...ts_generate_rsa_key_pair_list_responses.go | 70 + ...crets_get_session_key_create_parameters.go | 128 + ...ecrets_get_session_key_create_responses.go | 70 + .../secrets_secret_roles_create_parameters.go | 151 + .../secrets_secret_roles_create_responses.go | 81 + .../secrets_secret_roles_delete_parameters.go | 152 + .../secrets_secret_roles_delete_responses.go | 70 + .../secrets_secret_roles_list_parameters.go | 253 + .../secrets_secret_roles_list_responses.go | 81 + ..._secret_roles_partial_update_parameters.go | 173 + ...s_secret_roles_partial_update_responses.go | 81 + .../secrets_secret_roles_read_parameters.go | 152 + .../secrets_secret_roles_read_responses.go | 81 + .../secrets_secret_roles_update_parameters.go | 173 + .../secrets_secret_roles_update_responses.go | 81 + .../secrets_secrets_create_parameters.go | 151 + .../secrets_secrets_create_responses.go | 81 + .../secrets_secrets_delete_parameters.go | 152 + .../secrets_secrets_delete_responses.go | 70 + .../secrets_secrets_list_parameters.go | 401 + .../secrets/secrets_secrets_list_responses.go | 81 + ...crets_secrets_partial_update_parameters.go | 173 + ...ecrets_secrets_partial_update_responses.go | 81 + .../secrets_secrets_read_parameters.go | 152 + .../secrets/secrets_secrets_read_responses.go | 81 + .../secrets_secrets_update_parameters.go | 173 + .../secrets_secrets_update_responses.go | 81 + .../tenancy_choices_list_parameters.go | 128 + .../tenancy/tenancy_choices_list_responses.go | 70 + .../tenancy_choices_read_parameters.go | 148 + .../tenancy/tenancy_choices_read_responses.go | 70 + .../netbox/client/tenancy/tenancy_client.go | 450 + ...tenancy_tenant_groups_create_parameters.go | 151 + .../tenancy_tenant_groups_create_responses.go | 81 + ...tenancy_tenant_groups_delete_parameters.go | 152 + .../tenancy_tenant_groups_delete_responses.go | 70 + .../tenancy_tenant_groups_list_parameters.go | 253 + .../tenancy_tenant_groups_list_responses.go | 81 + ...tenant_groups_partial_update_parameters.go | 173 + ..._tenant_groups_partial_update_responses.go | 81 + .../tenancy_tenant_groups_read_parameters.go | 152 + .../tenancy_tenant_groups_read_responses.go | 81 + ...tenancy_tenant_groups_update_parameters.go | 173 + .../tenancy_tenant_groups_update_responses.go | 81 + .../tenancy_tenants_create_parameters.go | 151 + .../tenancy_tenants_create_responses.go | 81 + .../tenancy_tenants_delete_parameters.go | 152 + .../tenancy_tenants_delete_responses.go | 70 + .../tenancy_tenants_list_parameters.go | 343 + .../tenancy/tenancy_tenants_list_responses.go | 81 + ...nancy_tenants_partial_update_parameters.go | 173 + ...enancy_tenants_partial_update_responses.go | 81 + .../tenancy_tenants_read_parameters.go | 152 + .../tenancy/tenancy_tenants_read_responses.go | 81 + .../tenancy_tenants_update_parameters.go | 173 + .../tenancy_tenants_update_responses.go | 81 + .../virtualization_choices_list_parameters.go | 128 + .../virtualization_choices_list_responses.go | 70 + .../virtualization_choices_read_parameters.go | 148 + .../virtualization_choices_read_responses.go | 70 + .../virtualization/virtualization_client.go | 972 + ...zation_cluster_groups_create_parameters.go | 151 + ...ization_cluster_groups_create_responses.go | 81 + ...zation_cluster_groups_delete_parameters.go | 152 + ...ization_cluster_groups_delete_responses.go | 70 + ...lization_cluster_groups_list_parameters.go | 253 + ...alization_cluster_groups_list_responses.go | 81 + ...luster_groups_partial_update_parameters.go | 173 + ...cluster_groups_partial_update_responses.go | 81 + ...lization_cluster_groups_read_parameters.go | 152 + ...alization_cluster_groups_read_responses.go | 81 + ...zation_cluster_groups_update_parameters.go | 173 + ...ization_cluster_groups_update_responses.go | 81 + ...ization_cluster_types_create_parameters.go | 151 + ...lization_cluster_types_create_responses.go | 81 + ...ization_cluster_types_delete_parameters.go | 152 + ...lization_cluster_types_delete_responses.go | 70 + ...alization_cluster_types_list_parameters.go | 253 + ...ualization_cluster_types_list_responses.go | 81 + ...cluster_types_partial_update_parameters.go | 173 + ..._cluster_types_partial_update_responses.go | 81 + ...alization_cluster_types_read_parameters.go | 152 + ...ualization_cluster_types_read_responses.go | 81 + ...ization_cluster_types_update_parameters.go | 173 + ...lization_cluster_types_update_responses.go | 81 + ...rtualization_clusters_create_parameters.go | 151 + ...irtualization_clusters_create_responses.go | 81 + ...rtualization_clusters_delete_parameters.go | 152 + ...irtualization_clusters_delete_responses.go | 70 + ...virtualization_clusters_list_parameters.go | 459 + .../virtualization_clusters_list_responses.go | 81 + ...tion_clusters_partial_update_parameters.go | 173 + ...ation_clusters_partial_update_responses.go | 81 + ...virtualization_clusters_read_parameters.go | 152 + .../virtualization_clusters_read_responses.go | 81 + ...rtualization_clusters_update_parameters.go | 173 + ...irtualization_clusters_update_responses.go | 81 + ...ualization_interfaces_create_parameters.go | 151 + ...tualization_interfaces_create_responses.go | 81 + ...ualization_interfaces_delete_parameters.go | 152 + ...tualization_interfaces_delete_responses.go | 70 + ...rtualization_interfaces_list_parameters.go | 369 + ...irtualization_interfaces_list_responses.go | 81 + ...on_interfaces_partial_update_parameters.go | 173 + ...ion_interfaces_partial_update_responses.go | 81 + ...rtualization_interfaces_read_parameters.go | 152 + ...irtualization_interfaces_read_responses.go | 81 + ...ualization_interfaces_update_parameters.go | 173 + ...tualization_interfaces_update_responses.go | 81 + ...tion_virtual_machines_create_parameters.go | 151 + ...ation_virtual_machines_create_responses.go | 81 + ...tion_virtual_machines_delete_parameters.go | 152 + ...ation_virtual_machines_delete_responses.go | 70 + ...zation_virtual_machines_list_parameters.go | 720 + ...ization_virtual_machines_list_responses.go | 81 + ...tual_machines_partial_update_parameters.go | 173 + ...rtual_machines_partial_update_responses.go | 81 + ...zation_virtual_machines_read_parameters.go | 152 + ...ization_virtual_machines_read_responses.go | 81 + ...tion_virtual_machines_update_parameters.go | 173 + ...ation_virtual_machines_update_responses.go | 81 + .../go-netbox/netbox/models/aggregate.go | 192 + .../go-netbox/netbox/models/circuit.go | 266 + .../go-netbox/netbox/models/circuit_status.go | 97 + .../netbox/models/circuit_termination.go | 302 + .../go-netbox/netbox/models/circuit_type.go | 116 + ...rcuits_circuit_terminations_list_okbody.go | 110 + ...ircuit_terminations_list_okbody_results.go | 61 + .../circuits_circuit_types_list_okbody.go | 110 + ...cuits_circuit_types_list_okbody_results.go | 61 + .../models/circuits_circuits_list_okbody.go | 110 + .../circuits_circuits_list_okbody_results.go | 61 + .../models/circuits_providers_list_okbody.go | 110 + .../circuits_providers_list_okbody_results.go | 61 + .../go-netbox/netbox/models/cluster.go | 186 + .../go-netbox/netbox/models/cluster_group.go | 116 + .../go-netbox/netbox/models/cluster_type.go | 116 + .../go-netbox/netbox/models/console_port.go | 188 + .../netbox/models/console_port_template.go | 116 + .../netbox/models/console_server_port.go | 120 + .../models/console_server_port_template.go | 116 + .../dcim_console_connections_list_okbody.go | 110 + ...console_connections_list_okbody_results.go | 61 + ...dcim_console_port_templates_list_okbody.go | 110 + ...sole_port_templates_list_okbody_results.go | 61 + .../models/dcim_console_ports_list_okbody.go | 110 + .../dcim_console_ports_list_okbody_results.go | 61 + ...nsole_server_port_templates_list_okbody.go | 110 + ...rver_port_templates_list_okbody_results.go | 61 + .../dcim_console_server_ports_list_okbody.go | 110 + ...onsole_server_ports_list_okbody_results.go | 61 + .../dcim_device_bay_templates_list_okbody.go | 110 + ...evice_bay_templates_list_okbody_results.go | 61 + .../models/dcim_device_bays_list_okbody.go | 110 + .../dcim_device_bays_list_okbody_results.go | 61 + .../models/dcim_device_roles_list_okbody.go | 110 + .../dcim_device_roles_list_okbody_results.go | 61 + .../models/dcim_device_types_list_okbody.go | 110 + .../dcim_device_types_list_okbody_results.go | 61 + .../netbox/models/dcim_devices_list_okbody.go | 110 + .../dcim_devices_list_okbody_results.go | 61 + .../dcim_interface_connections_list_okbody.go | 110 + ...terface_connections_list_okbody_results.go | 61 + .../dcim_interface_templates_list_okbody.go | 110 + ...interface_templates_list_okbody_results.go | 61 + .../models/dcim_interfaces_list_okbody.go | 110 + .../dcim_interfaces_list_okbody_results.go | 61 + .../dcim_inventory_items_list_okbody.go | 110 + ...cim_inventory_items_list_okbody_results.go | 61 + .../models/dcim_manufacturers_list_okbody.go | 110 + .../dcim_manufacturers_list_okbody_results.go | 61 + .../models/dcim_platforms_list_okbody.go | 110 + .../dcim_platforms_list_okbody_results.go | 61 + .../dcim_power_connections_list_okbody.go | 110 + ...m_power_connections_list_okbody_results.go | 61 + ...dcim_power_outlet_templates_list_okbody.go | 110 + ...er_outlet_templates_list_okbody_results.go | 61 + .../models/dcim_power_outlets_list_okbody.go | 110 + .../dcim_power_outlets_list_okbody_results.go | 61 + .../dcim_power_port_templates_list_okbody.go | 110 + ...ower_port_templates_list_okbody_results.go | 61 + .../models/dcim_power_ports_list_okbody.go | 110 + .../dcim_power_ports_list_okbody_results.go | 61 + .../models/dcim_rack_groups_list_okbody.go | 110 + .../dcim_rack_groups_list_okbody_results.go | 61 + .../dcim_rack_reservations_list_okbody.go | 110 + ...m_rack_reservations_list_okbody_results.go | 61 + .../models/dcim_rack_roles_list_okbody.go | 110 + .../dcim_rack_roles_list_okbody_results.go | 61 + .../netbox/models/dcim_racks_list_okbody.go | 110 + .../models/dcim_racks_list_okbody_results.go | 61 + .../netbox/models/dcim_regions_list_okbody.go | 110 + .../dcim_regions_list_okbody_results.go | 61 + .../netbox/models/dcim_sites_list_okbody.go | 110 + .../models/dcim_sites_list_okbody_results.go | 61 + .../dcim_virtual_chassis_list_okbody.go | 110 + ...cim_virtual_chassis_list_okbody_results.go | 61 + .../go-netbox/netbox/models/device.go | 604 + .../go-netbox/netbox/models/device_bay.go | 144 + .../netbox/models/device_bay_template.go | 116 + .../go-netbox/netbox/models/device_face.go | 97 + .../netbox/models/device_ip_address.go | 93 + .../go-netbox/netbox/models/device_role.go | 149 + .../go-netbox/netbox/models/device_status.go | 97 + .../go-netbox/netbox/models/device_type.go | 281 + .../models/device_type_interface_ordering.go | 97 + .../models/device_type_subdevice_role.go | 97 + .../netbox/models/device_virtual_chassis.go | 97 + .../netbox/models/export_template.go | 190 + .../extras_export_templates_list_okbody.go | 110 + ...as_export_templates_list_okbody_results.go | 61 + .../models/extras_graphs_list_okbody.go | 110 + .../extras_graphs_list_okbody_results.go | 61 + .../extras_image_attachments_list_okbody.go | 110 + ...s_image_attachments_list_okbody_results.go | 61 + .../extras_recent_activity_list_okbody.go | 110 + ...ras_recent_activity_list_okbody_results.go | 61 + .../extras_topology_maps_list_okbody.go | 110 + ...xtras_topology_maps_list_okbody_results.go | 61 + .../go-netbox/netbox/models/graph.go | 192 + .../go-netbox/netbox/models/graph_type.go | 97 + .../netbox/models/image_attachment.go | 174 + .../go-netbox/netbox/models/interface.go | 349 + .../models/interface_circuit_termination.go | 246 + .../netbox/models/interface_connection.go | 149 + .../interface_connection_connection_status.go | 97 + .../netbox/models/interface_form_factor.go | 97 + .../go-netbox/netbox/models/interface_mode.go | 97 + .../netbox/models/interface_nested_circuit.go | 92 + .../netbox/models/interface_tagged_vlans.go | 61 + .../netbox/models/interface_template.go | 147 + .../models/interface_template_form_factor.go | 97 + .../go-netbox/netbox/models/interface_vlan.go | 124 + .../go-netbox/netbox/models/inventory_item.go | 255 + .../go-netbox/netbox/models/ip_address.go | 318 + .../netbox/models/ip_address_interface.go | 148 + .../netbox/models/ip_address_role.go | 97 + .../netbox/models/ip_address_status.go | 97 + .../models/ip_amaggregates_list_okbody.go | 110 + .../ip_amaggregates_list_okbody_results.go | 61 + .../models/ip_amip_addresses_list_okbody.go | 110 + .../ip_amip_addresses_list_okbody_results.go | 61 + .../models/ip_amprefixes_list_okbody.go | 110 + .../ip_amprefixes_list_okbody_results.go | 61 + .../netbox/models/ip_amrirs_list_okbody.go | 110 + .../models/ip_amrirs_list_okbody_results.go | 61 + .../netbox/models/ip_amroles_list_okbody.go | 110 + .../models/ip_amroles_list_okbody_results.go | 61 + .../models/ip_amservices_list_okbody.go | 110 + .../ip_amservices_list_okbody_results.go | 61 + .../models/ip_amvlan_groups_list_okbody.go | 110 + .../ip_amvlan_groups_list_okbody_results.go | 61 + .../netbox/models/ip_amvlans_list_okbody.go | 110 + .../models/ip_amvlans_list_okbody_results.go | 61 + .../netbox/models/ip_amvrfs_list_okbody.go | 110 + .../models/ip_amvrfs_list_okbody_results.go | 61 + .../go-netbox/netbox/models/manufacturer.go | 116 + .../go-netbox/netbox/models/nested_circuit.go | 92 + .../netbox/models/nested_circuit_type.go | 120 + .../go-netbox/netbox/models/nested_cluster.go | 92 + .../netbox/models/nested_cluster_group.go | 120 + .../netbox/models/nested_cluster_type.go | 120 + .../go-netbox/netbox/models/nested_device.go | 95 + .../netbox/models/nested_device_role.go | 120 + .../netbox/models/nested_device_type.go | 148 + .../netbox/models/nested_interface.go | 92 + .../netbox/models/nested_ip_address.go | 93 + .../netbox/models/nested_manufacturer.go | 120 + .../netbox/models/nested_platform.go | 120 + .../netbox/models/nested_provider.go | 120 + .../go-netbox/netbox/models/nested_rack.go | 96 + .../netbox/models/nested_rack_group.go | 120 + .../netbox/models/nested_rack_role.go | 120 + .../go-netbox/netbox/models/nested_region.go | 120 + .../go-netbox/netbox/models/nested_rir.go | 120 + .../go-netbox/netbox/models/nested_role.go | 120 + .../netbox/models/nested_secret_role.go | 120 + .../go-netbox/netbox/models/nested_site.go | 120 + .../go-netbox/netbox/models/nested_tenant.go | 120 + .../netbox/models/nested_tenant_group.go | 120 + .../go-netbox/netbox/models/nested_user.go | 95 + .../netbox/models/nested_virtual_machine.go | 92 + .../go-netbox/netbox/models/nested_vlan.go | 124 + .../netbox/models/nested_vlangroup.go | 120 + .../go-netbox/netbox/models/nested_vrf.go | 115 + .../go-netbox/netbox/models/peer_interface.go | 236 + .../models/peer_interface_form_factor.go | 97 + .../go-netbox/netbox/models/platform.go | 221 + .../go-netbox/netbox/models/power_outlet.go | 120 + .../netbox/models/power_outlet_template.go | 116 + .../go-netbox/netbox/models/power_port.go | 188 + .../netbox/models/power_port_template.go | 116 + .../go-netbox/netbox/models/prefix.go | 295 + .../go-netbox/netbox/models/prefix_status.go | 97 + .../go-netbox/netbox/models/provider.go | 211 + .../go-netbox/netbox/models/rack.go | 351 + .../go-netbox/netbox/models/rack_group.go | 144 + .../netbox/models/rack_reservation.go | 212 + .../go-netbox/netbox/models/rack_role.go | 144 + .../go-netbox/netbox/models/rack_type.go | 97 + .../go-netbox/netbox/models/rack_width.go | 97 + .../go-netbox/netbox/models/region.go | 144 + .../go-netbox/netbox/models/rir.go | 121 + .../go-netbox/netbox/models/role.go | 143 + .../go-netbox/netbox/models/secret.go | 160 + .../go-netbox/netbox/models/secret_role.go | 116 + .../secrets_secret_roles_list_okbody.go | 110 + ...ecrets_secret_roles_list_okbody_results.go | 61 + .../models/secrets_secrets_list_okbody.go | 110 + .../secrets_secrets_list_okbody_results.go | 61 + .../go-netbox/netbox/models/service.go | 255 + .../netbox/models/service_ipaddresses.go | 61 + .../netbox/models/service_protocol.go | 97 + .../go-netbox/netbox/models/site.go | 422 + .../go-netbox/netbox/models/site_status.go | 97 + .../tenancy_tenant_groups_list_okbody.go | 110 + ...nancy_tenant_groups_list_okbody_results.go | 61 + .../models/tenancy_tenants_list_okbody.go | 110 + .../tenancy_tenants_list_okbody_results.go | 61 + .../go-netbox/netbox/models/tenant.go | 182 + .../go-netbox/netbox/models/tenant_group.go | 116 + .../go-netbox/netbox/models/topology_map.go | 186 + .../go-netbox/netbox/models/user_action.go | 128 + .../netbox/models/user_action_action.go | 97 + .../netbox/models/virtual_chassis.go | 115 + .../netbox/models/virtual_machine.go | 407 + .../models/virtual_machine_ip_address.go | 93 + .../netbox/models/virtual_machine_status.go | 97 + ...rtualization_cluster_groups_list_okbody.go | 110 + ...tion_cluster_groups_list_okbody_results.go | 61 + ...irtualization_cluster_types_list_okbody.go | 110 + ...ation_cluster_types_list_okbody_results.go | 61 + .../virtualization_clusters_list_okbody.go | 110 + ...ualization_clusters_list_okbody_results.go | 61 + .../virtualization_interfaces_list_okbody.go | 110 + ...lization_interfaces_list_okbody_results.go | 61 + ...ualization_virtual_machines_list_okbody.go | 110 + ...on_virtual_machines_list_okbody_results.go | 61 + .../go-netbox/netbox/models/vlan.go | 293 + .../go-netbox/netbox/models/vlangroup.go | 144 + .../go-netbox/netbox/models/vlanstatus.go | 97 + .../go-netbox/netbox/models/vrf.go | 181 + .../netbox/models/writable_aggregate.go | 137 + .../netbox/models/writable_circuit.go | 237 + .../models/writable_circuit_termination.go | 257 + .../netbox/models/writable_cluster.go | 126 + .../netbox/models/writable_console_port.go | 153 + .../models/writable_console_port_template.go | 106 + .../models/writable_console_server_port.go | 106 + .../writable_console_server_port_template.go | 106 + .../netbox/models/writable_device.go | 391 + .../netbox/models/writable_device_bay.go | 109 + .../models/writable_device_bay_template.go | 106 + .../netbox/models/writable_device_type.go | 299 + .../go-netbox/netbox/models/writable_graph.go | 209 + .../models/writable_image_attachment.go | 156 + .../netbox/models/writable_interface.go | 280 + .../models/writable_interface_connection.go | 145 + .../models/writable_interface_template.go | 153 + .../netbox/models/writable_inventory_item.go | 205 + .../netbox/models/writable_ip_address.go | 222 + .../netbox/models/writable_platform.go | 198 + .../netbox/models/writable_power_outlet.go | 106 + .../models/writable_power_outlet_template.go | 106 + .../netbox/models/writable_power_port.go | 153 + .../models/writable_power_port_template.go | 106 + .../netbox/models/writable_prefix.go | 186 + .../netbox/models/writable_provider.go | 211 + .../go-netbox/netbox/models/writable_rack.go | 293 + .../netbox/models/writable_rack_group.go | 134 + .../models/writable_rack_reservation.go | 160 + .../netbox/models/writable_region.go | 119 + .../netbox/models/writable_secret.go | 153 + .../netbox/models/writable_service.go | 219 + .../go-netbox/netbox/models/writable_site.go | 368 + .../netbox/models/writable_tenant.go | 157 + .../netbox/models/writable_topology_map.go | 161 + .../netbox/models/writable_virtual_chassis.go | 105 + .../netbox/models/writable_virtual_machine.go | 260 + .../go-netbox/netbox/models/writable_vlan.go | 205 + .../netbox/models/writable_vlangroup.go | 119 + .../go-netbox/netbox/models/writable_vrf.go | 152 + .../digitalocean/go-netbox/netbox/netbox.go | 43 + .../go-netbox/scripts/licensecheck.sh | 43 + go/vendor/github.com/globalsign/mgo/LICENSE | 25 + .../github.com/globalsign/mgo/bson/LICENSE | 25 + .../github.com/globalsign/mgo/bson/README.md | 12 + .../github.com/globalsign/mgo/bson/bson.go | 836 + .../bson/bson_corpus_spec_test_generator.go | 294 + .../globalsign/mgo/bson/compatibility.go | 29 + .../github.com/globalsign/mgo/bson/decimal.go | 312 + .../github.com/globalsign/mgo/bson/decode.go | 1055 + .../github.com/globalsign/mgo/bson/encode.go | 645 + .../github.com/globalsign/mgo/bson/json.go | 384 + .../github.com/globalsign/mgo/bson/stream.go | 90 + .../globalsign/mgo/internal/json/LICENSE | 27 + .../globalsign/mgo/internal/json/decode.go | 1685 + .../globalsign/mgo/internal/json/encode.go | 1260 + .../globalsign/mgo/internal/json/extension.go | 95 + .../globalsign/mgo/internal/json/fold.go | 143 + .../globalsign/mgo/internal/json/indent.go | 141 + .../globalsign/mgo/internal/json/scanner.go | 697 + .../globalsign/mgo/internal/json/stream.go | 510 + .../globalsign/mgo/internal/json/tags.go | 44 + .../github.com/go-ole/go-ole/.travis.yml | 9 + .../github.com/go-ole/go-ole/ChangeLog.md | 49 + go/vendor/github.com/go-ole/go-ole/LICENSE | 21 + go/vendor/github.com/go-ole/go-ole/README.md | 46 + .../github.com/go-ole/go-ole/appveyor.yml | 54 + go/vendor/github.com/go-ole/go-ole/com.go | 329 + .../github.com/go-ole/go-ole/com_func.go | 174 + go/vendor/github.com/go-ole/go-ole/connect.go | 192 + .../github.com/go-ole/go-ole/constants.go | 153 + go/vendor/github.com/go-ole/go-ole/error.go | 51 + .../github.com/go-ole/go-ole/error_func.go | 8 + .../github.com/go-ole/go-ole/error_windows.go | 24 + go/vendor/github.com/go-ole/go-ole/guid.go | 284 + .../go-ole/go-ole/iconnectionpoint.go | 20 + .../go-ole/go-ole/iconnectionpoint_func.go | 21 + .../go-ole/go-ole/iconnectionpoint_windows.go | 43 + .../go-ole/iconnectionpointcontainer.go | 17 + .../go-ole/iconnectionpointcontainer_func.go | 11 + .../iconnectionpointcontainer_windows.go | 25 + .../github.com/go-ole/go-ole/idispatch.go | 94 + .../go-ole/go-ole/idispatch_func.go | 19 + .../go-ole/go-ole/idispatch_windows.go | 197 + .../github.com/go-ole/go-ole/ienumvariant.go | 19 + .../go-ole/go-ole/ienumvariant_func.go | 19 + .../go-ole/go-ole/ienumvariant_windows.go | 63 + .../github.com/go-ole/go-ole/iinspectable.go | 18 + .../go-ole/go-ole/iinspectable_func.go | 15 + .../go-ole/go-ole/iinspectable_windows.go | 72 + .../go-ole/go-ole/iprovideclassinfo.go | 21 + .../go-ole/go-ole/iprovideclassinfo_func.go | 7 + .../go-ole/iprovideclassinfo_windows.go | 21 + .../github.com/go-ole/go-ole/itypeinfo.go | 34 + .../go-ole/go-ole/itypeinfo_func.go | 7 + .../go-ole/go-ole/itypeinfo_windows.go | 21 + .../github.com/go-ole/go-ole/iunknown.go | 57 + .../github.com/go-ole/go-ole/iunknown_func.go | 19 + .../go-ole/go-ole/iunknown_windows.go | 58 + go/vendor/github.com/go-ole/go-ole/ole.go | 157 + .../go-ole/go-ole/oleutil/connection.go | 100 + .../go-ole/go-ole/oleutil/connection_func.go | 10 + .../go-ole/oleutil/connection_windows.go | 58 + .../go-ole/go-ole/oleutil/go-get.go | 6 + .../go-ole/go-ole/oleutil/oleutil.go | 127 + .../github.com/go-ole/go-ole/safearray.go | 27 + .../go-ole/go-ole/safearray_func.go | 211 + .../go-ole/go-ole/safearray_windows.go | 337 + .../go-ole/go-ole/safearrayconversion.go | 140 + .../go-ole/go-ole/safearrayslices.go | 33 + go/vendor/github.com/go-ole/go-ole/utility.go | 101 + .../github.com/go-ole/go-ole/variables.go | 16 + go/vendor/github.com/go-ole/go-ole/variant.go | 105 + .../github.com/go-ole/go-ole/variant_386.go | 11 + .../github.com/go-ole/go-ole/variant_amd64.go | 12 + .../github.com/go-ole/go-ole/variant_s390x.go | 12 + .../github.com/go-ole/go-ole/vt_string.go | 58 + go/vendor/github.com/go-ole/go-ole/winrt.go | 99 + .../github.com/go-ole/go-ole/winrt_doc.go | 36 + .../github.com/go-openapi/analysis/.gitignore | 5 + .../go-openapi/analysis/.golangci.yml | 19 + .../go-openapi/analysis/.travis.yml | 24 + .../go-openapi/analysis/CODE_OF_CONDUCT.md | 74 + .../github.com/go-openapi/analysis/LICENSE | 202 + .../github.com/go-openapi/analysis/README.md | 9 + .../go-openapi/analysis/analyzer.go | 892 + .../github.com/go-openapi/analysis/debug.go | 47 + .../github.com/go-openapi/analysis/doc.go | 43 + .../github.com/go-openapi/analysis/fixer.go | 76 + .../github.com/go-openapi/analysis/flatten.go | 1500 + .../github.com/go-openapi/analysis/go.mod | 10 + .../github.com/go-openapi/analysis/go.sum | 37 + .../go-openapi/analysis/internal/post_go18.go | 29 + .../go-openapi/analysis/internal/pre_go18.go | 29 + .../github.com/go-openapi/analysis/mixin.go | 334 + .../github.com/go-openapi/analysis/schema.go | 234 + .../github.com/go-openapi/errors/.gitignore | 2 + .../github.com/go-openapi/errors/.travis.yml | 14 + .../go-openapi/errors/CODE_OF_CONDUCT.md | 74 + .../github.com/go-openapi/errors/LICENSE | 202 + .../github.com/go-openapi/errors/README.md | 8 + go/vendor/github.com/go-openapi/errors/api.go | 166 + .../github.com/go-openapi/errors/auth.go | 20 + go/vendor/github.com/go-openapi/errors/doc.go | 28 + go/vendor/github.com/go-openapi/errors/go.mod | 7 + go/vendor/github.com/go-openapi/errors/go.sum | 5 + .../github.com/go-openapi/errors/headers.go | 85 + .../go-openapi/errors/middleware.go | 51 + .../github.com/go-openapi/errors/parsing.go | 59 + .../github.com/go-openapi/errors/schema.go | 562 + .../go-openapi/jsonpointer/.editorconfig | 26 + .../go-openapi/jsonpointer/.gitignore | 1 + .../go-openapi/jsonpointer/.travis.yml | 15 + .../go-openapi/jsonpointer/CODE_OF_CONDUCT.md | 74 + .../github.com/go-openapi/jsonpointer/LICENSE | 202 + .../go-openapi/jsonpointer/README.md | 15 + .../github.com/go-openapi/jsonpointer/go.mod | 10 + .../github.com/go-openapi/jsonpointer/go.sum | 11 + .../go-openapi/jsonpointer/pointer.go | 390 + .../go-openapi/jsonreference/.gitignore | 1 + .../go-openapi/jsonreference/.travis.yml | 16 + .../jsonreference/CODE_OF_CONDUCT.md | 74 + .../go-openapi/jsonreference/LICENSE | 202 + .../go-openapi/jsonreference/README.md | 15 + .../go-openapi/jsonreference/go.mod | 15 + .../go-openapi/jsonreference/go.sum | 20 + .../go-openapi/jsonreference/reference.go | 156 + .../github.com/go-openapi/loads/.drone.sec | 1 + .../github.com/go-openapi/loads/.drone.yml | 39 + .../github.com/go-openapi/loads/.editorconfig | 26 + .../github.com/go-openapi/loads/.gitignore | 4 + .../github.com/go-openapi/loads/.travis.yml | 18 + .../go-openapi/loads/CODE_OF_CONDUCT.md | 74 + go/vendor/github.com/go-openapi/loads/LICENSE | 202 + .../github.com/go-openapi/loads/README.md | 5 + go/vendor/github.com/go-openapi/loads/go.mod | 23 + go/vendor/github.com/go-openapi/loads/go.sum | 36 + go/vendor/github.com/go-openapi/loads/spec.go | 279 + .../go-openapi/runtime/.editorconfig | 26 + .../github.com/go-openapi/runtime/.gitignore | 5 + .../github.com/go-openapi/runtime/.travis.yml | 24 + .../go-openapi/runtime/CODE_OF_CONDUCT.md | 74 + .../github.com/go-openapi/runtime/LICENSE | 202 + .../github.com/go-openapi/runtime/README.md | 5 + .../go-openapi/runtime/bytestream.go | 151 + .../go-openapi/runtime/client/auth_info.go | 60 + .../go-openapi/runtime/client/keepalive.go | 53 + .../go-openapi/runtime/client/request.go | 374 + .../go-openapi/runtime/client/response.go | 44 + .../go-openapi/runtime/client/runtime.go | 437 + .../go-openapi/runtime/client_auth_info.go | 30 + .../go-openapi/runtime/client_operation.go | 41 + .../go-openapi/runtime/client_request.go | 100 + .../go-openapi/runtime/client_response.go | 63 + .../go-openapi/runtime/constants.go | 45 + .../github.com/go-openapi/runtime/discard.go | 9 + .../github.com/go-openapi/runtime/file.go | 33 + .../github.com/go-openapi/runtime/go.mod | 14 + .../github.com/go-openapi/runtime/go.sum | 43 + .../github.com/go-openapi/runtime/headers.go | 45 + .../go-openapi/runtime/interfaces.go | 103 + .../github.com/go-openapi/runtime/json.go | 37 + .../go-openapi/runtime/logger/logger.go | 12 + .../go-openapi/runtime/logger/standard.go | 22 + .../go-openapi/runtime/middleware/context.go | 582 + .../runtime/middleware/denco/LICENSE | 19 + .../runtime/middleware/denco/README.md | 180 + .../runtime/middleware/denco/router.go | 452 + .../runtime/middleware/denco/server.go | 106 + .../runtime/middleware/denco/util.go | 12 + .../go-openapi/runtime/middleware/doc.go | 62 + .../go-openapi/runtime/middleware/go18.go | 9 + .../runtime/middleware/header/header.go | 326 + .../runtime/middleware/negotiate.go | 98 + .../runtime/middleware/not_implemented.go | 48 + .../runtime/middleware/operation.go | 30 + .../runtime/middleware/parameter.go | 480 + .../go-openapi/runtime/middleware/pre_go18.go | 9 + .../go-openapi/runtime/middleware/redoc.go | 101 + .../go-openapi/runtime/middleware/request.go | 104 + .../go-openapi/runtime/middleware/router.go | 478 + .../go-openapi/runtime/middleware/security.go | 39 + .../go-openapi/runtime/middleware/spec.go | 48 + .../runtime/middleware/untyped/api.go | 286 + .../runtime/middleware/validation.go | 122 + .../github.com/go-openapi/runtime/request.go | 77 + .../runtime/security/authenticator.go | 215 + .../go-openapi/runtime/security/authorizer.go | 27 + .../github.com/go-openapi/runtime/statuses.go | 90 + .../github.com/go-openapi/runtime/text.go | 111 + .../github.com/go-openapi/runtime/values.go | 19 + .../github.com/go-openapi/runtime/xml.go | 36 + .../github.com/go-openapi/spec/.editorconfig | 26 + .../github.com/go-openapi/spec/.gitignore | 2 + .../github.com/go-openapi/spec/.golangci.yml | 21 + .../github.com/go-openapi/spec/.travis.yml | 18 + .../go-openapi/spec/CODE_OF_CONDUCT.md | 74 + go/vendor/github.com/go-openapi/spec/LICENSE | 202 + .../github.com/go-openapi/spec/README.md | 10 + .../github.com/go-openapi/spec/bindata.go | 260 + .../go-openapi/spec/contact_info.go | 24 + go/vendor/github.com/go-openapi/spec/debug.go | 47 + .../github.com/go-openapi/spec/expander.go | 1227 + .../go-openapi/spec/external_docs.go | 24 + go/vendor/github.com/go-openapi/spec/go.mod | 16 + go/vendor/github.com/go-openapi/spec/go.sum | 22 + .../github.com/go-openapi/spec/header.go | 193 + go/vendor/github.com/go-openapi/spec/info.go | 168 + go/vendor/github.com/go-openapi/spec/items.go | 233 + .../github.com/go-openapi/spec/license.go | 23 + .../github.com/go-openapi/spec/operation.go | 259 + .../github.com/go-openapi/spec/parameter.go | 302 + .../github.com/go-openapi/spec/path_item.go | 90 + go/vendor/github.com/go-openapi/spec/paths.go | 97 + go/vendor/github.com/go-openapi/spec/ref.go | 167 + .../github.com/go-openapi/spec/response.go | 134 + .../github.com/go-openapi/spec/responses.go | 127 + .../github.com/go-openapi/spec/schema.go | 636 + .../go-openapi/spec/security_scheme.go | 143 + go/vendor/github.com/go-openapi/spec/spec.go | 86 + .../github.com/go-openapi/spec/swagger.go | 318 + go/vendor/github.com/go-openapi/spec/tag.go | 74 + .../github.com/go-openapi/spec/xml_object.go | 68 + .../go-openapi/strfmt/.editorconfig | 26 + .../github.com/go-openapi/strfmt/.gitignore | 2 + .../go-openapi/strfmt/.golangci.yml | 19 + .../github.com/go-openapi/strfmt/.travis.yml | 20 + .../go-openapi/strfmt/CODE_OF_CONDUCT.md | 74 + .../github.com/go-openapi/strfmt/LICENSE | 202 + .../github.com/go-openapi/strfmt/README.md | 71 + .../github.com/go-openapi/strfmt/bson.go | 127 + .../github.com/go-openapi/strfmt/date.go | 150 + .../github.com/go-openapi/strfmt/default.go | 1853 + go/vendor/github.com/go-openapi/strfmt/doc.go | 18 + .../github.com/go-openapi/strfmt/duration.go | 203 + .../github.com/go-openapi/strfmt/format.go | 307 + go/vendor/github.com/go-openapi/strfmt/go.mod | 13 + go/vendor/github.com/go-openapi/strfmt/go.sum | 19 + .../github.com/go-openapi/strfmt/time.go | 195 + .../github.com/go-openapi/swag/.editorconfig | 26 + .../github.com/go-openapi/swag/.gitignore | 3 + .../github.com/go-openapi/swag/.golangci.yml | 20 + .../github.com/go-openapi/swag/.travis.yml | 16 + .../go-openapi/swag/CODE_OF_CONDUCT.md | 74 + go/vendor/github.com/go-openapi/swag/LICENSE | 202 + .../github.com/go-openapi/swag/README.md | 23 + .../github.com/go-openapi/swag/convert.go | 207 + .../go-openapi/swag/convert_types.go | 595 + go/vendor/github.com/go-openapi/swag/doc.go | 33 + go/vendor/github.com/go-openapi/swag/go.mod | 9 + go/vendor/github.com/go-openapi/swag/go.sum | 9 + go/vendor/github.com/go-openapi/swag/json.go | 311 + .../github.com/go-openapi/swag/loading.go | 80 + go/vendor/github.com/go-openapi/swag/net.go | 24 + go/vendor/github.com/go-openapi/swag/path.go | 59 + .../github.com/go-openapi/swag/post_go18.go | 9 + .../github.com/go-openapi/swag/post_go19.go | 53 + .../github.com/go-openapi/swag/pre_go18.go | 9 + .../github.com/go-openapi/swag/pre_go19.go | 55 + go/vendor/github.com/go-openapi/swag/util.go | 405 + go/vendor/github.com/go-openapi/swag/yaml.go | 228 + .../go-openapi/validate/.editorconfig | 26 + .../github.com/go-openapi/validate/.gitignore | 5 + .../go-openapi/validate/.golangci.yml | 20 + .../go-openapi/validate/.travis.yml | 35 + .../go-openapi/validate/CODE_OF_CONDUCT.md | 74 + .../github.com/go-openapi/validate/LICENSE | 202 + .../github.com/go-openapi/validate/README.md | 6 + .../github.com/go-openapi/validate/debug.go | 47 + .../go-openapi/validate/default_validator.go | 278 + .../github.com/go-openapi/validate/doc.go | 85 + .../go-openapi/validate/example_validator.go | 299 + .../github.com/go-openapi/validate/formats.go | 73 + .../github.com/go-openapi/validate/go.mod | 14 + .../github.com/go-openapi/validate/go.sum | 41 + .../github.com/go-openapi/validate/helpers.go | 265 + .../go-openapi/validate/object_validator.go | 264 + .../github.com/go-openapi/validate/options.go | 43 + .../github.com/go-openapi/validate/result.go | 484 + .../github.com/go-openapi/validate/rexp.go | 71 + .../github.com/go-openapi/validate/schema.go | 248 + .../go-openapi/validate/schema_messages.go | 78 + .../go-openapi/validate/schema_props.go | 231 + .../go-openapi/validate/slice_validator.go | 104 + .../github.com/go-openapi/validate/spec.go | 777 + .../go-openapi/validate/spec_messages.go | 354 + .../github.com/go-openapi/validate/type.go | 177 + .../go-openapi/validate/update-fixtures.sh | 15 + .../go-openapi/validate/validator.go | 638 + .../github.com/go-openapi/validate/values.go | 398 + .../gobuffalo/packr/.codeclimate.yml | 20 + .../github.com/gobuffalo/packr/.gitignore | 33 + .../gobuffalo/packr/.goreleaser.yml | 25 + .../github.com/gobuffalo/packr/.travis.yml | 16 + .../github.com/gobuffalo/packr/LICENSE.txt | 8 + go/vendor/github.com/gobuffalo/packr/Makefile | 36 + .../github.com/gobuffalo/packr/README.md | 196 + go/vendor/github.com/gobuffalo/packr/box.go | 204 + go/vendor/github.com/gobuffalo/packr/env.go | 39 + go/vendor/github.com/gobuffalo/packr/file.go | 15 + .../github.com/gobuffalo/packr/file_info.go | 38 + go/vendor/github.com/gobuffalo/packr/go.mod | 13 + go/vendor/github.com/gobuffalo/packr/go.sum | 18 + go/vendor/github.com/gobuffalo/packr/packr.go | 74 + .../gobuffalo/packr/physical_file.go | 13 + .../github.com/gobuffalo/packr/shoulders.md | 24 + .../github.com/gobuffalo/packr/version.go | 3 + .../gobuffalo/packr/virtual_file.go | 57 + go/vendor/github.com/gobuffalo/packr/walk.go | 63 + go/vendor/github.com/golang/glog/LICENSE | 191 + go/vendor/github.com/golang/glog/README | 44 + go/vendor/github.com/golang/glog/glog.go | 1180 + go/vendor/github.com/golang/glog/glog_file.go | 124 + go/vendor/github.com/golang/protobuf/AUTHORS | 3 + .../github.com/golang/protobuf/CONTRIBUTORS | 3 + go/vendor/github.com/golang/protobuf/LICENSE | 28 + .../github.com/golang/protobuf/proto/clone.go | 253 + .../golang/protobuf/proto/decode.go | 428 + .../golang/protobuf/proto/discard.go | 350 + .../golang/protobuf/proto/encode.go | 203 + .../github.com/golang/protobuf/proto/equal.go | 300 + .../golang/protobuf/proto/extensions.go | 543 + .../github.com/golang/protobuf/proto/lib.go | 979 + .../golang/protobuf/proto/message_set.go | 314 + .../golang/protobuf/proto/pointer_reflect.go | 357 + .../golang/protobuf/proto/pointer_unsafe.go | 308 + .../golang/protobuf/proto/properties.go | 544 + .../golang/protobuf/proto/table_marshal.go | 2767 + .../golang/protobuf/proto/table_merge.go | 654 + .../golang/protobuf/proto/table_unmarshal.go | 2051 + .../github.com/golang/protobuf/proto/text.go | 843 + .../golang/protobuf/proto/text_parser.go | 880 + .../protoc-gen-go/descriptor/descriptor.pb.go | 2812 + .../protoc-gen-go/descriptor/descriptor.proto | 872 + .../github.com/golang/protobuf/ptypes/any.go | 141 + .../golang/protobuf/ptypes/any/any.pb.go | 191 + .../golang/protobuf/ptypes/any/any.proto | 149 + .../github.com/golang/protobuf/ptypes/doc.go | 35 + .../golang/protobuf/ptypes/duration.go | 102 + .../protobuf/ptypes/duration/duration.pb.go | 159 + .../protobuf/ptypes/duration/duration.proto | 117 + .../golang/protobuf/ptypes/timestamp.go | 134 + .../protobuf/ptypes/timestamp/timestamp.pb.go | 175 + .../protobuf/ptypes/timestamp/timestamp.proto | 133 + go/vendor/github.com/mailru/easyjson/LICENSE | 7 + .../github.com/mailru/easyjson/buffer/pool.go | 270 + .../mailru/easyjson/jlexer/bytestostr.go | 24 + .../easyjson/jlexer/bytestostr_nounsafe.go | 13 + .../mailru/easyjson/jlexer/error.go | 15 + .../mailru/easyjson/jlexer/lexer.go | 1181 + .../mailru/easyjson/jwriter/writer.go | 390 + .../mitchellh/mapstructure/.travis.yml | 8 + .../mitchellh/mapstructure/CHANGELOG.md | 21 + .../github.com/mitchellh/mapstructure/LICENSE | 21 + .../mitchellh/mapstructure/README.md | 46 + .../mitchellh/mapstructure/decode_hooks.go | 217 + .../mitchellh/mapstructure/error.go | 50 + .../github.com/mitchellh/mapstructure/go.mod | 1 + .../mitchellh/mapstructure/mapstructure.go | 1149 + go/vendor/github.com/pkg/errors/.gitignore | 24 + go/vendor/github.com/pkg/errors/.travis.yml | 11 + go/vendor/github.com/pkg/errors/LICENSE | 23 + go/vendor/github.com/pkg/errors/README.md | 52 + go/vendor/github.com/pkg/errors/appveyor.yml | 32 + go/vendor/github.com/pkg/errors/errors.go | 269 + go/vendor/github.com/pkg/errors/stack.go | 178 + go/vendor/github.com/q3k/statusz/Gopkg.lock | 39 + go/vendor/github.com/q3k/statusz/Gopkg.toml | 30 + go/vendor/github.com/q3k/statusz/LICENSE | 201 + go/vendor/github.com/q3k/statusz/README.md | 40 + go/vendor/github.com/q3k/statusz/statusz.go | 231 + go/vendor/github.com/shirou/gopsutil/LICENSE | 61 + .../shirou/gopsutil/internal/common/binary.go | 634 + .../shirou/gopsutil/internal/common/common.go | 392 + .../gopsutil/internal/common/common_darwin.go | 69 + .../internal/common/common_freebsd.go | 69 + .../gopsutil/internal/common/common_linux.go | 41 + .../internal/common/common_openbsd.go | 69 + .../gopsutil/internal/common/common_unix.go | 67 + .../internal/common/common_windows.go | 135 + .../github.com/shirou/gopsutil/load/load.go | 31 + .../shirou/gopsutil/load/load_bsd.go | 68 + .../shirou/gopsutil/load/load_darwin.go | 76 + .../shirou/gopsutil/load/load_fallback.go | 25 + .../shirou/gopsutil/load/load_linux.go | 87 + .../shirou/gopsutil/load/load_windows.go | 29 + go/vendor/github.com/ybbus/jsonrpc/.gitignore | 2 + go/vendor/github.com/ybbus/jsonrpc/LICENSE | 21 + go/vendor/github.com/ybbus/jsonrpc/README.md | 472 + go/vendor/github.com/ybbus/jsonrpc/jsonrpc.go | 620 + go/vendor/github.com/ziutek/telnet/LICENSE | 24 + go/vendor/github.com/ziutek/telnet/README.md | 1 + go/vendor/github.com/ziutek/telnet/conn.go | 445 + go/vendor/golang.org/x/net/AUTHORS | 3 + go/vendor/golang.org/x/net/CONTRIBUTORS | 3 + go/vendor/golang.org/x/net/LICENSE | 27 + go/vendor/golang.org/x/net/PATENTS | 22 + go/vendor/golang.org/x/net/context/context.go | 56 + go/vendor/golang.org/x/net/context/go17.go | 72 + go/vendor/golang.org/x/net/context/go19.go | 20 + .../golang.org/x/net/context/pre_go17.go | 300 + .../golang.org/x/net/context/pre_go19.go | 109 + .../golang.org/x/net/http/httpguts/guts.go | 50 + .../golang.org/x/net/http/httpguts/httplex.go | 346 + go/vendor/golang.org/x/net/http2/.gitignore | 2 + go/vendor/golang.org/x/net/http2/Dockerfile | 51 + go/vendor/golang.org/x/net/http2/Makefile | 3 + go/vendor/golang.org/x/net/http2/README | 20 + go/vendor/golang.org/x/net/http2/ciphers.go | 641 + .../x/net/http2/client_conn_pool.go | 282 + .../x/net/http2/configure_transport.go | 82 + .../golang.org/x/net/http2/databuffer.go | 146 + go/vendor/golang.org/x/net/http2/errors.go | 133 + go/vendor/golang.org/x/net/http2/flow.go | 50 + go/vendor/golang.org/x/net/http2/frame.go | 1614 + go/vendor/golang.org/x/net/http2/go111.go | 26 + go/vendor/golang.org/x/net/http2/go16.go | 16 + go/vendor/golang.org/x/net/http2/go17.go | 121 + .../golang.org/x/net/http2/go17_not18.go | 36 + go/vendor/golang.org/x/net/http2/go18.go | 56 + go/vendor/golang.org/x/net/http2/go19.go | 16 + go/vendor/golang.org/x/net/http2/gotrack.go | 170 + go/vendor/golang.org/x/net/http2/headermap.go | 88 + .../golang.org/x/net/http2/hpack/encode.go | 240 + .../golang.org/x/net/http2/hpack/hpack.go | 496 + .../golang.org/x/net/http2/hpack/huffman.go | 222 + .../golang.org/x/net/http2/hpack/tables.go | 479 + go/vendor/golang.org/x/net/http2/http2.go | 384 + go/vendor/golang.org/x/net/http2/not_go111.go | 17 + go/vendor/golang.org/x/net/http2/not_go16.go | 21 + go/vendor/golang.org/x/net/http2/not_go17.go | 95 + go/vendor/golang.org/x/net/http2/not_go18.go | 29 + go/vendor/golang.org/x/net/http2/not_go19.go | 16 + go/vendor/golang.org/x/net/http2/pipe.go | 163 + go/vendor/golang.org/x/net/http2/server.go | 2890 + go/vendor/golang.org/x/net/http2/transport.go | 2453 + go/vendor/golang.org/x/net/http2/write.go | 365 + .../golang.org/x/net/http2/writesched.go | 242 + .../x/net/http2/writesched_priority.go | 452 + .../x/net/http2/writesched_random.go | 72 + go/vendor/golang.org/x/net/idna/idna.go | 732 + go/vendor/golang.org/x/net/idna/punycode.go | 203 + go/vendor/golang.org/x/net/idna/tables.go | 4557 + go/vendor/golang.org/x/net/idna/trie.go | 72 + go/vendor/golang.org/x/net/idna/trieval.go | 119 + .../x/net/internal/timeseries/timeseries.go | 525 + go/vendor/golang.org/x/net/trace/events.go | 532 + go/vendor/golang.org/x/net/trace/histogram.go | 365 + go/vendor/golang.org/x/net/trace/trace.go | 1111 + .../golang.org/x/net/trace/trace_go16.go | 21 + .../golang.org/x/net/trace/trace_go17.go | 21 + go/vendor/golang.org/x/sys/AUTHORS | 3 + go/vendor/golang.org/x/sys/CONTRIBUTORS | 3 + go/vendor/golang.org/x/sys/LICENSE | 27 + go/vendor/golang.org/x/sys/PATENTS | 22 + go/vendor/golang.org/x/sys/unix/.gitignore | 2 + go/vendor/golang.org/x/sys/unix/README.md | 173 + .../golang.org/x/sys/unix/affinity_linux.go | 124 + go/vendor/golang.org/x/sys/unix/aliases.go | 14 + .../golang.org/x/sys/unix/asm_aix_ppc64.s | 17 + .../golang.org/x/sys/unix/asm_darwin_386.s | 29 + .../golang.org/x/sys/unix/asm_darwin_amd64.s | 29 + .../golang.org/x/sys/unix/asm_darwin_arm.s | 30 + .../golang.org/x/sys/unix/asm_darwin_arm64.s | 30 + .../x/sys/unix/asm_dragonfly_amd64.s | 29 + .../golang.org/x/sys/unix/asm_freebsd_386.s | 29 + .../golang.org/x/sys/unix/asm_freebsd_amd64.s | 29 + .../golang.org/x/sys/unix/asm_freebsd_arm.s | 29 + .../golang.org/x/sys/unix/asm_linux_386.s | 65 + .../golang.org/x/sys/unix/asm_linux_amd64.s | 57 + .../golang.org/x/sys/unix/asm_linux_arm.s | 56 + .../golang.org/x/sys/unix/asm_linux_arm64.s | 52 + .../golang.org/x/sys/unix/asm_linux_mips64x.s | 56 + .../golang.org/x/sys/unix/asm_linux_mipsx.s | 54 + .../golang.org/x/sys/unix/asm_linux_ppc64x.s | 56 + .../golang.org/x/sys/unix/asm_linux_s390x.s | 56 + .../golang.org/x/sys/unix/asm_netbsd_386.s | 29 + .../golang.org/x/sys/unix/asm_netbsd_amd64.s | 29 + .../golang.org/x/sys/unix/asm_netbsd_arm.s | 29 + .../golang.org/x/sys/unix/asm_openbsd_386.s | 29 + .../golang.org/x/sys/unix/asm_openbsd_amd64.s | 29 + .../golang.org/x/sys/unix/asm_openbsd_arm.s | 29 + .../golang.org/x/sys/unix/asm_solaris_amd64.s | 17 + .../golang.org/x/sys/unix/bluetooth_linux.go | 35 + .../golang.org/x/sys/unix/cap_freebsd.go | 195 + go/vendor/golang.org/x/sys/unix/constants.go | 13 + .../golang.org/x/sys/unix/dev_aix_ppc.go | 27 + .../golang.org/x/sys/unix/dev_aix_ppc64.go | 29 + go/vendor/golang.org/x/sys/unix/dev_darwin.go | 24 + .../golang.org/x/sys/unix/dev_dragonfly.go | 30 + .../golang.org/x/sys/unix/dev_freebsd.go | 30 + go/vendor/golang.org/x/sys/unix/dev_linux.go | 42 + go/vendor/golang.org/x/sys/unix/dev_netbsd.go | 29 + .../golang.org/x/sys/unix/dev_openbsd.go | 29 + go/vendor/golang.org/x/sys/unix/dirent.go | 17 + go/vendor/golang.org/x/sys/unix/endian_big.go | 9 + .../golang.org/x/sys/unix/endian_little.go | 9 + go/vendor/golang.org/x/sys/unix/env_unix.go | 31 + .../x/sys/unix/errors_freebsd_386.go | 227 + .../x/sys/unix/errors_freebsd_amd64.go | 227 + .../x/sys/unix/errors_freebsd_arm.go | 226 + go/vendor/golang.org/x/sys/unix/fcntl.go | 32 + .../x/sys/unix/fcntl_linux_32bit.go | 13 + go/vendor/golang.org/x/sys/unix/gccgo.go | 62 + go/vendor/golang.org/x/sys/unix/gccgo_c.c | 39 + .../x/sys/unix/gccgo_linux_amd64.go | 20 + go/vendor/golang.org/x/sys/unix/ioctl.go | 30 + go/vendor/golang.org/x/sys/unix/mkall.sh | 204 + go/vendor/golang.org/x/sys/unix/mkerrors.sh | 654 + go/vendor/golang.org/x/sys/unix/mkpost.go | 98 + go/vendor/golang.org/x/sys/unix/mksyscall.pl | 341 + .../x/sys/unix/mksyscall_aix_ppc.pl | 384 + .../x/sys/unix/mksyscall_aix_ppc64.pl | 579 + .../x/sys/unix/mksyscall_solaris.pl | 294 + .../golang.org/x/sys/unix/mksysctl_openbsd.pl | 265 + .../golang.org/x/sys/unix/mksysnum_darwin.pl | 39 + .../x/sys/unix/mksysnum_dragonfly.pl | 50 + .../golang.org/x/sys/unix/mksysnum_freebsd.pl | 50 + .../golang.org/x/sys/unix/mksysnum_netbsd.pl | 58 + .../golang.org/x/sys/unix/mksysnum_openbsd.pl | 50 + .../golang.org/x/sys/unix/openbsd_pledge.go | 91 + .../golang.org/x/sys/unix/openbsd_unveil.go | 44 + .../golang.org/x/sys/unix/pagesize_unix.go | 15 + go/vendor/golang.org/x/sys/unix/race.go | 30 + go/vendor/golang.org/x/sys/unix/race0.go | 25 + .../golang.org/x/sys/unix/sockcmsg_linux.go | 36 + .../golang.org/x/sys/unix/sockcmsg_unix.go | 104 + go/vendor/golang.org/x/sys/unix/str.go | 26 + go/vendor/golang.org/x/sys/unix/syscall.go | 54 + .../golang.org/x/sys/unix/syscall_aix.go | 547 + .../golang.org/x/sys/unix/syscall_aix_ppc.go | 34 + .../x/sys/unix/syscall_aix_ppc64.go | 34 + .../golang.org/x/sys/unix/syscall_bsd.go | 624 + .../golang.org/x/sys/unix/syscall_darwin.go | 700 + .../x/sys/unix/syscall_darwin_386.go | 68 + .../x/sys/unix/syscall_darwin_amd64.go | 68 + .../x/sys/unix/syscall_darwin_arm.go | 66 + .../x/sys/unix/syscall_darwin_arm64.go | 68 + .../x/sys/unix/syscall_dragonfly.go | 523 + .../x/sys/unix/syscall_dragonfly_amd64.go | 52 + .../golang.org/x/sys/unix/syscall_freebsd.go | 817 + .../x/sys/unix/syscall_freebsd_386.go | 52 + .../x/sys/unix/syscall_freebsd_amd64.go | 52 + .../x/sys/unix/syscall_freebsd_arm.go | 52 + .../golang.org/x/sys/unix/syscall_linux.go | 1628 + .../x/sys/unix/syscall_linux_386.go | 385 + .../x/sys/unix/syscall_linux_amd64.go | 175 + .../x/sys/unix/syscall_linux_amd64_gc.go | 13 + .../x/sys/unix/syscall_linux_arm.go | 259 + .../x/sys/unix/syscall_linux_arm64.go | 209 + .../golang.org/x/sys/unix/syscall_linux_gc.go | 14 + .../x/sys/unix/syscall_linux_gc_386.go | 16 + .../x/sys/unix/syscall_linux_gccgo_386.go | 30 + .../x/sys/unix/syscall_linux_gccgo_arm.go | 20 + .../x/sys/unix/syscall_linux_mips64x.go | 214 + .../x/sys/unix/syscall_linux_mipsx.go | 233 + .../x/sys/unix/syscall_linux_ppc64x.go | 151 + .../x/sys/unix/syscall_linux_riscv64.go | 209 + .../x/sys/unix/syscall_linux_s390x.go | 337 + .../x/sys/unix/syscall_linux_sparc64.go | 146 + .../golang.org/x/sys/unix/syscall_netbsd.go | 597 + .../x/sys/unix/syscall_netbsd_386.go | 33 + .../x/sys/unix/syscall_netbsd_amd64.go | 33 + .../x/sys/unix/syscall_netbsd_arm.go | 33 + .../golang.org/x/sys/unix/syscall_openbsd.go | 394 + .../x/sys/unix/syscall_openbsd_386.go | 37 + .../x/sys/unix/syscall_openbsd_amd64.go | 37 + .../x/sys/unix/syscall_openbsd_arm.go | 37 + .../golang.org/x/sys/unix/syscall_solaris.go | 730 + .../x/sys/unix/syscall_solaris_amd64.go | 23 + .../golang.org/x/sys/unix/syscall_unix.go | 394 + .../golang.org/x/sys/unix/syscall_unix_gc.go | 15 + go/vendor/golang.org/x/sys/unix/timestruct.go | 82 + go/vendor/golang.org/x/sys/unix/types_aix.go | 236 + .../golang.org/x/sys/unix/types_darwin.go | 277 + .../golang.org/x/sys/unix/types_dragonfly.go | 263 + .../golang.org/x/sys/unix/types_freebsd.go | 356 + .../golang.org/x/sys/unix/types_netbsd.go | 287 + .../golang.org/x/sys/unix/types_openbsd.go | 276 + .../golang.org/x/sys/unix/types_solaris.go | 266 + go/vendor/golang.org/x/sys/unix/xattr_bsd.go | 231 + .../golang.org/x/sys/unix/zerrors_aix_ppc.go | 1372 + .../x/sys/unix/zerrors_aix_ppc64.go | 1373 + .../x/sys/unix/zerrors_darwin_386.go | 1783 + .../x/sys/unix/zerrors_darwin_amd64.go | 1783 + .../x/sys/unix/zerrors_darwin_arm.go | 1783 + .../x/sys/unix/zerrors_darwin_arm64.go | 1783 + .../x/sys/unix/zerrors_dragonfly_amd64.go | 1650 + .../x/sys/unix/zerrors_freebsd_386.go | 1793 + .../x/sys/unix/zerrors_freebsd_amd64.go | 1794 + .../x/sys/unix/zerrors_freebsd_arm.go | 1802 + .../x/sys/unix/zerrors_linux_386.go | 2702 + .../x/sys/unix/zerrors_linux_amd64.go | 2702 + .../x/sys/unix/zerrors_linux_arm.go | 2708 + .../x/sys/unix/zerrors_linux_arm64.go | 2693 + .../x/sys/unix/zerrors_linux_mips.go | 2709 + .../x/sys/unix/zerrors_linux_mips64.go | 2709 + .../x/sys/unix/zerrors_linux_mips64le.go | 2709 + .../x/sys/unix/zerrors_linux_mipsle.go | 2709 + .../x/sys/unix/zerrors_linux_ppc64.go | 2762 + .../x/sys/unix/zerrors_linux_ppc64le.go | 2762 + .../x/sys/unix/zerrors_linux_riscv64.go | 2689 + .../x/sys/unix/zerrors_linux_s390x.go | 2762 + .../x/sys/unix/zerrors_linux_sparc64.go | 2150 + .../x/sys/unix/zerrors_netbsd_386.go | 1772 + .../x/sys/unix/zerrors_netbsd_amd64.go | 1762 + .../x/sys/unix/zerrors_netbsd_arm.go | 1751 + .../x/sys/unix/zerrors_openbsd_386.go | 1654 + .../x/sys/unix/zerrors_openbsd_amd64.go | 1765 + .../x/sys/unix/zerrors_openbsd_arm.go | 1656 + .../x/sys/unix/zerrors_solaris_amd64.go | 1532 + .../golang.org/x/sys/unix/zptrace386_linux.go | 80 + .../golang.org/x/sys/unix/zptracearm_linux.go | 41 + .../x/sys/unix/zptracemips_linux.go | 50 + .../x/sys/unix/zptracemipsle_linux.go | 50 + .../golang.org/x/sys/unix/zsyscall_aix_ppc.go | 1450 + .../x/sys/unix/zsyscall_aix_ppc64.go | 1408 + .../x/sys/unix/zsyscall_aix_ppc64_gc.go | 1162 + .../x/sys/unix/zsyscall_aix_ppc64_gccgo.go | 1042 + .../x/sys/unix/zsyscall_darwin_386.go | 1769 + .../x/sys/unix/zsyscall_darwin_amd64.go | 1769 + .../x/sys/unix/zsyscall_darwin_arm.go | 1769 + .../x/sys/unix/zsyscall_darwin_arm64.go | 1769 + .../x/sys/unix/zsyscall_dragonfly_amd64.go | 1508 + .../x/sys/unix/zsyscall_freebsd_386.go | 2015 + .../x/sys/unix/zsyscall_freebsd_amd64.go | 2015 + .../x/sys/unix/zsyscall_freebsd_arm.go | 2015 + .../x/sys/unix/zsyscall_linux_386.go | 2131 + .../x/sys/unix/zsyscall_linux_amd64.go | 2313 + .../x/sys/unix/zsyscall_linux_arm.go | 2233 + .../x/sys/unix/zsyscall_linux_arm64.go | 2140 + .../x/sys/unix/zsyscall_linux_mips.go | 2311 + .../x/sys/unix/zsyscall_linux_mips64.go | 2282 + .../x/sys/unix/zsyscall_linux_mips64le.go | 2282 + .../x/sys/unix/zsyscall_linux_mipsle.go | 2311 + .../x/sys/unix/zsyscall_linux_ppc64.go | 2360 + .../x/sys/unix/zsyscall_linux_ppc64le.go | 2360 + .../x/sys/unix/zsyscall_linux_riscv64.go | 2140 + .../x/sys/unix/zsyscall_linux_s390x.go | 2130 + .../x/sys/unix/zsyscall_linux_sparc64.go | 2172 + .../x/sys/unix/zsyscall_netbsd_386.go | 1653 + .../x/sys/unix/zsyscall_netbsd_amd64.go | 1653 + .../x/sys/unix/zsyscall_netbsd_arm.go | 1653 + .../x/sys/unix/zsyscall_openbsd_386.go | 1535 + .../x/sys/unix/zsyscall_openbsd_amd64.go | 1535 + .../x/sys/unix/zsyscall_openbsd_arm.go | 1535 + .../x/sys/unix/zsyscall_solaris_amd64.go | 1953 + .../x/sys/unix/zsysctl_openbsd_386.go | 270 + .../x/sys/unix/zsysctl_openbsd_amd64.go | 270 + .../x/sys/unix/zsysctl_openbsd_arm.go | 270 + .../x/sys/unix/zsysnum_darwin_386.go | 436 + .../x/sys/unix/zsysnum_darwin_amd64.go | 436 + .../x/sys/unix/zsysnum_darwin_arm.go | 436 + .../x/sys/unix/zsysnum_darwin_arm64.go | 436 + .../x/sys/unix/zsysnum_dragonfly_amd64.go | 315 + .../x/sys/unix/zsysnum_freebsd_386.go | 403 + .../x/sys/unix/zsysnum_freebsd_amd64.go | 403 + .../x/sys/unix/zsysnum_freebsd_arm.go | 403 + .../x/sys/unix/zsysnum_linux_386.go | 392 + .../x/sys/unix/zsysnum_linux_amd64.go | 344 + .../x/sys/unix/zsysnum_linux_arm.go | 364 + .../x/sys/unix/zsysnum_linux_arm64.go | 288 + .../x/sys/unix/zsysnum_linux_mips.go | 377 + .../x/sys/unix/zsysnum_linux_mips64.go | 337 + .../x/sys/unix/zsysnum_linux_mips64le.go | 337 + .../x/sys/unix/zsysnum_linux_mipsle.go | 377 + .../x/sys/unix/zsysnum_linux_ppc64.go | 375 + .../x/sys/unix/zsysnum_linux_ppc64le.go | 375 + .../x/sys/unix/zsysnum_linux_riscv64.go | 287 + .../x/sys/unix/zsysnum_linux_s390x.go | 337 + .../x/sys/unix/zsysnum_linux_sparc64.go | 348 + .../x/sys/unix/zsysnum_netbsd_386.go | 274 + .../x/sys/unix/zsysnum_netbsd_amd64.go | 274 + .../x/sys/unix/zsysnum_netbsd_arm.go | 274 + .../x/sys/unix/zsysnum_openbsd_386.go | 218 + .../x/sys/unix/zsysnum_openbsd_amd64.go | 218 + .../x/sys/unix/zsysnum_openbsd_arm.go | 218 + .../golang.org/x/sys/unix/ztypes_aix_ppc.go | 345 + .../golang.org/x/sys/unix/ztypes_aix_ppc64.go | 354 + .../x/sys/unix/ztypes_darwin_386.go | 489 + .../x/sys/unix/ztypes_darwin_amd64.go | 499 + .../x/sys/unix/ztypes_darwin_arm.go | 490 + .../x/sys/unix/ztypes_darwin_arm64.go | 499 + .../x/sys/unix/ztypes_dragonfly_amd64.go | 469 + .../x/sys/unix/ztypes_freebsd_386.go | 603 + .../x/sys/unix/ztypes_freebsd_amd64.go | 602 + .../x/sys/unix/ztypes_freebsd_arm.go | 602 + .../golang.org/x/sys/unix/ztypes_linux_386.go | 1988 + .../x/sys/unix/ztypes_linux_amd64.go | 2010 + .../golang.org/x/sys/unix/ztypes_linux_arm.go | 1978 + .../x/sys/unix/ztypes_linux_arm64.go | 1989 + .../x/sys/unix/ztypes_linux_mips.go | 1983 + .../x/sys/unix/ztypes_linux_mips64.go | 1991 + .../x/sys/unix/ztypes_linux_mips64le.go | 1991 + .../x/sys/unix/ztypes_linux_mipsle.go | 1983 + .../x/sys/unix/ztypes_linux_ppc64.go | 1999 + .../x/sys/unix/ztypes_linux_ppc64le.go | 1999 + .../x/sys/unix/ztypes_linux_riscv64.go | 2016 + .../x/sys/unix/ztypes_linux_s390x.go | 2016 + .../x/sys/unix/ztypes_linux_sparc64.go | 690 + .../x/sys/unix/ztypes_netbsd_386.go | 458 + .../x/sys/unix/ztypes_netbsd_amd64.go | 465 + .../x/sys/unix/ztypes_netbsd_arm.go | 463 + .../x/sys/unix/ztypes_openbsd_386.go | 560 + .../x/sys/unix/ztypes_openbsd_amd64.go | 560 + .../x/sys/unix/ztypes_openbsd_arm.go | 553 + .../x/sys/unix/ztypes_solaris_amd64.go | 442 + go/vendor/golang.org/x/sys/windows/aliases.go | 13 + .../x/sys/windows/asm_windows_386.s | 13 + .../x/sys/windows/asm_windows_amd64.s | 13 + .../x/sys/windows/asm_windows_arm.s | 11 + .../golang.org/x/sys/windows/dll_windows.go | 378 + .../golang.org/x/sys/windows/env_windows.go | 29 + .../golang.org/x/sys/windows/eventlog.go | 20 + .../golang.org/x/sys/windows/exec_windows.go | 97 + .../x/sys/windows/memory_windows.go | 26 + .../golang.org/x/sys/windows/mksyscall.go | 7 + go/vendor/golang.org/x/sys/windows/race.go | 30 + go/vendor/golang.org/x/sys/windows/race0.go | 25 + .../x/sys/windows/security_windows.go | 478 + go/vendor/golang.org/x/sys/windows/service.go | 183 + go/vendor/golang.org/x/sys/windows/str.go | 22 + go/vendor/golang.org/x/sys/windows/syscall.go | 74 + .../x/sys/windows/syscall_windows.go | 1205 + .../golang.org/x/sys/windows/types_windows.go | 1469 + .../x/sys/windows/types_windows_386.go | 22 + .../x/sys/windows/types_windows_amd64.go | 22 + .../x/sys/windows/types_windows_arm.go | 22 + .../x/sys/windows/zsyscall_windows.go | 2700 + go/vendor/golang.org/x/text/AUTHORS | 3 + go/vendor/golang.org/x/text/CONTRIBUTORS | 3 + go/vendor/golang.org/x/text/LICENSE | 27 + go/vendor/golang.org/x/text/PATENTS | 22 + .../x/text/collate/build/builder.go | 702 + .../x/text/collate/build/colelem.go | 294 + .../x/text/collate/build/contract.go | 309 + .../golang.org/x/text/collate/build/order.go | 393 + .../golang.org/x/text/collate/build/table.go | 81 + .../golang.org/x/text/collate/build/trie.go | 290 + .../golang.org/x/text/collate/collate.go | 403 + go/vendor/golang.org/x/text/collate/index.go | 32 + .../golang.org/x/text/collate/maketables.go | 553 + go/vendor/golang.org/x/text/collate/option.go | 239 + go/vendor/golang.org/x/text/collate/sort.go | 81 + go/vendor/golang.org/x/text/collate/tables.go | 73789 ++++++++++++++++ .../x/text/internal/colltab/collelem.go | 371 + .../x/text/internal/colltab/colltab.go | 105 + .../x/text/internal/colltab/contract.go | 145 + .../x/text/internal/colltab/iter.go | 178 + .../x/text/internal/colltab/numeric.go | 236 + .../x/text/internal/colltab/table.go | 275 + .../x/text/internal/colltab/trie.go | 159 + .../x/text/internal/colltab/weighter.go | 31 + .../golang.org/x/text/internal/gen/code.go | 369 + .../golang.org/x/text/internal/gen/gen.go | 333 + .../golang.org/x/text/internal/tag/tag.go | 100 + .../x/text/internal/triegen/compact.go | 58 + .../x/text/internal/triegen/print.go | 251 + .../x/text/internal/triegen/triegen.go | 494 + .../golang.org/x/text/internal/ucd/ucd.go | 371 + go/vendor/golang.org/x/text/language/Makefile | 16 + .../golang.org/x/text/language/common.go | 16 + .../golang.org/x/text/language/coverage.go | 197 + go/vendor/golang.org/x/text/language/doc.go | 102 + go/vendor/golang.org/x/text/language/gen.go | 1712 + .../golang.org/x/text/language/gen_common.go | 20 + .../golang.org/x/text/language/gen_index.go | 162 + go/vendor/golang.org/x/text/language/go1_1.go | 38 + go/vendor/golang.org/x/text/language/go1_2.go | 11 + go/vendor/golang.org/x/text/language/index.go | 783 + .../golang.org/x/text/language/language.go | 907 + .../golang.org/x/text/language/lookup.go | 396 + go/vendor/golang.org/x/text/language/match.go | 933 + go/vendor/golang.org/x/text/language/parse.go | 859 + .../golang.org/x/text/language/tables.go | 3686 + go/vendor/golang.org/x/text/language/tags.go | 143 + .../x/text/secure/bidirule/bidirule.go | 336 + .../x/text/secure/bidirule/bidirule10.0.0.go | 11 + .../x/text/secure/bidirule/bidirule9.0.0.go | 14 + .../golang.org/x/text/transform/transform.go | 705 + .../golang.org/x/text/unicode/bidi/bidi.go | 198 + .../golang.org/x/text/unicode/bidi/bracket.go | 335 + .../golang.org/x/text/unicode/bidi/core.go | 1058 + .../golang.org/x/text/unicode/bidi/gen.go | 133 + .../x/text/unicode/bidi/gen_ranges.go | 57 + .../x/text/unicode/bidi/gen_trieval.go | 64 + .../golang.org/x/text/unicode/bidi/prop.go | 206 + .../x/text/unicode/bidi/tables10.0.0.go | 1815 + .../x/text/unicode/bidi/tables9.0.0.go | 1781 + .../golang.org/x/text/unicode/bidi/trieval.go | 60 + .../golang.org/x/text/unicode/cldr/base.go | 105 + .../golang.org/x/text/unicode/cldr/cldr.go | 130 + .../golang.org/x/text/unicode/cldr/collate.go | 359 + .../golang.org/x/text/unicode/cldr/decode.go | 171 + .../golang.org/x/text/unicode/cldr/makexml.go | 400 + .../golang.org/x/text/unicode/cldr/resolve.go | 602 + .../golang.org/x/text/unicode/cldr/slice.go | 144 + .../golang.org/x/text/unicode/cldr/xml.go | 1494 + .../x/text/unicode/norm/composition.go | 508 + .../x/text/unicode/norm/forminfo.go | 259 + .../golang.org/x/text/unicode/norm/input.go | 109 + .../golang.org/x/text/unicode/norm/iter.go | 457 + .../x/text/unicode/norm/maketables.go | 976 + .../x/text/unicode/norm/normalize.go | 609 + .../x/text/unicode/norm/readwriter.go | 125 + .../x/text/unicode/norm/tables10.0.0.go | 7653 ++ .../x/text/unicode/norm/tables9.0.0.go | 7633 ++ .../x/text/unicode/norm/transform.go | 88 + .../golang.org/x/text/unicode/norm/trie.go | 54 + .../golang.org/x/text/unicode/norm/triegen.go | 117 + .../x/text/unicode/rangetable/gen.go | 115 + .../x/text/unicode/rangetable/merge.go | 260 + .../x/text/unicode/rangetable/rangetable.go | 70 + .../x/text/unicode/rangetable/tables10.0.0.go | 6378 ++ .../x/text/unicode/rangetable/tables9.0.0.go | 5737 ++ go/vendor/golang.org/x/text/width/gen.go | 115 + .../golang.org/x/text/width/gen_common.go | 96 + .../golang.org/x/text/width/gen_trieval.go | 34 + .../golang.org/x/text/width/kind_string.go | 16 + .../golang.org/x/text/width/tables10.0.0.go | 1318 + .../golang.org/x/text/width/tables9.0.0.go | 1286 + .../golang.org/x/text/width/transform.go | 239 + go/vendor/golang.org/x/text/width/trieval.go | 30 + go/vendor/golang.org/x/text/width/width.go | 206 + go/vendor/google.golang.org/genproto/LICENSE | 202 + .../googleapis/rpc/status/status.pb.go | 159 + go/vendor/google.golang.org/grpc/.travis.yml | 39 + go/vendor/google.golang.org/grpc/AUTHORS | 1 + .../google.golang.org/grpc/CONTRIBUTING.md | 36 + go/vendor/google.golang.org/grpc/LICENSE | 202 + go/vendor/google.golang.org/grpc/Makefile | 60 + go/vendor/google.golang.org/grpc/README.md | 67 + go/vendor/google.golang.org/grpc/backoff.go | 38 + go/vendor/google.golang.org/grpc/balancer.go | 391 + .../grpc/balancer/balancer.go | 287 + .../grpc/balancer/base/balancer.go | 208 + .../grpc/balancer/base/base.go | 52 + .../grpc/balancer/roundrobin/roundrobin.go | 79 + .../grpc/balancer_conn_wrappers.go | 301 + .../grpc/balancer_v1_wrapper.go | 328 + go/vendor/google.golang.org/grpc/call.go | 74 + .../google.golang.org/grpc/clientconn.go | 1398 + go/vendor/google.golang.org/grpc/codec.go | 50 + go/vendor/google.golang.org/grpc/codegen.sh | 17 + .../grpc/codes/code_string.go | 62 + .../google.golang.org/grpc/codes/codes.go | 197 + .../grpc/connectivity/connectivity.go | 72 + .../grpc/credentials/credentials.go | 312 + .../grpc/credentials/go16.go | 57 + .../grpc/credentials/go17.go | 59 + .../grpc/credentials/go18.go | 46 + .../grpc/credentials/go19.go | 35 + .../google.golang.org/grpc/dialoptions.go | 465 + go/vendor/google.golang.org/grpc/doc.go | 24 + .../grpc/encoding/encoding.go | 118 + .../grpc/encoding/proto/proto.go | 110 + go/vendor/google.golang.org/grpc/go.mod | 21 + go/vendor/google.golang.org/grpc/go.sum | 34 + go/vendor/google.golang.org/grpc/go16.go | 71 + go/vendor/google.golang.org/grpc/go17.go | 72 + .../google.golang.org/grpc/grpclog/grpclog.go | 126 + .../google.golang.org/grpc/grpclog/logger.go | 85 + .../grpc/grpclog/loggerv2.go | 195 + .../google.golang.org/grpc/install_gae.sh | 6 + .../google.golang.org/grpc/interceptor.go | 77 + .../grpc/internal/backoff/backoff.go | 78 + .../grpc/internal/channelz/funcs.go | 662 + .../grpc/internal/channelz/types.go | 702 + .../grpc/internal/channelz/types_linux.go | 53 + .../grpc/internal/channelz/types_nonlinux.go | 44 + .../grpc/internal/channelz/util_linux_go19.go | 39 + .../channelz/util_nonlinux_pre_go19.go | 26 + .../grpc/internal/envconfig/envconfig.go | 35 + .../grpc/internal/grpcrand/grpcrand.go | 56 + .../grpc/internal/internal.go | 43 + .../grpc/internal/transport/bdp_estimator.go | 140 + .../grpc/internal/transport/controlbuf.go | 852 + .../grpc/internal/transport/defaults.go | 49 + .../grpc/internal/transport/flowcontrol.go | 218 + .../grpc/internal/transport/go16.go | 52 + .../grpc/internal/transport/go17.go | 53 + .../grpc/internal/transport/handler_server.go | 449 + .../grpc/internal/transport/http2_client.go | 1368 + .../grpc/internal/transport/http2_server.go | 1180 + .../grpc/internal/transport/http_util.go | 623 + .../grpc/internal/transport/log.go | 44 + .../grpc/internal/transport/transport.go | 712 + .../grpc/keepalive/keepalive.go | 83 + .../grpc/metadata/metadata.go | 210 + .../grpc/naming/dns_resolver.go | 290 + .../google.golang.org/grpc/naming/go17.go | 34 + .../google.golang.org/grpc/naming/go18.go | 28 + .../google.golang.org/grpc/naming/naming.go | 69 + go/vendor/google.golang.org/grpc/peer/peer.go | 51 + .../google.golang.org/grpc/picker_wrapper.go | 180 + go/vendor/google.golang.org/grpc/pickfirst.go | 109 + go/vendor/google.golang.org/grpc/proxy.go | 130 + .../grpc/reflection/README.md | 18 + .../grpc_reflection_v1alpha/reflection.pb.go | 939 + .../grpc_reflection_v1alpha/reflection.proto | 136 + .../grpc/reflection/serverreflection.go | 454 + .../grpc/resolver/dns/dns_resolver.go | 410 + .../grpc/resolver/dns/go19.go | 54 + .../grpc/resolver/dns/pre_go19.go | 51 + .../grpc/resolver/passthrough/passthrough.go | 57 + .../grpc/resolver/resolver.go | 158 + .../grpc/resolver_conn_wrapper.go | 189 + go/vendor/google.golang.org/grpc/rpc_util.go | 789 + go/vendor/google.golang.org/grpc/server.go | 1380 + .../google.golang.org/grpc/service_config.go | 361 + .../google.golang.org/grpc/stats/handlers.go | 64 + .../google.golang.org/grpc/stats/stats.go | 296 + .../google.golang.org/grpc/status/go16.go | 42 + .../google.golang.org/grpc/status/go17.go | 44 + .../google.golang.org/grpc/status/status.go | 193 + go/vendor/google.golang.org/grpc/stream.go | 1033 + go/vendor/google.golang.org/grpc/tap/tap.go | 51 + go/vendor/google.golang.org/grpc/trace.go | 113 + go/vendor/google.golang.org/grpc/version.go | 22 + go/vendor/google.golang.org/grpc/vet.sh | 129 + go/vendor/gopkg.in/yaml.v2/.travis.yml | 12 + go/vendor/gopkg.in/yaml.v2/LICENSE | 201 + go/vendor/gopkg.in/yaml.v2/LICENSE.libyaml | 31 + go/vendor/gopkg.in/yaml.v2/NOTICE | 13 + go/vendor/gopkg.in/yaml.v2/README.md | 133 + go/vendor/gopkg.in/yaml.v2/apic.go | 739 + go/vendor/gopkg.in/yaml.v2/decode.go | 775 + go/vendor/gopkg.in/yaml.v2/emitterc.go | 1685 + go/vendor/gopkg.in/yaml.v2/encode.go | 362 + go/vendor/gopkg.in/yaml.v2/go.mod | 5 + go/vendor/gopkg.in/yaml.v2/parserc.go | 1095 + go/vendor/gopkg.in/yaml.v2/readerc.go | 412 + go/vendor/gopkg.in/yaml.v2/resolve.go | 258 + go/vendor/gopkg.in/yaml.v2/scannerc.go | 2696 + go/vendor/gopkg.in/yaml.v2/sorter.go | 113 + go/vendor/gopkg.in/yaml.v2/writerc.go | 26 + go/vendor/gopkg.in/yaml.v2/yaml.go | 466 + go/vendor/gopkg.in/yaml.v2/yamlh.go | 738 + go/vendor/gopkg.in/yaml.v2/yamlprivateh.go | 173 + go/vendor/vbom.ml/util/LICENSE | 17 + go/vendor/vbom.ml/util/sortorder/README.md | 5 + go/vendor/vbom.ml/util/sortorder/doc.go | 5 + go/vendor/vbom.ml/util/sortorder/natsort.go | 76 + 1939 files changed, 593415 insertions(+) create mode 100644 go/Gopkg.lock create mode 100644 go/Gopkg.toml create mode 100644 go/vendor/github.com/PuerkitoBio/purell/.gitignore create mode 100644 go/vendor/github.com/PuerkitoBio/purell/.travis.yml create mode 100644 go/vendor/github.com/PuerkitoBio/purell/LICENSE create mode 100644 go/vendor/github.com/PuerkitoBio/purell/README.md create mode 100644 go/vendor/github.com/PuerkitoBio/purell/purell.go create mode 100644 go/vendor/github.com/PuerkitoBio/urlesc/.travis.yml create mode 100644 go/vendor/github.com/PuerkitoBio/urlesc/LICENSE create mode 100644 go/vendor/github.com/PuerkitoBio/urlesc/README.md create mode 100644 go/vendor/github.com/PuerkitoBio/urlesc/urlesc.go create mode 100644 go/vendor/github.com/StackExchange/wmi/LICENSE create mode 100644 go/vendor/github.com/StackExchange/wmi/README.md create mode 100644 go/vendor/github.com/StackExchange/wmi/swbemservices.go create mode 100644 go/vendor/github.com/StackExchange/wmi/wmi.go create mode 100644 go/vendor/github.com/asaskevich/govalidator/.travis.yml create mode 100644 go/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md create mode 100644 go/vendor/github.com/asaskevich/govalidator/LICENSE create mode 100644 go/vendor/github.com/asaskevich/govalidator/README.md create mode 100644 go/vendor/github.com/asaskevich/govalidator/arrays.go create mode 100644 go/vendor/github.com/asaskevich/govalidator/converter.go create mode 100644 go/vendor/github.com/asaskevich/govalidator/error.go create mode 100644 go/vendor/github.com/asaskevich/govalidator/numerics.go create mode 100644 go/vendor/github.com/asaskevich/govalidator/patterns.go create mode 100644 go/vendor/github.com/asaskevich/govalidator/types.go create mode 100644 go/vendor/github.com/asaskevich/govalidator/utils.go create mode 100644 go/vendor/github.com/asaskevich/govalidator/validator.go create mode 100644 go/vendor/github.com/asaskevich/govalidator/wercker.yml create mode 100644 go/vendor/github.com/cenkalti/backoff/.gitignore create mode 100644 go/vendor/github.com/cenkalti/backoff/.travis.yml create mode 100644 go/vendor/github.com/cenkalti/backoff/LICENSE create mode 100644 go/vendor/github.com/cenkalti/backoff/README.md create mode 100644 go/vendor/github.com/cenkalti/backoff/backoff.go create mode 100644 go/vendor/github.com/cenkalti/backoff/context.go create mode 100644 go/vendor/github.com/cenkalti/backoff/exponential.go create mode 100644 go/vendor/github.com/cenkalti/backoff/retry.go create mode 100644 go/vendor/github.com/cenkalti/backoff/ticker.go create mode 100644 go/vendor/github.com/cenkalti/backoff/tries.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/AUTHORS create mode 100644 go/vendor/github.com/digitalocean/go-netbox/LICENSE.md create mode 100644 go/vendor/github.com/digitalocean/go-netbox/copyright_header.txt create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_choices_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_choices_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_choices_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_choices_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_client.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_graphs_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_graphs_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_choices_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_choices_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_choices_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_choices_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_client.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_connected_device_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_connected_device_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_connections_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_connections_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_napalm_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_napalm_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_graphs_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_graphs_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_connections_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_connections_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_units_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_units_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_graphs_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_graphs_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_choices_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_choices_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_choices_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_choices_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_client.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_recent_activity_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_recent_activity_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_recent_activity_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_recent_activity_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_render_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_render_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_am_client.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amchoices_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amchoices_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amchoices_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amchoices_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_ips_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_ips_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_ips_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_ips_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_prefixes_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_prefixes_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_prefixes_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_prefixes_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/net_box_client.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_choices_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_choices_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_choices_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_choices_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_client.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_generate_rsa_key_pair_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_generate_rsa_key_pair_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_get_session_key_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_get_session_key_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_choices_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_choices_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_choices_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_choices_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_client.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_choices_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_choices_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_choices_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_choices_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_client.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_create_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_create_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_delete_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_delete_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_list_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_list_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_partial_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_partial_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_read_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_read_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_update_parameters.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_update_responses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/aggregate.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuit.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuit_status.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuit_termination.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuit_type.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuit_terminations_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuit_terminations_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuit_types_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuit_types_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuits_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuits_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_providers_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_providers_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/cluster.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/cluster_group.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/cluster_type.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/console_port.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/console_port_template.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/console_server_port.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/console_server_port_template.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_connections_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_connections_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_port_templates_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_port_templates_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_ports_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_ports_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_server_port_templates_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_server_port_templates_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_server_ports_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_server_ports_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_bay_templates_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_bay_templates_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_bays_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_bays_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_roles_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_roles_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_types_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_types_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_devices_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_devices_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interface_connections_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interface_connections_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interface_templates_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interface_templates_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interfaces_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interfaces_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_inventory_items_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_inventory_items_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_manufacturers_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_manufacturers_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_platforms_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_platforms_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_connections_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_connections_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_outlet_templates_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_outlet_templates_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_outlets_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_outlets_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_port_templates_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_port_templates_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_ports_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_ports_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_groups_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_groups_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_reservations_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_reservations_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_roles_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_roles_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_racks_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_racks_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_regions_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_regions_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_sites_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_sites_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_virtual_chassis_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_virtual_chassis_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/device.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_bay.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_bay_template.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_face.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_ip_address.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_role.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_status.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_type.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_type_interface_ordering.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_type_subdevice_role.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_virtual_chassis.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/export_template.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_export_templates_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_export_templates_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_graphs_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_graphs_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_image_attachments_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_image_attachments_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_recent_activity_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_recent_activity_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_topology_maps_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_topology_maps_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/graph.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/graph_type.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/image_attachment.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_circuit_termination.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_connection.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_connection_connection_status.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_form_factor.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_mode.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_nested_circuit.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_tagged_vlans.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_template.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_template_form_factor.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_vlan.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/inventory_item.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_address.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_address_interface.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_address_role.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_address_status.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amaggregates_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amaggregates_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amip_addresses_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amip_addresses_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amprefixes_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amprefixes_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amrirs_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amrirs_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amroles_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amroles_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amservices_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amservices_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvlan_groups_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvlan_groups_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvlans_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvlans_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvrfs_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvrfs_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/manufacturer.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_circuit.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_circuit_type.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_cluster.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_cluster_group.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_cluster_type.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_device.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_device_role.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_device_type.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_interface.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_ip_address.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_manufacturer.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_platform.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_provider.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_rack.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_rack_group.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_rack_role.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_region.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_rir.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_role.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_secret_role.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_site.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_tenant.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_tenant_group.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_user.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_virtual_machine.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_vlan.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_vlangroup.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_vrf.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/peer_interface.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/peer_interface_form_factor.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/platform.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/power_outlet.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/power_outlet_template.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/power_port.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/power_port_template.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/prefix.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/prefix_status.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/provider.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_group.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_reservation.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_role.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_type.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_width.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/region.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/rir.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/role.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/secret.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/secret_role.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/secrets_secret_roles_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/secrets_secret_roles_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/secrets_secrets_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/secrets_secrets_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/service.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/service_ipaddresses.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/service_protocol.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/site.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/site_status.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenancy_tenant_groups_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenancy_tenant_groups_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenancy_tenants_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenancy_tenants_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenant.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenant_group.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/topology_map.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/user_action.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/user_action_action.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtual_chassis.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtual_machine.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtual_machine_ip_address.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtual_machine_status.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_cluster_groups_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_cluster_groups_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_cluster_types_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_cluster_types_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_clusters_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_clusters_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_interfaces_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_interfaces_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_virtual_machines_list_okbody.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_virtual_machines_list_okbody_results.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/vlan.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/vlangroup.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/vlanstatus.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/vrf.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_aggregate.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_circuit.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_circuit_termination.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_cluster.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_console_port.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_console_port_template.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_console_server_port.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_console_server_port_template.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_device.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_device_bay.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_device_bay_template.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_device_type.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_graph.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_image_attachment.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_interface.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_interface_connection.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_interface_template.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_inventory_item.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_ip_address.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_platform.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_power_outlet.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_power_outlet_template.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_power_port.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_power_port_template.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_prefix.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_provider.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_rack.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_rack_group.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_rack_reservation.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_region.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_secret.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_service.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_site.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_tenant.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_topology_map.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_virtual_chassis.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_virtual_machine.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_vlan.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_vlangroup.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_vrf.go create mode 100644 go/vendor/github.com/digitalocean/go-netbox/netbox/netbox.go create mode 100755 go/vendor/github.com/digitalocean/go-netbox/scripts/licensecheck.sh create mode 100644 go/vendor/github.com/globalsign/mgo/LICENSE create mode 100644 go/vendor/github.com/globalsign/mgo/bson/LICENSE create mode 100644 go/vendor/github.com/globalsign/mgo/bson/README.md create mode 100644 go/vendor/github.com/globalsign/mgo/bson/bson.go create mode 100644 go/vendor/github.com/globalsign/mgo/bson/bson_corpus_spec_test_generator.go create mode 100644 go/vendor/github.com/globalsign/mgo/bson/compatibility.go create mode 100644 go/vendor/github.com/globalsign/mgo/bson/decimal.go create mode 100644 go/vendor/github.com/globalsign/mgo/bson/decode.go create mode 100644 go/vendor/github.com/globalsign/mgo/bson/encode.go create mode 100644 go/vendor/github.com/globalsign/mgo/bson/json.go create mode 100644 go/vendor/github.com/globalsign/mgo/bson/stream.go create mode 100644 go/vendor/github.com/globalsign/mgo/internal/json/LICENSE create mode 100644 go/vendor/github.com/globalsign/mgo/internal/json/decode.go create mode 100644 go/vendor/github.com/globalsign/mgo/internal/json/encode.go create mode 100644 go/vendor/github.com/globalsign/mgo/internal/json/extension.go create mode 100644 go/vendor/github.com/globalsign/mgo/internal/json/fold.go create mode 100644 go/vendor/github.com/globalsign/mgo/internal/json/indent.go create mode 100644 go/vendor/github.com/globalsign/mgo/internal/json/scanner.go create mode 100644 go/vendor/github.com/globalsign/mgo/internal/json/stream.go create mode 100644 go/vendor/github.com/globalsign/mgo/internal/json/tags.go create mode 100644 go/vendor/github.com/go-ole/go-ole/.travis.yml create mode 100644 go/vendor/github.com/go-ole/go-ole/ChangeLog.md create mode 100644 go/vendor/github.com/go-ole/go-ole/LICENSE create mode 100644 go/vendor/github.com/go-ole/go-ole/README.md create mode 100644 go/vendor/github.com/go-ole/go-ole/appveyor.yml create mode 100644 go/vendor/github.com/go-ole/go-ole/com.go create mode 100644 go/vendor/github.com/go-ole/go-ole/com_func.go create mode 100644 go/vendor/github.com/go-ole/go-ole/connect.go create mode 100644 go/vendor/github.com/go-ole/go-ole/constants.go create mode 100644 go/vendor/github.com/go-ole/go-ole/error.go create mode 100644 go/vendor/github.com/go-ole/go-ole/error_func.go create mode 100644 go/vendor/github.com/go-ole/go-ole/error_windows.go create mode 100644 go/vendor/github.com/go-ole/go-ole/guid.go create mode 100644 go/vendor/github.com/go-ole/go-ole/iconnectionpoint.go create mode 100644 go/vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go create mode 100644 go/vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go create mode 100644 go/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go create mode 100644 go/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go create mode 100644 go/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go create mode 100644 go/vendor/github.com/go-ole/go-ole/idispatch.go create mode 100644 go/vendor/github.com/go-ole/go-ole/idispatch_func.go create mode 100644 go/vendor/github.com/go-ole/go-ole/idispatch_windows.go create mode 100644 go/vendor/github.com/go-ole/go-ole/ienumvariant.go create mode 100644 go/vendor/github.com/go-ole/go-ole/ienumvariant_func.go create mode 100644 go/vendor/github.com/go-ole/go-ole/ienumvariant_windows.go create mode 100644 go/vendor/github.com/go-ole/go-ole/iinspectable.go create mode 100644 go/vendor/github.com/go-ole/go-ole/iinspectable_func.go create mode 100644 go/vendor/github.com/go-ole/go-ole/iinspectable_windows.go create mode 100644 go/vendor/github.com/go-ole/go-ole/iprovideclassinfo.go create mode 100644 go/vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go create mode 100644 go/vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go create mode 100644 go/vendor/github.com/go-ole/go-ole/itypeinfo.go create mode 100644 go/vendor/github.com/go-ole/go-ole/itypeinfo_func.go create mode 100644 go/vendor/github.com/go-ole/go-ole/itypeinfo_windows.go create mode 100644 go/vendor/github.com/go-ole/go-ole/iunknown.go create mode 100644 go/vendor/github.com/go-ole/go-ole/iunknown_func.go create mode 100644 go/vendor/github.com/go-ole/go-ole/iunknown_windows.go create mode 100644 go/vendor/github.com/go-ole/go-ole/ole.go create mode 100644 go/vendor/github.com/go-ole/go-ole/oleutil/connection.go create mode 100644 go/vendor/github.com/go-ole/go-ole/oleutil/connection_func.go create mode 100644 go/vendor/github.com/go-ole/go-ole/oleutil/connection_windows.go create mode 100644 go/vendor/github.com/go-ole/go-ole/oleutil/go-get.go create mode 100644 go/vendor/github.com/go-ole/go-ole/oleutil/oleutil.go create mode 100644 go/vendor/github.com/go-ole/go-ole/safearray.go create mode 100644 go/vendor/github.com/go-ole/go-ole/safearray_func.go create mode 100644 go/vendor/github.com/go-ole/go-ole/safearray_windows.go create mode 100644 go/vendor/github.com/go-ole/go-ole/safearrayconversion.go create mode 100644 go/vendor/github.com/go-ole/go-ole/safearrayslices.go create mode 100644 go/vendor/github.com/go-ole/go-ole/utility.go create mode 100644 go/vendor/github.com/go-ole/go-ole/variables.go create mode 100644 go/vendor/github.com/go-ole/go-ole/variant.go create mode 100644 go/vendor/github.com/go-ole/go-ole/variant_386.go create mode 100644 go/vendor/github.com/go-ole/go-ole/variant_amd64.go create mode 100644 go/vendor/github.com/go-ole/go-ole/variant_s390x.go create mode 100644 go/vendor/github.com/go-ole/go-ole/vt_string.go create mode 100644 go/vendor/github.com/go-ole/go-ole/winrt.go create mode 100644 go/vendor/github.com/go-ole/go-ole/winrt_doc.go create mode 100644 go/vendor/github.com/go-openapi/analysis/.gitignore create mode 100644 go/vendor/github.com/go-openapi/analysis/.golangci.yml create mode 100644 go/vendor/github.com/go-openapi/analysis/.travis.yml create mode 100644 go/vendor/github.com/go-openapi/analysis/CODE_OF_CONDUCT.md create mode 100644 go/vendor/github.com/go-openapi/analysis/LICENSE create mode 100644 go/vendor/github.com/go-openapi/analysis/README.md create mode 100644 go/vendor/github.com/go-openapi/analysis/analyzer.go create mode 100644 go/vendor/github.com/go-openapi/analysis/debug.go create mode 100644 go/vendor/github.com/go-openapi/analysis/doc.go create mode 100644 go/vendor/github.com/go-openapi/analysis/fixer.go create mode 100644 go/vendor/github.com/go-openapi/analysis/flatten.go create mode 100644 go/vendor/github.com/go-openapi/analysis/go.mod create mode 100644 go/vendor/github.com/go-openapi/analysis/go.sum create mode 100644 go/vendor/github.com/go-openapi/analysis/internal/post_go18.go create mode 100644 go/vendor/github.com/go-openapi/analysis/internal/pre_go18.go create mode 100644 go/vendor/github.com/go-openapi/analysis/mixin.go create mode 100644 go/vendor/github.com/go-openapi/analysis/schema.go create mode 100644 go/vendor/github.com/go-openapi/errors/.gitignore create mode 100644 go/vendor/github.com/go-openapi/errors/.travis.yml create mode 100644 go/vendor/github.com/go-openapi/errors/CODE_OF_CONDUCT.md create mode 100644 go/vendor/github.com/go-openapi/errors/LICENSE create mode 100644 go/vendor/github.com/go-openapi/errors/README.md create mode 100644 go/vendor/github.com/go-openapi/errors/api.go create mode 100644 go/vendor/github.com/go-openapi/errors/auth.go create mode 100644 go/vendor/github.com/go-openapi/errors/doc.go create mode 100644 go/vendor/github.com/go-openapi/errors/go.mod create mode 100644 go/vendor/github.com/go-openapi/errors/go.sum create mode 100644 go/vendor/github.com/go-openapi/errors/headers.go create mode 100644 go/vendor/github.com/go-openapi/errors/middleware.go create mode 100644 go/vendor/github.com/go-openapi/errors/parsing.go create mode 100644 go/vendor/github.com/go-openapi/errors/schema.go create mode 100644 go/vendor/github.com/go-openapi/jsonpointer/.editorconfig create mode 100644 go/vendor/github.com/go-openapi/jsonpointer/.gitignore create mode 100644 go/vendor/github.com/go-openapi/jsonpointer/.travis.yml create mode 100644 go/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md create mode 100644 go/vendor/github.com/go-openapi/jsonpointer/LICENSE create mode 100644 go/vendor/github.com/go-openapi/jsonpointer/README.md create mode 100644 go/vendor/github.com/go-openapi/jsonpointer/go.mod create mode 100644 go/vendor/github.com/go-openapi/jsonpointer/go.sum create mode 100644 go/vendor/github.com/go-openapi/jsonpointer/pointer.go create mode 100644 go/vendor/github.com/go-openapi/jsonreference/.gitignore create mode 100644 go/vendor/github.com/go-openapi/jsonreference/.travis.yml create mode 100644 go/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md create mode 100644 go/vendor/github.com/go-openapi/jsonreference/LICENSE create mode 100644 go/vendor/github.com/go-openapi/jsonreference/README.md create mode 100644 go/vendor/github.com/go-openapi/jsonreference/go.mod create mode 100644 go/vendor/github.com/go-openapi/jsonreference/go.sum create mode 100644 go/vendor/github.com/go-openapi/jsonreference/reference.go create mode 100644 go/vendor/github.com/go-openapi/loads/.drone.sec create mode 100644 go/vendor/github.com/go-openapi/loads/.drone.yml create mode 100644 go/vendor/github.com/go-openapi/loads/.editorconfig create mode 100644 go/vendor/github.com/go-openapi/loads/.gitignore create mode 100644 go/vendor/github.com/go-openapi/loads/.travis.yml create mode 100644 go/vendor/github.com/go-openapi/loads/CODE_OF_CONDUCT.md create mode 100644 go/vendor/github.com/go-openapi/loads/LICENSE create mode 100644 go/vendor/github.com/go-openapi/loads/README.md create mode 100644 go/vendor/github.com/go-openapi/loads/go.mod create mode 100644 go/vendor/github.com/go-openapi/loads/go.sum create mode 100644 go/vendor/github.com/go-openapi/loads/spec.go create mode 100644 go/vendor/github.com/go-openapi/runtime/.editorconfig create mode 100644 go/vendor/github.com/go-openapi/runtime/.gitignore create mode 100644 go/vendor/github.com/go-openapi/runtime/.travis.yml create mode 100644 go/vendor/github.com/go-openapi/runtime/CODE_OF_CONDUCT.md create mode 100644 go/vendor/github.com/go-openapi/runtime/LICENSE create mode 100644 go/vendor/github.com/go-openapi/runtime/README.md create mode 100644 go/vendor/github.com/go-openapi/runtime/bytestream.go create mode 100644 go/vendor/github.com/go-openapi/runtime/client/auth_info.go create mode 100644 go/vendor/github.com/go-openapi/runtime/client/keepalive.go create mode 100644 go/vendor/github.com/go-openapi/runtime/client/request.go create mode 100644 go/vendor/github.com/go-openapi/runtime/client/response.go create mode 100644 go/vendor/github.com/go-openapi/runtime/client/runtime.go create mode 100644 go/vendor/github.com/go-openapi/runtime/client_auth_info.go create mode 100644 go/vendor/github.com/go-openapi/runtime/client_operation.go create mode 100644 go/vendor/github.com/go-openapi/runtime/client_request.go create mode 100644 go/vendor/github.com/go-openapi/runtime/client_response.go create mode 100644 go/vendor/github.com/go-openapi/runtime/constants.go create mode 100644 go/vendor/github.com/go-openapi/runtime/discard.go create mode 100644 go/vendor/github.com/go-openapi/runtime/file.go create mode 100644 go/vendor/github.com/go-openapi/runtime/go.mod create mode 100644 go/vendor/github.com/go-openapi/runtime/go.sum create mode 100644 go/vendor/github.com/go-openapi/runtime/headers.go create mode 100644 go/vendor/github.com/go-openapi/runtime/interfaces.go create mode 100644 go/vendor/github.com/go-openapi/runtime/json.go create mode 100644 go/vendor/github.com/go-openapi/runtime/logger/logger.go create mode 100644 go/vendor/github.com/go-openapi/runtime/logger/standard.go create mode 100644 go/vendor/github.com/go-openapi/runtime/middleware/context.go create mode 100755 go/vendor/github.com/go-openapi/runtime/middleware/denco/LICENSE create mode 100755 go/vendor/github.com/go-openapi/runtime/middleware/denco/README.md create mode 100755 go/vendor/github.com/go-openapi/runtime/middleware/denco/router.go create mode 100755 go/vendor/github.com/go-openapi/runtime/middleware/denco/server.go create mode 100755 go/vendor/github.com/go-openapi/runtime/middleware/denco/util.go create mode 100644 go/vendor/github.com/go-openapi/runtime/middleware/doc.go create mode 100644 go/vendor/github.com/go-openapi/runtime/middleware/go18.go create mode 100644 go/vendor/github.com/go-openapi/runtime/middleware/header/header.go create mode 100644 go/vendor/github.com/go-openapi/runtime/middleware/negotiate.go create mode 100644 go/vendor/github.com/go-openapi/runtime/middleware/not_implemented.go create mode 100644 go/vendor/github.com/go-openapi/runtime/middleware/operation.go create mode 100644 go/vendor/github.com/go-openapi/runtime/middleware/parameter.go create mode 100644 go/vendor/github.com/go-openapi/runtime/middleware/pre_go18.go create mode 100644 go/vendor/github.com/go-openapi/runtime/middleware/redoc.go create mode 100644 go/vendor/github.com/go-openapi/runtime/middleware/request.go create mode 100644 go/vendor/github.com/go-openapi/runtime/middleware/router.go create mode 100644 go/vendor/github.com/go-openapi/runtime/middleware/security.go create mode 100644 go/vendor/github.com/go-openapi/runtime/middleware/spec.go create mode 100644 go/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go create mode 100644 go/vendor/github.com/go-openapi/runtime/middleware/validation.go create mode 100644 go/vendor/github.com/go-openapi/runtime/request.go create mode 100644 go/vendor/github.com/go-openapi/runtime/security/authenticator.go create mode 100644 go/vendor/github.com/go-openapi/runtime/security/authorizer.go create mode 100644 go/vendor/github.com/go-openapi/runtime/statuses.go create mode 100644 go/vendor/github.com/go-openapi/runtime/text.go create mode 100644 go/vendor/github.com/go-openapi/runtime/values.go create mode 100644 go/vendor/github.com/go-openapi/runtime/xml.go create mode 100644 go/vendor/github.com/go-openapi/spec/.editorconfig create mode 100644 go/vendor/github.com/go-openapi/spec/.gitignore create mode 100644 go/vendor/github.com/go-openapi/spec/.golangci.yml create mode 100644 go/vendor/github.com/go-openapi/spec/.travis.yml create mode 100644 go/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md create mode 100644 go/vendor/github.com/go-openapi/spec/LICENSE create mode 100644 go/vendor/github.com/go-openapi/spec/README.md create mode 100644 go/vendor/github.com/go-openapi/spec/bindata.go create mode 100644 go/vendor/github.com/go-openapi/spec/contact_info.go create mode 100644 go/vendor/github.com/go-openapi/spec/debug.go create mode 100644 go/vendor/github.com/go-openapi/spec/expander.go create mode 100644 go/vendor/github.com/go-openapi/spec/external_docs.go create mode 100644 go/vendor/github.com/go-openapi/spec/go.mod create mode 100644 go/vendor/github.com/go-openapi/spec/go.sum create mode 100644 go/vendor/github.com/go-openapi/spec/header.go create mode 100644 go/vendor/github.com/go-openapi/spec/info.go create mode 100644 go/vendor/github.com/go-openapi/spec/items.go create mode 100644 go/vendor/github.com/go-openapi/spec/license.go create mode 100644 go/vendor/github.com/go-openapi/spec/operation.go create mode 100644 go/vendor/github.com/go-openapi/spec/parameter.go create mode 100644 go/vendor/github.com/go-openapi/spec/path_item.go create mode 100644 go/vendor/github.com/go-openapi/spec/paths.go create mode 100644 go/vendor/github.com/go-openapi/spec/ref.go create mode 100644 go/vendor/github.com/go-openapi/spec/response.go create mode 100644 go/vendor/github.com/go-openapi/spec/responses.go create mode 100644 go/vendor/github.com/go-openapi/spec/schema.go create mode 100644 go/vendor/github.com/go-openapi/spec/security_scheme.go create mode 100644 go/vendor/github.com/go-openapi/spec/spec.go create mode 100644 go/vendor/github.com/go-openapi/spec/swagger.go create mode 100644 go/vendor/github.com/go-openapi/spec/tag.go create mode 100644 go/vendor/github.com/go-openapi/spec/xml_object.go create mode 100644 go/vendor/github.com/go-openapi/strfmt/.editorconfig create mode 100644 go/vendor/github.com/go-openapi/strfmt/.gitignore create mode 100644 go/vendor/github.com/go-openapi/strfmt/.golangci.yml create mode 100644 go/vendor/github.com/go-openapi/strfmt/.travis.yml create mode 100644 go/vendor/github.com/go-openapi/strfmt/CODE_OF_CONDUCT.md create mode 100644 go/vendor/github.com/go-openapi/strfmt/LICENSE create mode 100644 go/vendor/github.com/go-openapi/strfmt/README.md create mode 100644 go/vendor/github.com/go-openapi/strfmt/bson.go create mode 100644 go/vendor/github.com/go-openapi/strfmt/date.go create mode 100644 go/vendor/github.com/go-openapi/strfmt/default.go create mode 100644 go/vendor/github.com/go-openapi/strfmt/doc.go create mode 100644 go/vendor/github.com/go-openapi/strfmt/duration.go create mode 100644 go/vendor/github.com/go-openapi/strfmt/format.go create mode 100644 go/vendor/github.com/go-openapi/strfmt/go.mod create mode 100644 go/vendor/github.com/go-openapi/strfmt/go.sum create mode 100644 go/vendor/github.com/go-openapi/strfmt/time.go create mode 100644 go/vendor/github.com/go-openapi/swag/.editorconfig create mode 100644 go/vendor/github.com/go-openapi/swag/.gitignore create mode 100644 go/vendor/github.com/go-openapi/swag/.golangci.yml create mode 100644 go/vendor/github.com/go-openapi/swag/.travis.yml create mode 100644 go/vendor/github.com/go-openapi/swag/CODE_OF_CONDUCT.md create mode 100644 go/vendor/github.com/go-openapi/swag/LICENSE create mode 100644 go/vendor/github.com/go-openapi/swag/README.md create mode 100644 go/vendor/github.com/go-openapi/swag/convert.go create mode 100644 go/vendor/github.com/go-openapi/swag/convert_types.go create mode 100644 go/vendor/github.com/go-openapi/swag/doc.go create mode 100644 go/vendor/github.com/go-openapi/swag/go.mod create mode 100644 go/vendor/github.com/go-openapi/swag/go.sum create mode 100644 go/vendor/github.com/go-openapi/swag/json.go create mode 100644 go/vendor/github.com/go-openapi/swag/loading.go create mode 100644 go/vendor/github.com/go-openapi/swag/net.go create mode 100644 go/vendor/github.com/go-openapi/swag/path.go create mode 100644 go/vendor/github.com/go-openapi/swag/post_go18.go create mode 100644 go/vendor/github.com/go-openapi/swag/post_go19.go create mode 100644 go/vendor/github.com/go-openapi/swag/pre_go18.go create mode 100644 go/vendor/github.com/go-openapi/swag/pre_go19.go create mode 100644 go/vendor/github.com/go-openapi/swag/util.go create mode 100644 go/vendor/github.com/go-openapi/swag/yaml.go create mode 100644 go/vendor/github.com/go-openapi/validate/.editorconfig create mode 100644 go/vendor/github.com/go-openapi/validate/.gitignore create mode 100644 go/vendor/github.com/go-openapi/validate/.golangci.yml create mode 100644 go/vendor/github.com/go-openapi/validate/.travis.yml create mode 100644 go/vendor/github.com/go-openapi/validate/CODE_OF_CONDUCT.md create mode 100644 go/vendor/github.com/go-openapi/validate/LICENSE create mode 100644 go/vendor/github.com/go-openapi/validate/README.md create mode 100644 go/vendor/github.com/go-openapi/validate/debug.go create mode 100644 go/vendor/github.com/go-openapi/validate/default_validator.go create mode 100644 go/vendor/github.com/go-openapi/validate/doc.go create mode 100644 go/vendor/github.com/go-openapi/validate/example_validator.go create mode 100644 go/vendor/github.com/go-openapi/validate/formats.go create mode 100644 go/vendor/github.com/go-openapi/validate/go.mod create mode 100644 go/vendor/github.com/go-openapi/validate/go.sum create mode 100644 go/vendor/github.com/go-openapi/validate/helpers.go create mode 100644 go/vendor/github.com/go-openapi/validate/object_validator.go create mode 100644 go/vendor/github.com/go-openapi/validate/options.go create mode 100644 go/vendor/github.com/go-openapi/validate/result.go create mode 100644 go/vendor/github.com/go-openapi/validate/rexp.go create mode 100644 go/vendor/github.com/go-openapi/validate/schema.go create mode 100644 go/vendor/github.com/go-openapi/validate/schema_messages.go create mode 100644 go/vendor/github.com/go-openapi/validate/schema_props.go create mode 100644 go/vendor/github.com/go-openapi/validate/slice_validator.go create mode 100644 go/vendor/github.com/go-openapi/validate/spec.go create mode 100644 go/vendor/github.com/go-openapi/validate/spec_messages.go create mode 100644 go/vendor/github.com/go-openapi/validate/type.go create mode 100755 go/vendor/github.com/go-openapi/validate/update-fixtures.sh create mode 100644 go/vendor/github.com/go-openapi/validate/validator.go create mode 100644 go/vendor/github.com/go-openapi/validate/values.go create mode 100644 go/vendor/github.com/gobuffalo/packr/.codeclimate.yml create mode 100644 go/vendor/github.com/gobuffalo/packr/.gitignore create mode 100644 go/vendor/github.com/gobuffalo/packr/.goreleaser.yml create mode 100644 go/vendor/github.com/gobuffalo/packr/.travis.yml create mode 100644 go/vendor/github.com/gobuffalo/packr/LICENSE.txt create mode 100644 go/vendor/github.com/gobuffalo/packr/Makefile create mode 100644 go/vendor/github.com/gobuffalo/packr/README.md create mode 100644 go/vendor/github.com/gobuffalo/packr/box.go create mode 100644 go/vendor/github.com/gobuffalo/packr/env.go create mode 100644 go/vendor/github.com/gobuffalo/packr/file.go create mode 100644 go/vendor/github.com/gobuffalo/packr/file_info.go create mode 100644 go/vendor/github.com/gobuffalo/packr/go.mod create mode 100644 go/vendor/github.com/gobuffalo/packr/go.sum create mode 100644 go/vendor/github.com/gobuffalo/packr/packr.go create mode 100644 go/vendor/github.com/gobuffalo/packr/physical_file.go create mode 100644 go/vendor/github.com/gobuffalo/packr/shoulders.md create mode 100644 go/vendor/github.com/gobuffalo/packr/version.go create mode 100644 go/vendor/github.com/gobuffalo/packr/virtual_file.go create mode 100644 go/vendor/github.com/gobuffalo/packr/walk.go create mode 100644 go/vendor/github.com/golang/glog/LICENSE create mode 100644 go/vendor/github.com/golang/glog/README create mode 100644 go/vendor/github.com/golang/glog/glog.go create mode 100644 go/vendor/github.com/golang/glog/glog_file.go create mode 100644 go/vendor/github.com/golang/protobuf/AUTHORS create mode 100644 go/vendor/github.com/golang/protobuf/CONTRIBUTORS create mode 100644 go/vendor/github.com/golang/protobuf/LICENSE create mode 100644 go/vendor/github.com/golang/protobuf/proto/clone.go create mode 100644 go/vendor/github.com/golang/protobuf/proto/decode.go create mode 100644 go/vendor/github.com/golang/protobuf/proto/discard.go create mode 100644 go/vendor/github.com/golang/protobuf/proto/encode.go create mode 100644 go/vendor/github.com/golang/protobuf/proto/equal.go create mode 100644 go/vendor/github.com/golang/protobuf/proto/extensions.go create mode 100644 go/vendor/github.com/golang/protobuf/proto/lib.go create mode 100644 go/vendor/github.com/golang/protobuf/proto/message_set.go create mode 100644 go/vendor/github.com/golang/protobuf/proto/pointer_reflect.go create mode 100644 go/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go create mode 100644 go/vendor/github.com/golang/protobuf/proto/properties.go create mode 100644 go/vendor/github.com/golang/protobuf/proto/table_marshal.go create mode 100644 go/vendor/github.com/golang/protobuf/proto/table_merge.go create mode 100644 go/vendor/github.com/golang/protobuf/proto/table_unmarshal.go create mode 100644 go/vendor/github.com/golang/protobuf/proto/text.go create mode 100644 go/vendor/github.com/golang/protobuf/proto/text_parser.go create mode 100644 go/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go create mode 100644 go/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto create mode 100644 go/vendor/github.com/golang/protobuf/ptypes/any.go create mode 100644 go/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go create mode 100644 go/vendor/github.com/golang/protobuf/ptypes/any/any.proto create mode 100644 go/vendor/github.com/golang/protobuf/ptypes/doc.go create mode 100644 go/vendor/github.com/golang/protobuf/ptypes/duration.go create mode 100644 go/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go create mode 100644 go/vendor/github.com/golang/protobuf/ptypes/duration/duration.proto create mode 100644 go/vendor/github.com/golang/protobuf/ptypes/timestamp.go create mode 100644 go/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go create mode 100644 go/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto create mode 100644 go/vendor/github.com/mailru/easyjson/LICENSE create mode 100644 go/vendor/github.com/mailru/easyjson/buffer/pool.go create mode 100644 go/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go create mode 100644 go/vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go create mode 100644 go/vendor/github.com/mailru/easyjson/jlexer/error.go create mode 100644 go/vendor/github.com/mailru/easyjson/jlexer/lexer.go create mode 100644 go/vendor/github.com/mailru/easyjson/jwriter/writer.go create mode 100644 go/vendor/github.com/mitchellh/mapstructure/.travis.yml create mode 100644 go/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md create mode 100644 go/vendor/github.com/mitchellh/mapstructure/LICENSE create mode 100644 go/vendor/github.com/mitchellh/mapstructure/README.md create mode 100644 go/vendor/github.com/mitchellh/mapstructure/decode_hooks.go create mode 100644 go/vendor/github.com/mitchellh/mapstructure/error.go create mode 100644 go/vendor/github.com/mitchellh/mapstructure/go.mod create mode 100644 go/vendor/github.com/mitchellh/mapstructure/mapstructure.go create mode 100644 go/vendor/github.com/pkg/errors/.gitignore create mode 100644 go/vendor/github.com/pkg/errors/.travis.yml create mode 100644 go/vendor/github.com/pkg/errors/LICENSE create mode 100644 go/vendor/github.com/pkg/errors/README.md create mode 100644 go/vendor/github.com/pkg/errors/appveyor.yml create mode 100644 go/vendor/github.com/pkg/errors/errors.go create mode 100644 go/vendor/github.com/pkg/errors/stack.go create mode 100644 go/vendor/github.com/q3k/statusz/Gopkg.lock create mode 100644 go/vendor/github.com/q3k/statusz/Gopkg.toml create mode 100644 go/vendor/github.com/q3k/statusz/LICENSE create mode 100644 go/vendor/github.com/q3k/statusz/README.md create mode 100644 go/vendor/github.com/q3k/statusz/statusz.go create mode 100644 go/vendor/github.com/shirou/gopsutil/LICENSE create mode 100644 go/vendor/github.com/shirou/gopsutil/internal/common/binary.go create mode 100644 go/vendor/github.com/shirou/gopsutil/internal/common/common.go create mode 100644 go/vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go create mode 100644 go/vendor/github.com/shirou/gopsutil/internal/common/common_freebsd.go create mode 100644 go/vendor/github.com/shirou/gopsutil/internal/common/common_linux.go create mode 100644 go/vendor/github.com/shirou/gopsutil/internal/common/common_openbsd.go create mode 100644 go/vendor/github.com/shirou/gopsutil/internal/common/common_unix.go create mode 100644 go/vendor/github.com/shirou/gopsutil/internal/common/common_windows.go create mode 100644 go/vendor/github.com/shirou/gopsutil/load/load.go create mode 100644 go/vendor/github.com/shirou/gopsutil/load/load_bsd.go create mode 100644 go/vendor/github.com/shirou/gopsutil/load/load_darwin.go create mode 100644 go/vendor/github.com/shirou/gopsutil/load/load_fallback.go create mode 100644 go/vendor/github.com/shirou/gopsutil/load/load_linux.go create mode 100644 go/vendor/github.com/shirou/gopsutil/load/load_windows.go create mode 100644 go/vendor/github.com/ybbus/jsonrpc/.gitignore create mode 100644 go/vendor/github.com/ybbus/jsonrpc/LICENSE create mode 100644 go/vendor/github.com/ybbus/jsonrpc/README.md create mode 100644 go/vendor/github.com/ybbus/jsonrpc/jsonrpc.go create mode 100644 go/vendor/github.com/ziutek/telnet/LICENSE create mode 100644 go/vendor/github.com/ziutek/telnet/README.md create mode 100644 go/vendor/github.com/ziutek/telnet/conn.go create mode 100644 go/vendor/golang.org/x/net/AUTHORS create mode 100644 go/vendor/golang.org/x/net/CONTRIBUTORS create mode 100644 go/vendor/golang.org/x/net/LICENSE create mode 100644 go/vendor/golang.org/x/net/PATENTS create mode 100644 go/vendor/golang.org/x/net/context/context.go create mode 100644 go/vendor/golang.org/x/net/context/go17.go create mode 100644 go/vendor/golang.org/x/net/context/go19.go create mode 100644 go/vendor/golang.org/x/net/context/pre_go17.go create mode 100644 go/vendor/golang.org/x/net/context/pre_go19.go create mode 100644 go/vendor/golang.org/x/net/http/httpguts/guts.go create mode 100644 go/vendor/golang.org/x/net/http/httpguts/httplex.go create mode 100644 go/vendor/golang.org/x/net/http2/.gitignore create mode 100644 go/vendor/golang.org/x/net/http2/Dockerfile create mode 100644 go/vendor/golang.org/x/net/http2/Makefile create mode 100644 go/vendor/golang.org/x/net/http2/README create mode 100644 go/vendor/golang.org/x/net/http2/ciphers.go create mode 100644 go/vendor/golang.org/x/net/http2/client_conn_pool.go create mode 100644 go/vendor/golang.org/x/net/http2/configure_transport.go create mode 100644 go/vendor/golang.org/x/net/http2/databuffer.go create mode 100644 go/vendor/golang.org/x/net/http2/errors.go create mode 100644 go/vendor/golang.org/x/net/http2/flow.go create mode 100644 go/vendor/golang.org/x/net/http2/frame.go create mode 100644 go/vendor/golang.org/x/net/http2/go111.go create mode 100644 go/vendor/golang.org/x/net/http2/go16.go create mode 100644 go/vendor/golang.org/x/net/http2/go17.go create mode 100644 go/vendor/golang.org/x/net/http2/go17_not18.go create mode 100644 go/vendor/golang.org/x/net/http2/go18.go create mode 100644 go/vendor/golang.org/x/net/http2/go19.go create mode 100644 go/vendor/golang.org/x/net/http2/gotrack.go create mode 100644 go/vendor/golang.org/x/net/http2/headermap.go create mode 100644 go/vendor/golang.org/x/net/http2/hpack/encode.go create mode 100644 go/vendor/golang.org/x/net/http2/hpack/hpack.go create mode 100644 go/vendor/golang.org/x/net/http2/hpack/huffman.go create mode 100644 go/vendor/golang.org/x/net/http2/hpack/tables.go create mode 100644 go/vendor/golang.org/x/net/http2/http2.go create mode 100644 go/vendor/golang.org/x/net/http2/not_go111.go create mode 100644 go/vendor/golang.org/x/net/http2/not_go16.go create mode 100644 go/vendor/golang.org/x/net/http2/not_go17.go create mode 100644 go/vendor/golang.org/x/net/http2/not_go18.go create mode 100644 go/vendor/golang.org/x/net/http2/not_go19.go create mode 100644 go/vendor/golang.org/x/net/http2/pipe.go create mode 100644 go/vendor/golang.org/x/net/http2/server.go create mode 100644 go/vendor/golang.org/x/net/http2/transport.go create mode 100644 go/vendor/golang.org/x/net/http2/write.go create mode 100644 go/vendor/golang.org/x/net/http2/writesched.go create mode 100644 go/vendor/golang.org/x/net/http2/writesched_priority.go create mode 100644 go/vendor/golang.org/x/net/http2/writesched_random.go create mode 100644 go/vendor/golang.org/x/net/idna/idna.go create mode 100644 go/vendor/golang.org/x/net/idna/punycode.go create mode 100644 go/vendor/golang.org/x/net/idna/tables.go create mode 100644 go/vendor/golang.org/x/net/idna/trie.go create mode 100644 go/vendor/golang.org/x/net/idna/trieval.go create mode 100644 go/vendor/golang.org/x/net/internal/timeseries/timeseries.go create mode 100644 go/vendor/golang.org/x/net/trace/events.go create mode 100644 go/vendor/golang.org/x/net/trace/histogram.go create mode 100644 go/vendor/golang.org/x/net/trace/trace.go create mode 100644 go/vendor/golang.org/x/net/trace/trace_go16.go create mode 100644 go/vendor/golang.org/x/net/trace/trace_go17.go create mode 100644 go/vendor/golang.org/x/sys/AUTHORS create mode 100644 go/vendor/golang.org/x/sys/CONTRIBUTORS create mode 100644 go/vendor/golang.org/x/sys/LICENSE create mode 100644 go/vendor/golang.org/x/sys/PATENTS create mode 100644 go/vendor/golang.org/x/sys/unix/.gitignore create mode 100644 go/vendor/golang.org/x/sys/unix/README.md create mode 100644 go/vendor/golang.org/x/sys/unix/affinity_linux.go create mode 100644 go/vendor/golang.org/x/sys/unix/aliases.go create mode 100644 go/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_darwin_386.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_darwin_amd64.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_darwin_arm.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_darwin_arm64.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_freebsd_386.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_freebsd_arm.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_linux_386.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_linux_amd64.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_linux_arm.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_linux_arm64.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_linux_s390x.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_netbsd_386.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_netbsd_arm.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_openbsd_386.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_openbsd_arm.s create mode 100644 go/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s create mode 100644 go/vendor/golang.org/x/sys/unix/bluetooth_linux.go create mode 100644 go/vendor/golang.org/x/sys/unix/cap_freebsd.go create mode 100644 go/vendor/golang.org/x/sys/unix/constants.go create mode 100644 go/vendor/golang.org/x/sys/unix/dev_aix_ppc.go create mode 100644 go/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go create mode 100644 go/vendor/golang.org/x/sys/unix/dev_darwin.go create mode 100644 go/vendor/golang.org/x/sys/unix/dev_dragonfly.go create mode 100644 go/vendor/golang.org/x/sys/unix/dev_freebsd.go create mode 100644 go/vendor/golang.org/x/sys/unix/dev_linux.go create mode 100644 go/vendor/golang.org/x/sys/unix/dev_netbsd.go create mode 100644 go/vendor/golang.org/x/sys/unix/dev_openbsd.go create mode 100644 go/vendor/golang.org/x/sys/unix/dirent.go create mode 100644 go/vendor/golang.org/x/sys/unix/endian_big.go create mode 100644 go/vendor/golang.org/x/sys/unix/endian_little.go create mode 100644 go/vendor/golang.org/x/sys/unix/env_unix.go create mode 100644 go/vendor/golang.org/x/sys/unix/errors_freebsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/errors_freebsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/fcntl.go create mode 100644 go/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go create mode 100644 go/vendor/golang.org/x/sys/unix/gccgo.go create mode 100644 go/vendor/golang.org/x/sys/unix/gccgo_c.c create mode 100644 go/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/ioctl.go create mode 100755 go/vendor/golang.org/x/sys/unix/mkall.sh create mode 100755 go/vendor/golang.org/x/sys/unix/mkerrors.sh create mode 100644 go/vendor/golang.org/x/sys/unix/mkpost.go create mode 100755 go/vendor/golang.org/x/sys/unix/mksyscall.pl create mode 100755 go/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.pl create mode 100755 go/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.pl create mode 100755 go/vendor/golang.org/x/sys/unix/mksyscall_solaris.pl create mode 100755 go/vendor/golang.org/x/sys/unix/mksysctl_openbsd.pl create mode 100755 go/vendor/golang.org/x/sys/unix/mksysnum_darwin.pl create mode 100755 go/vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl create mode 100755 go/vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl create mode 100755 go/vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl create mode 100755 go/vendor/golang.org/x/sys/unix/mksysnum_openbsd.pl create mode 100644 go/vendor/golang.org/x/sys/unix/openbsd_pledge.go create mode 100644 go/vendor/golang.org/x/sys/unix/openbsd_unveil.go create mode 100644 go/vendor/golang.org/x/sys/unix/pagesize_unix.go create mode 100644 go/vendor/golang.org/x/sys/unix/race.go create mode 100644 go/vendor/golang.org/x/sys/unix/race0.go create mode 100644 go/vendor/golang.org/x/sys/unix/sockcmsg_linux.go create mode 100644 go/vendor/golang.org/x/sys/unix/sockcmsg_unix.go create mode 100644 go/vendor/golang.org/x/sys/unix/str.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_aix.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_bsd.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_darwin.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_darwin_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_dragonfly.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_freebsd.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_linux.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_linux_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_linux_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_linux_gc.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_netbsd.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_openbsd.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_solaris.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_unix.go create mode 100644 go/vendor/golang.org/x/sys/unix/syscall_unix_gc.go create mode 100644 go/vendor/golang.org/x/sys/unix/timestruct.go create mode 100644 go/vendor/golang.org/x/sys/unix/types_aix.go create mode 100644 go/vendor/golang.org/x/sys/unix/types_darwin.go create mode 100644 go/vendor/golang.org/x/sys/unix/types_dragonfly.go create mode 100644 go/vendor/golang.org/x/sys/unix/types_freebsd.go create mode 100644 go/vendor/golang.org/x/sys/unix/types_netbsd.go create mode 100644 go/vendor/golang.org/x/sys/unix/types_openbsd.go create mode 100644 go/vendor/golang.org/x/sys/unix/types_solaris.go create mode 100644 go/vendor/golang.org/x/sys/unix/xattr_bsd.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_linux_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zptrace386_linux.go create mode 100644 go/vendor/golang.org/x/sys/unix/zptracearm_linux.go create mode 100644 go/vendor/golang.org/x/sys/unix/zptracemips_linux.go create mode 100644 go/vendor/golang.org/x/sys/unix/zptracemipsle_linux.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_linux_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go create mode 100644 go/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go create mode 100644 go/vendor/golang.org/x/sys/windows/aliases.go create mode 100644 go/vendor/golang.org/x/sys/windows/asm_windows_386.s create mode 100644 go/vendor/golang.org/x/sys/windows/asm_windows_amd64.s create mode 100644 go/vendor/golang.org/x/sys/windows/asm_windows_arm.s create mode 100644 go/vendor/golang.org/x/sys/windows/dll_windows.go create mode 100644 go/vendor/golang.org/x/sys/windows/env_windows.go create mode 100644 go/vendor/golang.org/x/sys/windows/eventlog.go create mode 100644 go/vendor/golang.org/x/sys/windows/exec_windows.go create mode 100644 go/vendor/golang.org/x/sys/windows/memory_windows.go create mode 100644 go/vendor/golang.org/x/sys/windows/mksyscall.go create mode 100644 go/vendor/golang.org/x/sys/windows/race.go create mode 100644 go/vendor/golang.org/x/sys/windows/race0.go create mode 100644 go/vendor/golang.org/x/sys/windows/security_windows.go create mode 100644 go/vendor/golang.org/x/sys/windows/service.go create mode 100644 go/vendor/golang.org/x/sys/windows/str.go create mode 100644 go/vendor/golang.org/x/sys/windows/syscall.go create mode 100644 go/vendor/golang.org/x/sys/windows/syscall_windows.go create mode 100644 go/vendor/golang.org/x/sys/windows/types_windows.go create mode 100644 go/vendor/golang.org/x/sys/windows/types_windows_386.go create mode 100644 go/vendor/golang.org/x/sys/windows/types_windows_amd64.go create mode 100644 go/vendor/golang.org/x/sys/windows/types_windows_arm.go create mode 100644 go/vendor/golang.org/x/sys/windows/zsyscall_windows.go create mode 100644 go/vendor/golang.org/x/text/AUTHORS create mode 100644 go/vendor/golang.org/x/text/CONTRIBUTORS create mode 100644 go/vendor/golang.org/x/text/LICENSE create mode 100644 go/vendor/golang.org/x/text/PATENTS create mode 100644 go/vendor/golang.org/x/text/collate/build/builder.go create mode 100644 go/vendor/golang.org/x/text/collate/build/colelem.go create mode 100644 go/vendor/golang.org/x/text/collate/build/contract.go create mode 100644 go/vendor/golang.org/x/text/collate/build/order.go create mode 100644 go/vendor/golang.org/x/text/collate/build/table.go create mode 100644 go/vendor/golang.org/x/text/collate/build/trie.go create mode 100644 go/vendor/golang.org/x/text/collate/collate.go create mode 100644 go/vendor/golang.org/x/text/collate/index.go create mode 100644 go/vendor/golang.org/x/text/collate/maketables.go create mode 100644 go/vendor/golang.org/x/text/collate/option.go create mode 100644 go/vendor/golang.org/x/text/collate/sort.go create mode 100644 go/vendor/golang.org/x/text/collate/tables.go create mode 100644 go/vendor/golang.org/x/text/internal/colltab/collelem.go create mode 100644 go/vendor/golang.org/x/text/internal/colltab/colltab.go create mode 100644 go/vendor/golang.org/x/text/internal/colltab/contract.go create mode 100644 go/vendor/golang.org/x/text/internal/colltab/iter.go create mode 100644 go/vendor/golang.org/x/text/internal/colltab/numeric.go create mode 100644 go/vendor/golang.org/x/text/internal/colltab/table.go create mode 100644 go/vendor/golang.org/x/text/internal/colltab/trie.go create mode 100644 go/vendor/golang.org/x/text/internal/colltab/weighter.go create mode 100644 go/vendor/golang.org/x/text/internal/gen/code.go create mode 100644 go/vendor/golang.org/x/text/internal/gen/gen.go create mode 100644 go/vendor/golang.org/x/text/internal/tag/tag.go create mode 100644 go/vendor/golang.org/x/text/internal/triegen/compact.go create mode 100644 go/vendor/golang.org/x/text/internal/triegen/print.go create mode 100644 go/vendor/golang.org/x/text/internal/triegen/triegen.go create mode 100644 go/vendor/golang.org/x/text/internal/ucd/ucd.go create mode 100644 go/vendor/golang.org/x/text/language/Makefile create mode 100644 go/vendor/golang.org/x/text/language/common.go create mode 100644 go/vendor/golang.org/x/text/language/coverage.go create mode 100644 go/vendor/golang.org/x/text/language/doc.go create mode 100644 go/vendor/golang.org/x/text/language/gen.go create mode 100644 go/vendor/golang.org/x/text/language/gen_common.go create mode 100644 go/vendor/golang.org/x/text/language/gen_index.go create mode 100644 go/vendor/golang.org/x/text/language/go1_1.go create mode 100644 go/vendor/golang.org/x/text/language/go1_2.go create mode 100644 go/vendor/golang.org/x/text/language/index.go create mode 100644 go/vendor/golang.org/x/text/language/language.go create mode 100644 go/vendor/golang.org/x/text/language/lookup.go create mode 100644 go/vendor/golang.org/x/text/language/match.go create mode 100644 go/vendor/golang.org/x/text/language/parse.go create mode 100644 go/vendor/golang.org/x/text/language/tables.go create mode 100644 go/vendor/golang.org/x/text/language/tags.go create mode 100644 go/vendor/golang.org/x/text/secure/bidirule/bidirule.go create mode 100644 go/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go create mode 100644 go/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go create mode 100644 go/vendor/golang.org/x/text/transform/transform.go create mode 100644 go/vendor/golang.org/x/text/unicode/bidi/bidi.go create mode 100644 go/vendor/golang.org/x/text/unicode/bidi/bracket.go create mode 100644 go/vendor/golang.org/x/text/unicode/bidi/core.go create mode 100644 go/vendor/golang.org/x/text/unicode/bidi/gen.go create mode 100644 go/vendor/golang.org/x/text/unicode/bidi/gen_ranges.go create mode 100644 go/vendor/golang.org/x/text/unicode/bidi/gen_trieval.go create mode 100644 go/vendor/golang.org/x/text/unicode/bidi/prop.go create mode 100644 go/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go create mode 100644 go/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go create mode 100644 go/vendor/golang.org/x/text/unicode/bidi/trieval.go create mode 100644 go/vendor/golang.org/x/text/unicode/cldr/base.go create mode 100644 go/vendor/golang.org/x/text/unicode/cldr/cldr.go create mode 100644 go/vendor/golang.org/x/text/unicode/cldr/collate.go create mode 100644 go/vendor/golang.org/x/text/unicode/cldr/decode.go create mode 100644 go/vendor/golang.org/x/text/unicode/cldr/makexml.go create mode 100644 go/vendor/golang.org/x/text/unicode/cldr/resolve.go create mode 100644 go/vendor/golang.org/x/text/unicode/cldr/slice.go create mode 100644 go/vendor/golang.org/x/text/unicode/cldr/xml.go create mode 100644 go/vendor/golang.org/x/text/unicode/norm/composition.go create mode 100644 go/vendor/golang.org/x/text/unicode/norm/forminfo.go create mode 100644 go/vendor/golang.org/x/text/unicode/norm/input.go create mode 100644 go/vendor/golang.org/x/text/unicode/norm/iter.go create mode 100644 go/vendor/golang.org/x/text/unicode/norm/maketables.go create mode 100644 go/vendor/golang.org/x/text/unicode/norm/normalize.go create mode 100644 go/vendor/golang.org/x/text/unicode/norm/readwriter.go create mode 100644 go/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go create mode 100644 go/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go create mode 100644 go/vendor/golang.org/x/text/unicode/norm/transform.go create mode 100644 go/vendor/golang.org/x/text/unicode/norm/trie.go create mode 100644 go/vendor/golang.org/x/text/unicode/norm/triegen.go create mode 100644 go/vendor/golang.org/x/text/unicode/rangetable/gen.go create mode 100644 go/vendor/golang.org/x/text/unicode/rangetable/merge.go create mode 100644 go/vendor/golang.org/x/text/unicode/rangetable/rangetable.go create mode 100644 go/vendor/golang.org/x/text/unicode/rangetable/tables10.0.0.go create mode 100644 go/vendor/golang.org/x/text/unicode/rangetable/tables9.0.0.go create mode 100644 go/vendor/golang.org/x/text/width/gen.go create mode 100644 go/vendor/golang.org/x/text/width/gen_common.go create mode 100644 go/vendor/golang.org/x/text/width/gen_trieval.go create mode 100644 go/vendor/golang.org/x/text/width/kind_string.go create mode 100644 go/vendor/golang.org/x/text/width/tables10.0.0.go create mode 100644 go/vendor/golang.org/x/text/width/tables9.0.0.go create mode 100644 go/vendor/golang.org/x/text/width/transform.go create mode 100644 go/vendor/golang.org/x/text/width/trieval.go create mode 100644 go/vendor/golang.org/x/text/width/width.go create mode 100644 go/vendor/google.golang.org/genproto/LICENSE create mode 100644 go/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go create mode 100644 go/vendor/google.golang.org/grpc/.travis.yml create mode 100644 go/vendor/google.golang.org/grpc/AUTHORS create mode 100644 go/vendor/google.golang.org/grpc/CONTRIBUTING.md create mode 100644 go/vendor/google.golang.org/grpc/LICENSE create mode 100644 go/vendor/google.golang.org/grpc/Makefile create mode 100644 go/vendor/google.golang.org/grpc/README.md create mode 100644 go/vendor/google.golang.org/grpc/backoff.go create mode 100644 go/vendor/google.golang.org/grpc/balancer.go create mode 100644 go/vendor/google.golang.org/grpc/balancer/balancer.go create mode 100644 go/vendor/google.golang.org/grpc/balancer/base/balancer.go create mode 100644 go/vendor/google.golang.org/grpc/balancer/base/base.go create mode 100644 go/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go create mode 100644 go/vendor/google.golang.org/grpc/balancer_conn_wrappers.go create mode 100644 go/vendor/google.golang.org/grpc/balancer_v1_wrapper.go create mode 100644 go/vendor/google.golang.org/grpc/call.go create mode 100644 go/vendor/google.golang.org/grpc/clientconn.go create mode 100644 go/vendor/google.golang.org/grpc/codec.go create mode 100755 go/vendor/google.golang.org/grpc/codegen.sh create mode 100644 go/vendor/google.golang.org/grpc/codes/code_string.go create mode 100644 go/vendor/google.golang.org/grpc/codes/codes.go create mode 100644 go/vendor/google.golang.org/grpc/connectivity/connectivity.go create mode 100644 go/vendor/google.golang.org/grpc/credentials/credentials.go create mode 100644 go/vendor/google.golang.org/grpc/credentials/go16.go create mode 100644 go/vendor/google.golang.org/grpc/credentials/go17.go create mode 100644 go/vendor/google.golang.org/grpc/credentials/go18.go create mode 100644 go/vendor/google.golang.org/grpc/credentials/go19.go create mode 100644 go/vendor/google.golang.org/grpc/dialoptions.go create mode 100644 go/vendor/google.golang.org/grpc/doc.go create mode 100644 go/vendor/google.golang.org/grpc/encoding/encoding.go create mode 100644 go/vendor/google.golang.org/grpc/encoding/proto/proto.go create mode 100644 go/vendor/google.golang.org/grpc/go.mod create mode 100644 go/vendor/google.golang.org/grpc/go.sum create mode 100644 go/vendor/google.golang.org/grpc/go16.go create mode 100644 go/vendor/google.golang.org/grpc/go17.go create mode 100644 go/vendor/google.golang.org/grpc/grpclog/grpclog.go create mode 100644 go/vendor/google.golang.org/grpc/grpclog/logger.go create mode 100644 go/vendor/google.golang.org/grpc/grpclog/loggerv2.go create mode 100755 go/vendor/google.golang.org/grpc/install_gae.sh create mode 100644 go/vendor/google.golang.org/grpc/interceptor.go create mode 100644 go/vendor/google.golang.org/grpc/internal/backoff/backoff.go create mode 100644 go/vendor/google.golang.org/grpc/internal/channelz/funcs.go create mode 100644 go/vendor/google.golang.org/grpc/internal/channelz/types.go create mode 100644 go/vendor/google.golang.org/grpc/internal/channelz/types_linux.go create mode 100644 go/vendor/google.golang.org/grpc/internal/channelz/types_nonlinux.go create mode 100644 go/vendor/google.golang.org/grpc/internal/channelz/util_linux_go19.go create mode 100644 go/vendor/google.golang.org/grpc/internal/channelz/util_nonlinux_pre_go19.go create mode 100644 go/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go create mode 100644 go/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go create mode 100644 go/vendor/google.golang.org/grpc/internal/internal.go create mode 100644 go/vendor/google.golang.org/grpc/internal/transport/bdp_estimator.go create mode 100644 go/vendor/google.golang.org/grpc/internal/transport/controlbuf.go create mode 100644 go/vendor/google.golang.org/grpc/internal/transport/defaults.go create mode 100644 go/vendor/google.golang.org/grpc/internal/transport/flowcontrol.go create mode 100644 go/vendor/google.golang.org/grpc/internal/transport/go16.go create mode 100644 go/vendor/google.golang.org/grpc/internal/transport/go17.go create mode 100644 go/vendor/google.golang.org/grpc/internal/transport/handler_server.go create mode 100644 go/vendor/google.golang.org/grpc/internal/transport/http2_client.go create mode 100644 go/vendor/google.golang.org/grpc/internal/transport/http2_server.go create mode 100644 go/vendor/google.golang.org/grpc/internal/transport/http_util.go create mode 100644 go/vendor/google.golang.org/grpc/internal/transport/log.go create mode 100644 go/vendor/google.golang.org/grpc/internal/transport/transport.go create mode 100644 go/vendor/google.golang.org/grpc/keepalive/keepalive.go create mode 100644 go/vendor/google.golang.org/grpc/metadata/metadata.go create mode 100644 go/vendor/google.golang.org/grpc/naming/dns_resolver.go create mode 100644 go/vendor/google.golang.org/grpc/naming/go17.go create mode 100644 go/vendor/google.golang.org/grpc/naming/go18.go create mode 100644 go/vendor/google.golang.org/grpc/naming/naming.go create mode 100644 go/vendor/google.golang.org/grpc/peer/peer.go create mode 100644 go/vendor/google.golang.org/grpc/picker_wrapper.go create mode 100644 go/vendor/google.golang.org/grpc/pickfirst.go create mode 100644 go/vendor/google.golang.org/grpc/proxy.go create mode 100644 go/vendor/google.golang.org/grpc/reflection/README.md create mode 100644 go/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.pb.go create mode 100644 go/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.proto create mode 100644 go/vendor/google.golang.org/grpc/reflection/serverreflection.go create mode 100644 go/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go create mode 100644 go/vendor/google.golang.org/grpc/resolver/dns/go19.go create mode 100644 go/vendor/google.golang.org/grpc/resolver/dns/pre_go19.go create mode 100644 go/vendor/google.golang.org/grpc/resolver/passthrough/passthrough.go create mode 100644 go/vendor/google.golang.org/grpc/resolver/resolver.go create mode 100644 go/vendor/google.golang.org/grpc/resolver_conn_wrapper.go create mode 100644 go/vendor/google.golang.org/grpc/rpc_util.go create mode 100644 go/vendor/google.golang.org/grpc/server.go create mode 100644 go/vendor/google.golang.org/grpc/service_config.go create mode 100644 go/vendor/google.golang.org/grpc/stats/handlers.go create mode 100644 go/vendor/google.golang.org/grpc/stats/stats.go create mode 100644 go/vendor/google.golang.org/grpc/status/go16.go create mode 100644 go/vendor/google.golang.org/grpc/status/go17.go create mode 100644 go/vendor/google.golang.org/grpc/status/status.go create mode 100644 go/vendor/google.golang.org/grpc/stream.go create mode 100644 go/vendor/google.golang.org/grpc/tap/tap.go create mode 100644 go/vendor/google.golang.org/grpc/trace.go create mode 100644 go/vendor/google.golang.org/grpc/version.go create mode 100755 go/vendor/google.golang.org/grpc/vet.sh create mode 100644 go/vendor/gopkg.in/yaml.v2/.travis.yml create mode 100644 go/vendor/gopkg.in/yaml.v2/LICENSE create mode 100644 go/vendor/gopkg.in/yaml.v2/LICENSE.libyaml create mode 100644 go/vendor/gopkg.in/yaml.v2/NOTICE create mode 100644 go/vendor/gopkg.in/yaml.v2/README.md create mode 100644 go/vendor/gopkg.in/yaml.v2/apic.go create mode 100644 go/vendor/gopkg.in/yaml.v2/decode.go create mode 100644 go/vendor/gopkg.in/yaml.v2/emitterc.go create mode 100644 go/vendor/gopkg.in/yaml.v2/encode.go create mode 100644 go/vendor/gopkg.in/yaml.v2/go.mod create mode 100644 go/vendor/gopkg.in/yaml.v2/parserc.go create mode 100644 go/vendor/gopkg.in/yaml.v2/readerc.go create mode 100644 go/vendor/gopkg.in/yaml.v2/resolve.go create mode 100644 go/vendor/gopkg.in/yaml.v2/scannerc.go create mode 100644 go/vendor/gopkg.in/yaml.v2/sorter.go create mode 100644 go/vendor/gopkg.in/yaml.v2/writerc.go create mode 100644 go/vendor/gopkg.in/yaml.v2/yaml.go create mode 100644 go/vendor/gopkg.in/yaml.v2/yamlh.go create mode 100644 go/vendor/gopkg.in/yaml.v2/yamlprivateh.go create mode 100644 go/vendor/vbom.ml/util/LICENSE create mode 100644 go/vendor/vbom.ml/util/sortorder/README.md create mode 100644 go/vendor/vbom.ml/util/sortorder/doc.go create mode 100644 go/vendor/vbom.ml/util/sortorder/natsort.go diff --git a/go/Gopkg.lock b/go/Gopkg.lock new file mode 100644 index 0000000..175a8dd --- /dev/null +++ b/go/Gopkg.lock @@ -0,0 +1,409 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + digest = "1:d1665c44bd5db19aaee18d1b6233c99b0b9a986e8bccb24ef54747547a48027f" + name = "github.com/PuerkitoBio/purell" + packages = ["."] + pruneopts = "UT" + revision = "0bcb03f4b4d0a9428594752bd2a3b9aa0a9d4bd4" + version = "v1.1.0" + +[[projects]] + branch = "master" + digest = "1:c739832d67eb1e9cc478a19cc1a1ccd78df0397bf8a32978b759152e205f644b" + name = "github.com/PuerkitoBio/urlesc" + packages = ["."] + pruneopts = "UT" + revision = "de5bf2ad457846296e2031421a34e2568e304e35" + +[[projects]] + digest = "1:e92f5581902c345eb4ceffdcd4a854fb8f73cf436d47d837d1ec98ef1fe0a214" + name = "github.com/StackExchange/wmi" + packages = ["."] + pruneopts = "UT" + revision = "5d049714c4a64225c3c79a7cf7d02f7fb5b96338" + version = "1.0.0" + +[[projects]] + digest = "1:320e7ead93de9fd2b0e59b50fd92a4d50c1f8ab455d96bc2eb083267453a9709" + name = "github.com/asaskevich/govalidator" + packages = ["."] + pruneopts = "UT" + revision = "ccb8e960c48f04d6935e72476ae4a51028f9e22f" + version = "v9" + +[[projects]] + digest = "1:2209584c0f7c9b68c23374e659357ab546e1b70eec2761f03280f69a8fd23d77" + name = "github.com/cenkalti/backoff" + packages = ["."] + pruneopts = "UT" + revision = "2ea60e5f094469f9e65adb9cd103795b73ae743e" + version = "v2.0.0" + +[[projects]] + branch = "master" + digest = "1:08aeb20c1d146f9254126139f272865927b6db288145f88f0a3baacc24ddfa24" + name = "github.com/digitalocean/go-netbox" + packages = [ + "netbox", + "netbox/client", + "netbox/client/circuits", + "netbox/client/dcim", + "netbox/client/extras", + "netbox/client/ipam", + "netbox/client/secrets", + "netbox/client/tenancy", + "netbox/client/virtualization", + "netbox/models", + ] + pruneopts = "UT" + revision = "29433ec527e78486ea0a5758817ab672d977f90e" + +[[projects]] + branch = "master" + digest = "1:7fb51688eadf38272411852d7a2b3538c7caff53309abee6c0964a83c00fe69e" + name = "github.com/globalsign/mgo" + packages = [ + "bson", + "internal/json", + ] + pruneopts = "UT" + revision = "eeefdecb41b842af6dc652aaea4026e8403e62df" + +[[projects]] + digest = "1:64a5a67c69b70c2420e607a8545d674a23778ed9c3e80607bfd17b77c6c87f6a" + name = "github.com/go-ole/go-ole" + packages = [ + ".", + "oleutil", + ] + pruneopts = "UT" + revision = "a41e3c4b706f6ae8dfbff342b06e40fa4d2d0506" + version = "v1.2.1" + +[[projects]] + digest = "1:c49164b7b1e34324258ae61deef2cba7912005ba9cb7a9ee4930fe6bdfec7b5d" + name = "github.com/go-openapi/analysis" + packages = [ + ".", + "internal", + ] + pruneopts = "UT" + revision = "c701774f4e604d952e4e8c56dee260be696e33c3" + version = "v0.17.2" + +[[projects]] + digest = "1:ac4b35a4bba11edb2110fca0707bae03ae92fbd8222e6b483465d98efaabfb97" + name = "github.com/go-openapi/errors" + packages = ["."] + pruneopts = "UT" + revision = "d9664f9fab8994271e573ed69cf2adfc09b7a800" + version = "v0.17.2" + +[[projects]] + digest = "1:953a2628e4c5c72856b53f5470ed5e071c55eccf943d798d42908102af2a610f" + name = "github.com/go-openapi/jsonpointer" + packages = ["."] + pruneopts = "UT" + revision = "ef5f0afec364d3b9396b7b77b43dbe26bf1f8004" + version = "v0.17.2" + +[[projects]] + digest = "1:81210e0af657a0fb3638932ec68e645236bceefa4c839823db0c4d918f080895" + name = "github.com/go-openapi/jsonreference" + packages = ["."] + pruneopts = "UT" + revision = "8483a886a90412cd6858df4ea3483dce9c8e35a3" + version = "v0.17.2" + +[[projects]] + digest = "1:a20e8bf0e58e2010677432ffbe5533c1e83bdf368ba5b057f3e00e2071ca8b09" + name = "github.com/go-openapi/loads" + packages = ["."] + pruneopts = "UT" + revision = "150d36912387ec2f607be674c5be309ddccc0eed" + version = "v0.17.2" + +[[projects]] + digest = "1:cc4f0df1c69dd1928f4dc32ab31a637fcfa4b04b09c78af965d67980cfbfc486" + name = "github.com/go-openapi/runtime" + packages = [ + ".", + "client", + "logger", + "middleware", + "middleware/denco", + "middleware/header", + "middleware/untyped", + "security", + ] + pruneopts = "UT" + revision = "231d7876b7019dbcbfc97a7ba764379497b67c1d" + version = "v0.17.2" + +[[projects]] + digest = "1:394fed5c0425fe01da3a34078adaa1682e4deaea6e5d232dde25c4034004c151" + name = "github.com/go-openapi/spec" + packages = ["."] + pruneopts = "UT" + revision = "5bae59e25b21498baea7f9d46e9c147ec106a42e" + version = "v0.17.2" + +[[projects]] + digest = "1:ffa79f4705a3a85f2412d2d163c37acdf60d128c679e641c323a5de712e23d27" + name = "github.com/go-openapi/strfmt" + packages = ["."] + pruneopts = "UT" + revision = "edab9990ffc9b4a428f3306ecf4d18a069ca3317" + version = "v0.17.2" + +[[projects]] + digest = "1:32f3d2e7f343de7263c550d696fb8a64d3c49d8df16b1ddfc8e80e1e4b3233ce" + name = "github.com/go-openapi/swag" + packages = ["."] + pruneopts = "UT" + revision = "5899d5c5e619fda5fa86e14795a835f473ca284c" + version = "v0.17.2" + +[[projects]] + digest = "1:58541fddf3f4ec485710f1b346e7f647baf09a878a604e47e3668c600fe44076" + name = "github.com/go-openapi/validate" + packages = ["."] + pruneopts = "UT" + revision = "d2eab7d93009e9215fc85b2faa2c2f2a98c2af48" + version = "v0.17.2" + +[[projects]] + digest = "1:c8ad4ba32ae8b71ef2bf5e1bad402aeb99ce77a1240f9b684db8b1ff5353e7ab" + name = "github.com/gobuffalo/packr" + packages = ["."] + pruneopts = "UT" + revision = "5a2cbb54c4e7d482e3f518c56f1f86f133d5204f" + version = "v1.13.7" + +[[projects]] + branch = "master" + digest = "1:1ba1d79f2810270045c328ae5d674321db34e3aae468eb4233883b473c5c0467" + name = "github.com/golang/glog" + packages = ["."] + pruneopts = "UT" + revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998" + +[[projects]] + digest = "1:5d1b5a25486fc7d4e133646d834f6fca7ba1cef9903d40e7aa786c41b89e9e91" + name = "github.com/golang/protobuf" + packages = [ + "proto", + "protoc-gen-go/descriptor", + "ptypes", + "ptypes/any", + "ptypes/duration", + "ptypes/timestamp", + ] + pruneopts = "UT" + revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5" + version = "v1.2.0" + +[[projects]] + branch = "master" + digest = "1:84a5a2b67486d5d67060ac393aa255d05d24ed5ee41daecd5635ec22657b6492" + name = "github.com/mailru/easyjson" + packages = [ + "buffer", + "jlexer", + "jwriter", + ] + pruneopts = "UT" + revision = "60711f1a8329503b04e1c88535f419d0bb440bff" + +[[projects]] + digest = "1:53bc4cd4914cd7cd52139990d5170d6dc99067ae31c56530621b18b35fc30318" + name = "github.com/mitchellh/mapstructure" + packages = ["."] + pruneopts = "UT" + revision = "3536a929edddb9a5b34bd6861dc4a9647cb459fe" + version = "v1.1.2" + +[[projects]] + digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747" + name = "github.com/pkg/errors" + packages = ["."] + pruneopts = "UT" + revision = "645ef00459ed84a119197bfb8d8205042c6df63d" + version = "v0.8.0" + +[[projects]] + branch = "master" + digest = "1:a7cc4447e0c2432f217fd2bed937c100ec475272a7a9306477170c2934297357" + name = "github.com/q3k/statusz" + packages = ["."] + pruneopts = "UT" + revision = "924f04ea71149b75f5b10f426cc4c39d6d90f6f2" + +[[projects]] + branch = "master" + digest = "1:8f042d4b4c48d38d7a1201096299bd26d044c97c032ab20ee171fe5b0d201d2e" + name = "github.com/shirou/gopsutil" + packages = [ + "internal/common", + "load", + ] + pruneopts = "UT" + revision = "3ec50d2876a36047b2ca39f955ba88fb7a455e92" + +[[projects]] + digest = "1:564b31f09a21367ada5b019d8413afe99cf770775606f94c7bef42b2ef79dfdf" + name = "github.com/ybbus/jsonrpc" + packages = ["."] + pruneopts = "UT" + revision = "dd866631e904a5df2067d934985c5def68f391ac" + version = "v2.1.2" + +[[projects]] + branch = "master" + digest = "1:fb9be9f54a48793b8e2b0939373b52272b8cf0699d024a062df8596a77371524" + name = "github.com/ziutek/telnet" + packages = ["."] + pruneopts = "UT" + revision = "c3b780dc415b28894076b4ec975ea3ea69e3980f" + +[[projects]] + branch = "master" + digest = "1:505dbee0833715a72a529bb57c354826ad42a4496fad787fa143699b4de1a6d0" + name = "golang.org/x/net" + packages = [ + "context", + "http/httpguts", + "http2", + "http2/hpack", + "idna", + "internal/timeseries", + "trace", + ] + pruneopts = "UT" + revision = "9b4f9f5ad5197c79fd623a3638e70d8b26cef344" + +[[projects]] + branch = "master" + digest = "1:6c93c46c00889c28f5a105e7cb5ba56672fd4a2351375fa819acb44e66d427df" + name = "golang.org/x/sys" + packages = [ + "unix", + "windows", + ] + pruneopts = "UT" + revision = "d989b31c87461dc8ab2f1cac6792814e27fadea9" + +[[projects]] + digest = "1:0c56024909189aee3364b7f21a95a27459f718aa7c199a5c111c36cfffd9eaef" + name = "golang.org/x/text" + packages = [ + "collate", + "collate/build", + "internal/colltab", + "internal/gen", + "internal/tag", + "internal/triegen", + "internal/ucd", + "language", + "secure/bidirule", + "transform", + "unicode/bidi", + "unicode/cldr", + "unicode/norm", + "unicode/rangetable", + "width", + ] + pruneopts = "UT" + revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" + version = "v0.3.0" + +[[projects]] + branch = "master" + digest = "1:56b0bca90b7e5d1facf5fbdacba23e4e0ce069d25381b8e2f70ef1e7ebfb9c1a" + name = "google.golang.org/genproto" + packages = ["googleapis/rpc/status"] + pruneopts = "UT" + revision = "94acd270e44e65579b9ee3cdab25034d33fed608" + +[[projects]] + digest = "1:e72ebff67b73d31785959af0660215213c58ab50d7b7d61aac0f1a6834c07e8c" + name = "google.golang.org/grpc" + packages = [ + ".", + "balancer", + "balancer/base", + "balancer/roundrobin", + "codes", + "connectivity", + "credentials", + "encoding", + "encoding/proto", + "grpclog", + "internal", + "internal/backoff", + "internal/channelz", + "internal/envconfig", + "internal/grpcrand", + "internal/transport", + "keepalive", + "metadata", + "naming", + "peer", + "reflection", + "reflection/grpc_reflection_v1alpha", + "resolver", + "resolver/dns", + "resolver/passthrough", + "stats", + "status", + "tap", + ] + pruneopts = "UT" + revision = "2e463a05d100327ca47ac218281906921038fd95" + version = "v1.16.0" + +[[projects]] + digest = "1:342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202" + name = "gopkg.in/yaml.v2" + packages = ["."] + pruneopts = "UT" + revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" + version = "v2.2.1" + +[[projects]] + branch = "master" + digest = "1:9132eacc44d9bd1e03145ea2e9d4888800da7773d6edebb401f8cd34c9fb8380" + name = "vbom.ml/util" + packages = ["sortorder"] + pruneopts = "UT" + revision = "efcd4e0f97874370259c7d93e12aad57911dea81" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + input-imports = [ + "github.com/cenkalti/backoff", + "github.com/digitalocean/go-netbox/netbox", + "github.com/digitalocean/go-netbox/netbox/client", + "github.com/digitalocean/go-netbox/netbox/client/dcim", + "github.com/digitalocean/go-netbox/netbox/models", + "github.com/gobuffalo/packr", + "github.com/golang/glog", + "github.com/golang/protobuf/proto", + "github.com/q3k/statusz", + "github.com/ybbus/jsonrpc", + "github.com/ziutek/telnet", + "golang.org/x/net/context", + "golang.org/x/net/trace", + "google.golang.org/grpc", + "google.golang.org/grpc/codes", + "google.golang.org/grpc/credentials", + "google.golang.org/grpc/peer", + "google.golang.org/grpc/reflection", + "google.golang.org/grpc/status", + "vbom.ml/util/sortorder", + ] + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/go/Gopkg.toml b/go/Gopkg.toml new file mode 100644 index 0000000..150d321 --- /dev/null +++ b/go/Gopkg.toml @@ -0,0 +1,74 @@ +# Gopkg.toml example +# +# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" +# +# [prune] +# non-go = false +# go-tests = true +# unused-packages = true + + +[[constraint]] + name = "github.com/cenkalti/backoff" + version = "2.0.0" + +[[constraint]] + branch = "master" + name = "github.com/digitalocean/go-netbox" + +[[constraint]] + name = "github.com/gobuffalo/packr" + version = "1.13.7" + +[[constraint]] + branch = "master" + name = "github.com/golang/glog" + +[[constraint]] + name = "github.com/golang/protobuf" + version = "1.2.0" + +[[constraint]] + branch = "master" + name = "github.com/q3k/statusz" + +[[constraint]] + name = "github.com/ybbus/jsonrpc" + version = "2.1.2" + +[[constraint]] + branch = "master" + name = "github.com/ziutek/telnet" + +[[constraint]] + branch = "master" + name = "golang.org/x/net" + +[[constraint]] + name = "google.golang.org/grpc" + version = "1.16.0" + +[[constraint]] + branch = "master" + name = "vbom.ml/util" + +[prune] + go-tests = true + unused-packages = true diff --git a/go/vendor/github.com/PuerkitoBio/purell/.gitignore b/go/vendor/github.com/PuerkitoBio/purell/.gitignore new file mode 100644 index 0000000..748e4c8 --- /dev/null +++ b/go/vendor/github.com/PuerkitoBio/purell/.gitignore @@ -0,0 +1,5 @@ +*.sublime-* +.DS_Store +*.swp +*.swo +tags diff --git a/go/vendor/github.com/PuerkitoBio/purell/.travis.yml b/go/vendor/github.com/PuerkitoBio/purell/.travis.yml new file mode 100644 index 0000000..facfc91 --- /dev/null +++ b/go/vendor/github.com/PuerkitoBio/purell/.travis.yml @@ -0,0 +1,7 @@ +language: go + +go: + - 1.4 + - 1.5 + - 1.6 + - tip diff --git a/go/vendor/github.com/PuerkitoBio/purell/LICENSE b/go/vendor/github.com/PuerkitoBio/purell/LICENSE new file mode 100644 index 0000000..4b9986d --- /dev/null +++ b/go/vendor/github.com/PuerkitoBio/purell/LICENSE @@ -0,0 +1,12 @@ +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/go/vendor/github.com/PuerkitoBio/purell/README.md b/go/vendor/github.com/PuerkitoBio/purell/README.md new file mode 100644 index 0000000..09e8a32 --- /dev/null +++ b/go/vendor/github.com/PuerkitoBio/purell/README.md @@ -0,0 +1,187 @@ +# 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://secure.travis-ci.org/PuerkitoBio/purell.png)](http://travis-ci.org/PuerkitoBio/purell) + +## Install + +`go get github.com/PuerkitoBio/purell` + +## Changelog + +* **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/go/vendor/github.com/PuerkitoBio/purell/purell.go b/go/vendor/github.com/PuerkitoBio/purell/purell.go new file mode 100644 index 0000000..645e1b7 --- /dev/null +++ b/go/vendor/github.com/PuerkitoBio/purell/purell.go @@ -0,0 +1,379 @@ +/* +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/go/vendor/github.com/PuerkitoBio/urlesc/.travis.yml b/go/vendor/github.com/PuerkitoBio/urlesc/.travis.yml new file mode 100644 index 0000000..ba6b225 --- /dev/null +++ b/go/vendor/github.com/PuerkitoBio/urlesc/.travis.yml @@ -0,0 +1,15 @@ +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/go/vendor/github.com/PuerkitoBio/urlesc/LICENSE b/go/vendor/github.com/PuerkitoBio/urlesc/LICENSE new file mode 100644 index 0000000..7448756 --- /dev/null +++ b/go/vendor/github.com/PuerkitoBio/urlesc/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2012 The Go 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. + * 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 +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/go/vendor/github.com/PuerkitoBio/urlesc/README.md b/go/vendor/github.com/PuerkitoBio/urlesc/README.md new file mode 100644 index 0000000..57aff0a --- /dev/null +++ b/go/vendor/github.com/PuerkitoBio/urlesc/README.md @@ -0,0 +1,16 @@ +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/go/vendor/github.com/PuerkitoBio/urlesc/urlesc.go b/go/vendor/github.com/PuerkitoBio/urlesc/urlesc.go new file mode 100644 index 0000000..1b84624 --- /dev/null +++ b/go/vendor/github.com/PuerkitoBio/urlesc/urlesc.go @@ -0,0 +1,180 @@ +// 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/go/vendor/github.com/StackExchange/wmi/LICENSE b/go/vendor/github.com/StackExchange/wmi/LICENSE new file mode 100644 index 0000000..ae80b67 --- /dev/null +++ b/go/vendor/github.com/StackExchange/wmi/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013 Stack Exchange + +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. diff --git a/go/vendor/github.com/StackExchange/wmi/README.md b/go/vendor/github.com/StackExchange/wmi/README.md new file mode 100644 index 0000000..426d1a4 --- /dev/null +++ b/go/vendor/github.com/StackExchange/wmi/README.md @@ -0,0 +1,6 @@ +wmi +=== + +Package wmi provides a WQL interface to Windows WMI. + +Note: It interfaces with WMI on the local machine, therefore it only runs on Windows. diff --git a/go/vendor/github.com/StackExchange/wmi/swbemservices.go b/go/vendor/github.com/StackExchange/wmi/swbemservices.go new file mode 100644 index 0000000..9765a53 --- /dev/null +++ b/go/vendor/github.com/StackExchange/wmi/swbemservices.go @@ -0,0 +1,260 @@ +// +build windows + +package wmi + +import ( + "fmt" + "reflect" + "runtime" + "sync" + + "github.com/go-ole/go-ole" + "github.com/go-ole/go-ole/oleutil" +) + +// SWbemServices is used to access wmi. See https://msdn.microsoft.com/en-us/library/aa393719(v=vs.85).aspx +type SWbemServices struct { + //TODO: track namespace. Not sure if we can re connect to a different namespace using the same instance + cWMIClient *Client //This could also be an embedded struct, but then we would need to branch on Client vs SWbemServices in the Query method + sWbemLocatorIUnknown *ole.IUnknown + sWbemLocatorIDispatch *ole.IDispatch + queries chan *queryRequest + closeError chan error + lQueryorClose sync.Mutex +} + +type queryRequest struct { + query string + dst interface{} + args []interface{} + finished chan error +} + +// InitializeSWbemServices will return a new SWbemServices object that can be used to query WMI +func InitializeSWbemServices(c *Client, connectServerArgs ...interface{}) (*SWbemServices, error) { + //fmt.Println("InitializeSWbemServices: Starting") + //TODO: implement connectServerArgs as optional argument for init with connectServer call + s := new(SWbemServices) + s.cWMIClient = c + s.queries = make(chan *queryRequest) + initError := make(chan error) + go s.process(initError) + + err, ok := <-initError + if ok { + return nil, err //Send error to caller + } + //fmt.Println("InitializeSWbemServices: Finished") + return s, nil +} + +// Close will clear and release all of the SWbemServices resources +func (s *SWbemServices) Close() error { + s.lQueryorClose.Lock() + if s == nil || s.sWbemLocatorIDispatch == nil { + s.lQueryorClose.Unlock() + return fmt.Errorf("SWbemServices is not Initialized") + } + if s.queries == nil { + s.lQueryorClose.Unlock() + return fmt.Errorf("SWbemServices has been closed") + } + //fmt.Println("Close: sending close request") + var result error + ce := make(chan error) + s.closeError = ce //Race condition if multiple callers to close. May need to lock here + close(s.queries) //Tell background to shut things down + s.lQueryorClose.Unlock() + err, ok := <-ce + if ok { + result = err + } + //fmt.Println("Close: finished") + return result +} + +func (s *SWbemServices) process(initError chan error) { + //fmt.Println("process: starting background thread initialization") + //All OLE/WMI calls must happen on the same initialized thead, so lock this goroutine + runtime.LockOSThread() + defer runtime.LockOSThread() + + err := ole.CoInitializeEx(0, ole.COINIT_MULTITHREADED) + if err != nil { + oleCode := err.(*ole.OleError).Code() + if oleCode != ole.S_OK && oleCode != S_FALSE { + initError <- fmt.Errorf("ole.CoInitializeEx error: %v", err) + return + } + } + defer ole.CoUninitialize() + + unknown, err := oleutil.CreateObject("WbemScripting.SWbemLocator") + if err != nil { + initError <- fmt.Errorf("CreateObject SWbemLocator error: %v", err) + return + } else if unknown == nil { + initError <- ErrNilCreateObject + return + } + defer unknown.Release() + s.sWbemLocatorIUnknown = unknown + + dispatch, err := s.sWbemLocatorIUnknown.QueryInterface(ole.IID_IDispatch) + if err != nil { + initError <- fmt.Errorf("SWbemLocator QueryInterface error: %v", err) + return + } + defer dispatch.Release() + s.sWbemLocatorIDispatch = dispatch + + // we can't do the ConnectServer call outside the loop unless we find a way to track and re-init the connectServerArgs + //fmt.Println("process: initialized. closing initError") + close(initError) + //fmt.Println("process: waiting for queries") + for q := range s.queries { + //fmt.Printf("process: new query: len(query)=%d\n", len(q.query)) + errQuery := s.queryBackground(q) + //fmt.Println("process: s.queryBackground finished") + if errQuery != nil { + q.finished <- errQuery + } + close(q.finished) + } + //fmt.Println("process: queries channel closed") + s.queries = nil //set channel to nil so we know it is closed + //TODO: I think the Release/Clear calls can panic if things are in a bad state. + //TODO: May need to recover from panics and send error to method caller instead. + close(s.closeError) +} + +// Query runs the WQL query using a SWbemServices instance and appends the values to dst. +// +// dst must have type *[]S or *[]*S, for some struct type S. Fields selected in +// the query must have the same name in dst. Supported types are all signed and +// unsigned integers, time.Time, string, bool, or a pointer to one of those. +// Array types are not supported. +// +// By default, the local machine and default namespace are used. These can be +// changed using connectServerArgs. See +// http://msdn.microsoft.com/en-us/library/aa393720.aspx for details. +func (s *SWbemServices) Query(query string, dst interface{}, connectServerArgs ...interface{}) error { + s.lQueryorClose.Lock() + if s == nil || s.sWbemLocatorIDispatch == nil { + s.lQueryorClose.Unlock() + return fmt.Errorf("SWbemServices is not Initialized") + } + if s.queries == nil { + s.lQueryorClose.Unlock() + return fmt.Errorf("SWbemServices has been closed") + } + + //fmt.Println("Query: Sending query request") + qr := queryRequest{ + query: query, + dst: dst, + args: connectServerArgs, + finished: make(chan error), + } + s.queries <- &qr + s.lQueryorClose.Unlock() + err, ok := <-qr.finished + if ok { + //fmt.Println("Query: Finished with error") + return err //Send error to caller + } + //fmt.Println("Query: Finished") + return nil +} + +func (s *SWbemServices) queryBackground(q *queryRequest) error { + if s == nil || s.sWbemLocatorIDispatch == nil { + return fmt.Errorf("SWbemServices is not Initialized") + } + wmi := s.sWbemLocatorIDispatch //Should just rename in the code, but this will help as we break things apart + //fmt.Println("queryBackground: Starting") + + dv := reflect.ValueOf(q.dst) + if dv.Kind() != reflect.Ptr || dv.IsNil() { + return ErrInvalidEntityType + } + dv = dv.Elem() + mat, elemType := checkMultiArg(dv) + if mat == multiArgTypeInvalid { + return ErrInvalidEntityType + } + + // service is a SWbemServices + serviceRaw, err := oleutil.CallMethod(wmi, "ConnectServer", q.args...) + if err != nil { + return err + } + service := serviceRaw.ToIDispatch() + defer serviceRaw.Clear() + + // result is a SWBemObjectSet + resultRaw, err := oleutil.CallMethod(service, "ExecQuery", q.query) + if err != nil { + return err + } + result := resultRaw.ToIDispatch() + defer resultRaw.Clear() + + count, err := oleInt64(result, "Count") + if err != nil { + return err + } + + enumProperty, err := result.GetProperty("_NewEnum") + if err != nil { + return err + } + defer enumProperty.Clear() + + enum, err := enumProperty.ToIUnknown().IEnumVARIANT(ole.IID_IEnumVariant) + if err != nil { + return err + } + if enum == nil { + return fmt.Errorf("can't get IEnumVARIANT, enum is nil") + } + defer enum.Release() + + // Initialize a slice with Count capacity + dv.Set(reflect.MakeSlice(dv.Type(), 0, int(count))) + + var errFieldMismatch error + for itemRaw, length, err := enum.Next(1); length > 0; itemRaw, length, err = enum.Next(1) { + if err != nil { + return err + } + + err := func() error { + // item is a SWbemObject, but really a Win32_Process + item := itemRaw.ToIDispatch() + defer item.Release() + + ev := reflect.New(elemType) + if err = s.cWMIClient.loadEntity(ev.Interface(), item); err != nil { + if _, ok := err.(*ErrFieldMismatch); ok { + // We continue loading entities even in the face of field mismatch errors. + // If we encounter any other error, that other error is returned. Otherwise, + // an ErrFieldMismatch is returned. + errFieldMismatch = err + } else { + return err + } + } + if mat != multiArgTypeStructPtr { + ev = ev.Elem() + } + dv.Set(reflect.Append(dv, ev)) + return nil + }() + if err != nil { + return err + } + } + //fmt.Println("queryBackground: Finished") + return errFieldMismatch +} diff --git a/go/vendor/github.com/StackExchange/wmi/wmi.go b/go/vendor/github.com/StackExchange/wmi/wmi.go new file mode 100644 index 0000000..a951b12 --- /dev/null +++ b/go/vendor/github.com/StackExchange/wmi/wmi.go @@ -0,0 +1,486 @@ +// +build windows + +/* +Package wmi provides a WQL interface for WMI on Windows. + +Example code to print names of running processes: + + type Win32_Process struct { + Name string + } + + func main() { + var dst []Win32_Process + q := wmi.CreateQuery(&dst, "") + err := wmi.Query(q, &dst) + if err != nil { + log.Fatal(err) + } + for i, v := range dst { + println(i, v.Name) + } + } + +*/ +package wmi + +import ( + "bytes" + "errors" + "fmt" + "log" + "os" + "reflect" + "runtime" + "strconv" + "strings" + "sync" + "time" + + "github.com/go-ole/go-ole" + "github.com/go-ole/go-ole/oleutil" +) + +var l = log.New(os.Stdout, "", log.LstdFlags) + +var ( + ErrInvalidEntityType = errors.New("wmi: invalid entity type") + // ErrNilCreateObject is the error returned if CreateObject returns nil even + // if the error was nil. + ErrNilCreateObject = errors.New("wmi: create object returned nil") + lock sync.Mutex +) + +// S_FALSE is returned by CoInitializeEx if it was already called on this thread. +const S_FALSE = 0x00000001 + +// QueryNamespace invokes Query with the given namespace on the local machine. +func QueryNamespace(query string, dst interface{}, namespace string) error { + return Query(query, dst, nil, namespace) +} + +// Query runs the WQL query and appends the values to dst. +// +// dst must have type *[]S or *[]*S, for some struct type S. Fields selected in +// the query must have the same name in dst. Supported types are all signed and +// unsigned integers, time.Time, string, bool, or a pointer to one of those. +// Array types are not supported. +// +// By default, the local machine and default namespace are used. These can be +// changed using connectServerArgs. See +// http://msdn.microsoft.com/en-us/library/aa393720.aspx for details. +// +// Query is a wrapper around DefaultClient.Query. +func Query(query string, dst interface{}, connectServerArgs ...interface{}) error { + if DefaultClient.SWbemServicesClient == nil { + return DefaultClient.Query(query, dst, connectServerArgs...) + } + return DefaultClient.SWbemServicesClient.Query(query, dst, connectServerArgs...) +} + +// A Client is an WMI query client. +// +// Its zero value (DefaultClient) is a usable client. +type Client struct { + // NonePtrZero specifies if nil values for fields which aren't pointers + // should be returned as the field types zero value. + // + // Setting this to true allows stucts without pointer fields to be used + // without the risk failure should a nil value returned from WMI. + NonePtrZero bool + + // PtrNil specifies if nil values for pointer fields should be returned + // as nil. + // + // Setting this to true will set pointer fields to nil where WMI + // returned nil, otherwise the types zero value will be returned. + PtrNil bool + + // AllowMissingFields specifies that struct fields not present in the + // query result should not result in an error. + // + // Setting this to true allows custom queries to be used with full + // struct definitions instead of having to define multiple structs. + AllowMissingFields bool + + // SWbemServiceClient is an optional SWbemServices object that can be + // initialized and then reused across multiple queries. If it is null + // then the method will initialize a new temporary client each time. + SWbemServicesClient *SWbemServices +} + +// DefaultClient is the default Client and is used by Query, QueryNamespace +var DefaultClient = &Client{} + +// Query runs the WQL query and appends the values to dst. +// +// dst must have type *[]S or *[]*S, for some struct type S. Fields selected in +// the query must have the same name in dst. Supported types are all signed and +// unsigned integers, time.Time, string, bool, or a pointer to one of those. +// Array types are not supported. +// +// By default, the local machine and default namespace are used. These can be +// changed using connectServerArgs. See +// http://msdn.microsoft.com/en-us/library/aa393720.aspx for details. +func (c *Client) Query(query string, dst interface{}, connectServerArgs ...interface{}) error { + dv := reflect.ValueOf(dst) + if dv.Kind() != reflect.Ptr || dv.IsNil() { + return ErrInvalidEntityType + } + dv = dv.Elem() + mat, elemType := checkMultiArg(dv) + if mat == multiArgTypeInvalid { + return ErrInvalidEntityType + } + + lock.Lock() + defer lock.Unlock() + runtime.LockOSThread() + defer runtime.UnlockOSThread() + + err := ole.CoInitializeEx(0, ole.COINIT_MULTITHREADED) + if err != nil { + oleCode := err.(*ole.OleError).Code() + if oleCode != ole.S_OK && oleCode != S_FALSE { + return err + } + } + defer ole.CoUninitialize() + + unknown, err := oleutil.CreateObject("WbemScripting.SWbemLocator") + if err != nil { + return err + } else if unknown == nil { + return ErrNilCreateObject + } + defer unknown.Release() + + wmi, err := unknown.QueryInterface(ole.IID_IDispatch) + if err != nil { + return err + } + defer wmi.Release() + + // service is a SWbemServices + serviceRaw, err := oleutil.CallMethod(wmi, "ConnectServer", connectServerArgs...) + if err != nil { + return err + } + service := serviceRaw.ToIDispatch() + defer serviceRaw.Clear() + + // result is a SWBemObjectSet + resultRaw, err := oleutil.CallMethod(service, "ExecQuery", query) + if err != nil { + return err + } + result := resultRaw.ToIDispatch() + defer resultRaw.Clear() + + count, err := oleInt64(result, "Count") + if err != nil { + return err + } + + enumProperty, err := result.GetProperty("_NewEnum") + if err != nil { + return err + } + defer enumProperty.Clear() + + enum, err := enumProperty.ToIUnknown().IEnumVARIANT(ole.IID_IEnumVariant) + if err != nil { + return err + } + if enum == nil { + return fmt.Errorf("can't get IEnumVARIANT, enum is nil") + } + defer enum.Release() + + // Initialize a slice with Count capacity + dv.Set(reflect.MakeSlice(dv.Type(), 0, int(count))) + + var errFieldMismatch error + for itemRaw, length, err := enum.Next(1); length > 0; itemRaw, length, err = enum.Next(1) { + if err != nil { + return err + } + + err := func() error { + // item is a SWbemObject, but really a Win32_Process + item := itemRaw.ToIDispatch() + defer item.Release() + + ev := reflect.New(elemType) + if err = c.loadEntity(ev.Interface(), item); err != nil { + if _, ok := err.(*ErrFieldMismatch); ok { + // We continue loading entities even in the face of field mismatch errors. + // If we encounter any other error, that other error is returned. Otherwise, + // an ErrFieldMismatch is returned. + errFieldMismatch = err + } else { + return err + } + } + if mat != multiArgTypeStructPtr { + ev = ev.Elem() + } + dv.Set(reflect.Append(dv, ev)) + return nil + }() + if err != nil { + return err + } + } + return errFieldMismatch +} + +// ErrFieldMismatch is returned when a field is to be loaded into a different +// type than the one it was stored from, or when a field is missing or +// unexported in the destination struct. +// StructType is the type of the struct pointed to by the destination argument. +type ErrFieldMismatch struct { + StructType reflect.Type + FieldName string + Reason string +} + +func (e *ErrFieldMismatch) Error() string { + return fmt.Sprintf("wmi: cannot load field %q into a %q: %s", + e.FieldName, e.StructType, e.Reason) +} + +var timeType = reflect.TypeOf(time.Time{}) + +// loadEntity loads a SWbemObject into a struct pointer. +func (c *Client) loadEntity(dst interface{}, src *ole.IDispatch) (errFieldMismatch error) { + v := reflect.ValueOf(dst).Elem() + for i := 0; i < v.NumField(); i++ { + f := v.Field(i) + of := f + isPtr := f.Kind() == reflect.Ptr + if isPtr { + ptr := reflect.New(f.Type().Elem()) + f.Set(ptr) + f = f.Elem() + } + n := v.Type().Field(i).Name + if !f.CanSet() { + return &ErrFieldMismatch{ + StructType: of.Type(), + FieldName: n, + Reason: "CanSet() is false", + } + } + prop, err := oleutil.GetProperty(src, n) + if err != nil { + if !c.AllowMissingFields { + errFieldMismatch = &ErrFieldMismatch{ + StructType: of.Type(), + FieldName: n, + Reason: "no such struct field", + } + } + continue + } + defer prop.Clear() + + switch val := prop.Value().(type) { + case int8, int16, int32, int64, int: + v := reflect.ValueOf(val).Int() + switch f.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + f.SetInt(v) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + f.SetUint(uint64(v)) + default: + return &ErrFieldMismatch{ + StructType: of.Type(), + FieldName: n, + Reason: "not an integer class", + } + } + case uint8, uint16, uint32, uint64: + v := reflect.ValueOf(val).Uint() + switch f.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + f.SetInt(int64(v)) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + f.SetUint(v) + default: + return &ErrFieldMismatch{ + StructType: of.Type(), + FieldName: n, + Reason: "not an integer class", + } + } + case string: + switch f.Kind() { + case reflect.String: + f.SetString(val) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + iv, err := strconv.ParseInt(val, 10, 64) + if err != nil { + return err + } + f.SetInt(iv) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + uv, err := strconv.ParseUint(val, 10, 64) + if err != nil { + return err + } + f.SetUint(uv) + case reflect.Struct: + switch f.Type() { + case timeType: + if len(val) == 25 { + mins, err := strconv.Atoi(val[22:]) + if err != nil { + return err + } + val = val[:22] + fmt.Sprintf("%02d%02d", mins/60, mins%60) + } + t, err := time.Parse("20060102150405.000000-0700", val) + if err != nil { + return err + } + f.Set(reflect.ValueOf(t)) + } + } + case bool: + switch f.Kind() { + case reflect.Bool: + f.SetBool(val) + default: + return &ErrFieldMismatch{ + StructType: of.Type(), + FieldName: n, + Reason: "not a bool", + } + } + case float32: + switch f.Kind() { + case reflect.Float32: + f.SetFloat(float64(val)) + default: + return &ErrFieldMismatch{ + StructType: of.Type(), + FieldName: n, + Reason: "not a Float32", + } + } + default: + if f.Kind() == reflect.Slice { + switch f.Type().Elem().Kind() { + case reflect.String: + safeArray := prop.ToArray() + if safeArray != nil { + arr := safeArray.ToValueArray() + fArr := reflect.MakeSlice(f.Type(), len(arr), len(arr)) + for i, v := range arr { + s := fArr.Index(i) + s.SetString(v.(string)) + } + f.Set(fArr) + } + case reflect.Uint8: + safeArray := prop.ToArray() + if safeArray != nil { + arr := safeArray.ToValueArray() + fArr := reflect.MakeSlice(f.Type(), len(arr), len(arr)) + for i, v := range arr { + s := fArr.Index(i) + s.SetUint(reflect.ValueOf(v).Uint()) + } + f.Set(fArr) + } + default: + return &ErrFieldMismatch{ + StructType: of.Type(), + FieldName: n, + Reason: fmt.Sprintf("unsupported slice type (%T)", val), + } + } + } else { + typeof := reflect.TypeOf(val) + if typeof == nil && (isPtr || c.NonePtrZero) { + if (isPtr && c.PtrNil) || (!isPtr && c.NonePtrZero) { + of.Set(reflect.Zero(of.Type())) + } + break + } + return &ErrFieldMismatch{ + StructType: of.Type(), + FieldName: n, + Reason: fmt.Sprintf("unsupported type (%T)", val), + } + } + } + } + return errFieldMismatch +} + +type multiArgType int + +const ( + multiArgTypeInvalid multiArgType = iota + multiArgTypeStruct + multiArgTypeStructPtr +) + +// checkMultiArg checks that v has type []S, []*S for some struct type S. +// +// It returns what category the slice's elements are, and the reflect.Type +// that represents S. +func checkMultiArg(v reflect.Value) (m multiArgType, elemType reflect.Type) { + if v.Kind() != reflect.Slice { + return multiArgTypeInvalid, nil + } + elemType = v.Type().Elem() + switch elemType.Kind() { + case reflect.Struct: + return multiArgTypeStruct, elemType + case reflect.Ptr: + elemType = elemType.Elem() + if elemType.Kind() == reflect.Struct { + return multiArgTypeStructPtr, elemType + } + } + return multiArgTypeInvalid, nil +} + +func oleInt64(item *ole.IDispatch, prop string) (int64, error) { + v, err := oleutil.GetProperty(item, prop) + if err != nil { + return 0, err + } + defer v.Clear() + + i := int64(v.Val) + return i, nil +} + +// CreateQuery returns a WQL query string that queries all columns of src. where +// is an optional string that is appended to the query, to be used with WHERE +// clauses. In such a case, the "WHERE" string should appear at the beginning. +func CreateQuery(src interface{}, where string) string { + var b bytes.Buffer + b.WriteString("SELECT ") + s := reflect.Indirect(reflect.ValueOf(src)) + t := s.Type() + if s.Kind() == reflect.Slice { + t = t.Elem() + } + if t.Kind() != reflect.Struct { + return "" + } + var fields []string + for i := 0; i < t.NumField(); i++ { + fields = append(fields, t.Field(i).Name) + } + b.WriteString(strings.Join(fields, ", ")) + b.WriteString(" FROM ") + b.WriteString(t.Name()) + b.WriteString(" " + where) + return b.String() +} diff --git a/go/vendor/github.com/asaskevich/govalidator/.travis.yml b/go/vendor/github.com/asaskevich/govalidator/.travis.yml new file mode 100644 index 0000000..e29f8ee --- /dev/null +++ b/go/vendor/github.com/asaskevich/govalidator/.travis.yml @@ -0,0 +1,14 @@ +language: go + +go: + - 1.1 + - 1.2 + - 1.3 + - 1.4 + - 1.5 + - 1.6 + - tip + +notifications: + email: + - bwatas@gmail.com diff --git a/go/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md b/go/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md new file mode 100644 index 0000000..f0f7e3a --- /dev/null +++ b/go/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md @@ -0,0 +1,63 @@ +#### Support +If you do have a contribution to the package, feel free to create a Pull Request or an Issue. + +#### What to contribute +If you don't know what to do, there are some features and functions that need to be done + +- [ ] Refactor code +- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check +- [ ] Create actual list of contributors and projects that currently using this package +- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues) +- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions) +- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new +- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc +- [ ] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224) +- [ ] Implement fuzzing testing +- [ ] Implement some struct/map/array utilities +- [ ] Implement map/array validation +- [ ] Implement benchmarking +- [ ] Implement batch of examples +- [ ] Look at forks for new features and fixes + +#### Advice +Feel free to create what you want, but keep in mind when you implement new features: +- Code must be clear and readable, names of variables/constants clearly describes what they are doing +- Public functions must be documented and described in source file and added to README.md to the list of available functions +- There are must be unit-tests for any new functions and improvements + +## Financial contributions + +We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/govalidator). +Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed. + + +## Credits + + +### Contributors + +Thank you to all the people who have already contributed to govalidator! + + + +### Backers + +Thank you to all our backers! [[Become a backer](https://opencollective.com/govalidator#backer)] + + + + +### Sponsors + +Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/govalidator#sponsor)) + + + + + + + + + + + \ No newline at end of file diff --git a/go/vendor/github.com/asaskevich/govalidator/LICENSE b/go/vendor/github.com/asaskevich/govalidator/LICENSE new file mode 100644 index 0000000..2f9a31f --- /dev/null +++ b/go/vendor/github.com/asaskevich/govalidator/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Alex Saskevich + +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. \ No newline at end of file diff --git a/go/vendor/github.com/asaskevich/govalidator/README.md b/go/vendor/github.com/asaskevich/govalidator/README.md new file mode 100644 index 0000000..efd8e64 --- /dev/null +++ b/go/vendor/github.com/asaskevich/govalidator/README.md @@ -0,0 +1,490 @@ +govalidator +=========== +[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/asaskevich/govalidator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![GoDoc](https://godoc.org/github.com/asaskevich/govalidator?status.png)](https://godoc.org/github.com/asaskevich/govalidator) [![Coverage Status](https://img.shields.io/coveralls/asaskevich/govalidator.svg)](https://coveralls.io/r/asaskevich/govalidator?branch=master) [![wercker status](https://app.wercker.com/status/1ec990b09ea86c910d5f08b0e02c6043/s "wercker status")](https://app.wercker.com/project/bykey/1ec990b09ea86c910d5f08b0e02c6043) +[![Build Status](https://travis-ci.org/asaskevich/govalidator.svg?branch=master)](https://travis-ci.org/asaskevich/govalidator) [![Go Report Card](https://goreportcard.com/badge/github.com/asaskevich/govalidator)](https://goreportcard.com/report/github.com/asaskevich/govalidator) [![GoSearch](http://go-search.org/badge?id=github.com%2Fasaskevich%2Fgovalidator)](http://go-search.org/view?id=github.com%2Fasaskevich%2Fgovalidator) [![Backers on Open Collective](https://opencollective.com/govalidator/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/govalidator/sponsors/badge.svg)](#sponsors) + +A package of validators and sanitizers for strings, structs and collections. Based on [validator.js](https://github.com/chriso/validator.js). + +#### Installation +Make sure that Go is installed on your computer. +Type the following command in your terminal: + + go get github.com/asaskevich/govalidator + +or you can get specified release of the package with `gopkg.in`: + + go get gopkg.in/asaskevich/govalidator.v4 + +After it the package is ready to use. + + +#### Import package in your project +Add following line in your `*.go` file: +```go +import "github.com/asaskevich/govalidator" +``` +If you are unhappy to use long `govalidator`, you can do something like this: +```go +import ( + valid "github.com/asaskevich/govalidator" +) +``` + +#### Activate behavior to require all fields have a validation tag by default +`SetFieldsRequiredByDefault` causes validation to fail when struct fields do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). A good place to activate this is a package init function or the main() function. + +```go +import "github.com/asaskevich/govalidator" + +func init() { + govalidator.SetFieldsRequiredByDefault(true) +} +``` + +Here's some code to explain it: +```go +// this struct definition will fail govalidator.ValidateStruct() (and the field values do not matter): +type exampleStruct struct { + Name string `` + Email string `valid:"email"` +} + +// this, however, will only fail when Email is empty or an invalid email address: +type exampleStruct2 struct { + Name string `valid:"-"` + Email string `valid:"email"` +} + +// lastly, this will only fail when Email is an invalid email address but not when it's empty: +type exampleStruct2 struct { + Name string `valid:"-"` + Email string `valid:"email,optional"` +} +``` + +#### Recent breaking changes (see [#123](https://github.com/asaskevich/govalidator/pull/123)) +##### Custom validator function signature +A context was added as the second parameter, for structs this is the object being validated – this makes dependent validation possible. +```go +import "github.com/asaskevich/govalidator" + +// old signature +func(i interface{}) bool + +// new signature +func(i interface{}, o interface{}) bool +``` + +##### Adding a custom validator +This was changed to prevent data races when accessing custom validators. +```go +import "github.com/asaskevich/govalidator" + +// before +govalidator.CustomTypeTagMap["customByteArrayValidator"] = CustomTypeValidator(func(i interface{}, o interface{}) bool { + // ... +}) + +// after +govalidator.CustomTypeTagMap.Set("customByteArrayValidator", CustomTypeValidator(func(i interface{}, o interface{}) bool { + // ... +})) +``` + +#### List of functions: +```go +func Abs(value float64) float64 +func BlackList(str, chars string) string +func ByteLength(str string, params ...string) bool +func CamelCaseToUnderscore(str string) string +func Contains(str, substring string) bool +func Count(array []interface{}, iterator ConditionIterator) int +func Each(array []interface{}, iterator Iterator) +func ErrorByField(e error, field string) string +func ErrorsByField(e error) map[string]string +func Filter(array []interface{}, iterator ConditionIterator) []interface{} +func Find(array []interface{}, iterator ConditionIterator) interface{} +func GetLine(s string, index int) (string, error) +func GetLines(s string) []string +func InRange(value, left, right float64) bool +func IsASCII(str string) bool +func IsAlpha(str string) bool +func IsAlphanumeric(str string) bool +func IsBase64(str string) bool +func IsByteLength(str string, min, max int) bool +func IsCIDR(str string) bool +func IsCreditCard(str string) bool +func IsDNSName(str string) bool +func IsDataURI(str string) bool +func IsDialString(str string) bool +func IsDivisibleBy(str, num string) bool +func IsEmail(str string) bool +func IsFilePath(str string) (bool, int) +func IsFloat(str string) bool +func IsFullWidth(str string) bool +func IsHalfWidth(str string) bool +func IsHexadecimal(str string) bool +func IsHexcolor(str string) bool +func IsHost(str string) bool +func IsIP(str string) bool +func IsIPv4(str string) bool +func IsIPv6(str string) bool +func IsISBN(str string, version int) bool +func IsISBN10(str string) bool +func IsISBN13(str string) bool +func IsISO3166Alpha2(str string) bool +func IsISO3166Alpha3(str string) bool +func IsISO693Alpha2(str string) bool +func IsISO693Alpha3b(str string) bool +func IsISO4217(str string) bool +func IsIn(str string, params ...string) bool +func IsInt(str string) bool +func IsJSON(str string) bool +func IsLatitude(str string) bool +func IsLongitude(str string) bool +func IsLowerCase(str string) bool +func IsMAC(str string) bool +func IsMongoID(str string) bool +func IsMultibyte(str string) bool +func IsNatural(value float64) bool +func IsNegative(value float64) bool +func IsNonNegative(value float64) bool +func IsNonPositive(value float64) bool +func IsNull(str string) bool +func IsNumeric(str string) bool +func IsPort(str string) bool +func IsPositive(value float64) bool +func IsPrintableASCII(str string) bool +func IsRFC3339(str string) bool +func IsRFC3339WithoutZone(str string) bool +func IsRGBcolor(str string) bool +func IsRequestURI(rawurl string) bool +func IsRequestURL(rawurl string) bool +func IsSSN(str string) bool +func IsSemver(str string) bool +func IsTime(str string, format string) bool +func IsURL(str string) bool +func IsUTFDigit(str string) bool +func IsUTFLetter(str string) bool +func IsUTFLetterNumeric(str string) bool +func IsUTFNumeric(str string) bool +func IsUUID(str string) bool +func IsUUIDv3(str string) bool +func IsUUIDv4(str string) bool +func IsUUIDv5(str string) bool +func IsUpperCase(str string) bool +func IsVariableWidth(str string) bool +func IsWhole(value float64) bool +func LeftTrim(str, chars string) string +func Map(array []interface{}, iterator ResultIterator) []interface{} +func Matches(str, pattern string) bool +func NormalizeEmail(str string) (string, error) +func PadBoth(str string, padStr string, padLen int) string +func PadLeft(str string, padStr string, padLen int) string +func PadRight(str string, padStr string, padLen int) string +func Range(str string, params ...string) bool +func RemoveTags(s string) string +func ReplacePattern(str, pattern, replace string) string +func Reverse(s string) string +func RightTrim(str, chars string) string +func RuneLength(str string, params ...string) bool +func SafeFileName(str string) string +func SetFieldsRequiredByDefault(value bool) +func Sign(value float64) float64 +func StringLength(str string, params ...string) bool +func StringMatches(s string, params ...string) bool +func StripLow(str string, keepNewLines bool) string +func ToBoolean(str string) (bool, error) +func ToFloat(str string) (float64, error) +func ToInt(str string) (int64, error) +func ToJSON(obj interface{}) (string, error) +func ToString(obj interface{}) string +func Trim(str, chars string) string +func Truncate(str string, length int, ending string) string +func UnderscoreToCamelCase(s string) string +func ValidateStruct(s interface{}) (bool, error) +func WhiteList(str, chars string) string +type ConditionIterator +type CustomTypeValidator +type Error +func (e Error) Error() string +type Errors +func (es Errors) Error() string +func (es Errors) Errors() []error +type ISO3166Entry +type Iterator +type ParamValidator +type ResultIterator +type UnsupportedTypeError +func (e *UnsupportedTypeError) Error() string +type Validator +``` + +#### Examples +###### IsURL +```go +println(govalidator.IsURL(`http://user@pass:domain.com/path/page`)) +``` +###### ToString +```go +type User struct { + FirstName string + LastName string +} + +str := govalidator.ToString(&User{"John", "Juan"}) +println(str) +``` +###### Each, Map, Filter, Count for slices +Each iterates over the slice/array and calls Iterator for every item +```go +data := []interface{}{1, 2, 3, 4, 5} +var fn govalidator.Iterator = func(value interface{}, index int) { + println(value.(int)) +} +govalidator.Each(data, fn) +``` +```go +data := []interface{}{1, 2, 3, 4, 5} +var fn govalidator.ResultIterator = func(value interface{}, index int) interface{} { + return value.(int) * 3 +} +_ = govalidator.Map(data, fn) // result = []interface{}{1, 6, 9, 12, 15} +``` +```go +data := []interface{}{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} +var fn govalidator.ConditionIterator = func(value interface{}, index int) bool { + return value.(int)%2 == 0 +} +_ = govalidator.Filter(data, fn) // result = []interface{}{2, 4, 6, 8, 10} +_ = govalidator.Count(data, fn) // result = 5 +``` +###### ValidateStruct [#2](https://github.com/asaskevich/govalidator/pull/2) +If you want to validate structs, you can use tag `valid` for any field in your structure. All validators used with this field in one tag are separated by comma. If you want to skip validation, place `-` in your tag. If you need a validator that is not on the list below, you can add it like this: +```go +govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool { + return str == "duck" +}) +``` +For completely custom validators (interface-based), see below. + +Here is a list of available validators for struct fields (validator - used function): +```go +"email": IsEmail, +"url": IsURL, +"dialstring": IsDialString, +"requrl": IsRequestURL, +"requri": IsRequestURI, +"alpha": IsAlpha, +"utfletter": IsUTFLetter, +"alphanum": IsAlphanumeric, +"utfletternum": IsUTFLetterNumeric, +"numeric": IsNumeric, +"utfnumeric": IsUTFNumeric, +"utfdigit": IsUTFDigit, +"hexadecimal": IsHexadecimal, +"hexcolor": IsHexcolor, +"rgbcolor": IsRGBcolor, +"lowercase": IsLowerCase, +"uppercase": IsUpperCase, +"int": IsInt, +"float": IsFloat, +"null": IsNull, +"uuid": IsUUID, +"uuidv3": IsUUIDv3, +"uuidv4": IsUUIDv4, +"uuidv5": IsUUIDv5, +"creditcard": IsCreditCard, +"isbn10": IsISBN10, +"isbn13": IsISBN13, +"json": IsJSON, +"multibyte": IsMultibyte, +"ascii": IsASCII, +"printableascii": IsPrintableASCII, +"fullwidth": IsFullWidth, +"halfwidth": IsHalfWidth, +"variablewidth": IsVariableWidth, +"base64": IsBase64, +"datauri": IsDataURI, +"ip": IsIP, +"port": IsPort, +"ipv4": IsIPv4, +"ipv6": IsIPv6, +"dns": IsDNSName, +"host": IsHost, +"mac": IsMAC, +"latitude": IsLatitude, +"longitude": IsLongitude, +"ssn": IsSSN, +"semver": IsSemver, +"rfc3339": IsRFC3339, +"rfc3339WithoutZone": IsRFC3339WithoutZone, +"ISO3166Alpha2": IsISO3166Alpha2, +"ISO3166Alpha3": IsISO3166Alpha3, +``` +Validators with parameters + +```go +"range(min|max)": Range, +"length(min|max)": ByteLength, +"runelength(min|max)": RuneLength, +"matches(pattern)": StringMatches, +"in(string1|string2|...|stringN)": IsIn, +``` + +And here is small example of usage: +```go +type Post struct { + Title string `valid:"alphanum,required"` + Message string `valid:"duck,ascii"` + AuthorIP string `valid:"ipv4"` + Date string `valid:"-"` +} +post := &Post{ + Title: "My Example Post", + Message: "duck", + AuthorIP: "123.234.54.3", +} + +// Add your own struct validation tags +govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool { + return str == "duck" +}) + +result, err := govalidator.ValidateStruct(post) +if err != nil { + println("error: " + err.Error()) +} +println(result) +``` +###### WhiteList +```go +// Remove all characters from string ignoring characters between "a" and "z" +println(govalidator.WhiteList("a3a43a5a4a3a2a23a4a5a4a3a4", "a-z") == "aaaaaaaaaaaa") +``` + +###### Custom validation functions +Custom validation using your own domain specific validators is also available - here's an example of how to use it: +```go +import "github.com/asaskevich/govalidator" + +type CustomByteArray [6]byte // custom types are supported and can be validated + +type StructWithCustomByteArray struct { + ID CustomByteArray `valid:"customByteArrayValidator,customMinLengthValidator"` // multiple custom validators are possible as well and will be evaluated in sequence + Email string `valid:"email"` + CustomMinLength int `valid:"-"` +} + +govalidator.CustomTypeTagMap.Set("customByteArrayValidator", CustomTypeValidator(func(i interface{}, context interface{}) bool { + switch v := context.(type) { // you can type switch on the context interface being validated + case StructWithCustomByteArray: + // you can check and validate against some other field in the context, + // return early or not validate against the context at all – your choice + case SomeOtherType: + // ... + default: + // expecting some other type? Throw/panic here or continue + } + + switch v := i.(type) { // type switch on the struct field being validated + case CustomByteArray: + for _, e := range v { // this validator checks that the byte array is not empty, i.e. not all zeroes + if e != 0 { + return true + } + } + } + return false +})) +govalidator.CustomTypeTagMap.Set("customMinLengthValidator", CustomTypeValidator(func(i interface{}, context interface{}) bool { + switch v := context.(type) { // this validates a field against the value in another field, i.e. dependent validation + case StructWithCustomByteArray: + return len(v.ID) >= v.CustomMinLength + } + return false +})) +``` + +###### Custom error messages +Custom error messages are supported via annotations by adding the `~` separator - here's an example of how to use it: +```go +type Ticket struct { + Id int64 `json:"id"` + FirstName string `json:"firstname" valid:"required~First name is blank"` +} +``` + +#### Notes +Documentation is available here: [godoc.org](https://godoc.org/github.com/asaskevich/govalidator). +Full information about code coverage is also available here: [govalidator on gocover.io](http://gocover.io/github.com/asaskevich/govalidator). + +#### Support +If you do have a contribution to the package, feel free to create a Pull Request or an Issue. + +#### What to contribute +If you don't know what to do, there are some features and functions that need to be done + +- [ ] Refactor code +- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check +- [ ] Create actual list of contributors and projects that currently using this package +- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues) +- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions) +- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new +- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc +- [ ] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224) +- [ ] Implement fuzzing testing +- [ ] Implement some struct/map/array utilities +- [ ] Implement map/array validation +- [ ] Implement benchmarking +- [ ] Implement batch of examples +- [ ] Look at forks for new features and fixes + +#### Advice +Feel free to create what you want, but keep in mind when you implement new features: +- Code must be clear and readable, names of variables/constants clearly describes what they are doing +- Public functions must be documented and described in source file and added to README.md to the list of available functions +- There are must be unit-tests for any new functions and improvements + +## Credits +### Contributors + +This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. + +#### Special thanks to [contributors](https://github.com/asaskevich/govalidator/graphs/contributors) +* [Daniel Lohse](https://github.com/annismckenzie) +* [Attila Oláh](https://github.com/attilaolah) +* [Daniel Korner](https://github.com/Dadie) +* [Steven Wilkin](https://github.com/stevenwilkin) +* [Deiwin Sarjas](https://github.com/deiwin) +* [Noah Shibley](https://github.com/slugmobile) +* [Nathan Davies](https://github.com/nathj07) +* [Matt Sanford](https://github.com/mzsanford) +* [Simon ccl1115](https://github.com/ccl1115) + + + + +### Backers + +Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/govalidator#backer)] + + + + +### Sponsors + +Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/govalidator#sponsor)] + + + + + + + + + + + + + diff --git a/go/vendor/github.com/asaskevich/govalidator/arrays.go b/go/vendor/github.com/asaskevich/govalidator/arrays.go new file mode 100644 index 0000000..5bace26 --- /dev/null +++ b/go/vendor/github.com/asaskevich/govalidator/arrays.go @@ -0,0 +1,58 @@ +package govalidator + +// Iterator is the function that accepts element of slice/array and its index +type Iterator func(interface{}, int) + +// ResultIterator is the function that accepts element of slice/array and its index and returns any result +type ResultIterator func(interface{}, int) interface{} + +// ConditionIterator is the function that accepts element of slice/array and its index and returns boolean +type ConditionIterator func(interface{}, int) bool + +// Each iterates over the slice and apply Iterator to every item +func Each(array []interface{}, iterator Iterator) { + for index, data := range array { + iterator(data, index) + } +} + +// Map iterates over the slice and apply ResultIterator to every item. Returns new slice as a result. +func Map(array []interface{}, iterator ResultIterator) []interface{} { + var result = make([]interface{}, len(array)) + for index, data := range array { + result[index] = iterator(data, index) + } + return result +} + +// Find iterates over the slice and apply ConditionIterator to every item. Returns first item that meet ConditionIterator or nil otherwise. +func Find(array []interface{}, iterator ConditionIterator) interface{} { + for index, data := range array { + if iterator(data, index) { + return data + } + } + return nil +} + +// Filter iterates over the slice and apply ConditionIterator to every item. Returns new slice. +func Filter(array []interface{}, iterator ConditionIterator) []interface{} { + var result = make([]interface{}, 0) + for index, data := range array { + if iterator(data, index) { + result = append(result, data) + } + } + return result +} + +// Count iterates over the slice and apply ConditionIterator to every item. Returns count of items that meets ConditionIterator. +func Count(array []interface{}, iterator ConditionIterator) int { + count := 0 + for index, data := range array { + if iterator(data, index) { + count = count + 1 + } + } + return count +} diff --git a/go/vendor/github.com/asaskevich/govalidator/converter.go b/go/vendor/github.com/asaskevich/govalidator/converter.go new file mode 100644 index 0000000..cf1e5d5 --- /dev/null +++ b/go/vendor/github.com/asaskevich/govalidator/converter.go @@ -0,0 +1,64 @@ +package govalidator + +import ( + "encoding/json" + "fmt" + "reflect" + "strconv" +) + +// ToString convert the input to a string. +func ToString(obj interface{}) string { + res := fmt.Sprintf("%v", obj) + return string(res) +} + +// ToJSON convert the input to a valid JSON string +func ToJSON(obj interface{}) (string, error) { + res, err := json.Marshal(obj) + if err != nil { + res = []byte("") + } + return string(res), err +} + +// ToFloat convert the input string to a float, or 0.0 if the input is not a float. +func ToFloat(str string) (float64, error) { + res, err := strconv.ParseFloat(str, 64) + if err != nil { + res = 0.0 + } + return res, err +} + +// ToInt convert the input string or any int type to an integer type 64, or 0 if the input is not an integer. +func ToInt(value interface{}) (res int64, err error) { + val := reflect.ValueOf(value) + + switch value.(type) { + case int, int8, int16, int32, int64: + res = val.Int() + case uint, uint8, uint16, uint32, uint64: + res = int64(val.Uint()) + case string: + if IsInt(val.String()) { + res, err = strconv.ParseInt(val.String(), 0, 64) + if err != nil { + res = 0 + } + } else { + err = fmt.Errorf("math: square root of negative number %g", value) + res = 0 + } + default: + err = fmt.Errorf("math: square root of negative number %g", value) + res = 0 + } + + return +} + +// ToBoolean convert the input string to a boolean. +func ToBoolean(str string) (bool, error) { + return strconv.ParseBool(str) +} diff --git a/go/vendor/github.com/asaskevich/govalidator/error.go b/go/vendor/github.com/asaskevich/govalidator/error.go new file mode 100644 index 0000000..b9c3207 --- /dev/null +++ b/go/vendor/github.com/asaskevich/govalidator/error.go @@ -0,0 +1,36 @@ +package govalidator + +import "strings" + +// Errors is an array of multiple errors and conforms to the error interface. +type Errors []error + +// Errors returns itself. +func (es Errors) Errors() []error { + return es +} + +func (es Errors) Error() string { + var errs []string + for _, e := range es { + errs = append(errs, e.Error()) + } + return strings.Join(errs, ";") +} + +// Error encapsulates a name, an error and whether there's a custom error message or not. +type Error struct { + Name string + Err error + CustomErrorMessageExists bool + + // Validator indicates the name of the validator that failed + Validator string +} + +func (e Error) Error() string { + if e.CustomErrorMessageExists { + return e.Err.Error() + } + return e.Name + ": " + e.Err.Error() +} diff --git a/go/vendor/github.com/asaskevich/govalidator/numerics.go b/go/vendor/github.com/asaskevich/govalidator/numerics.go new file mode 100644 index 0000000..7e6c652 --- /dev/null +++ b/go/vendor/github.com/asaskevich/govalidator/numerics.go @@ -0,0 +1,97 @@ +package govalidator + +import ( + "math" + "reflect" +) + +// Abs returns absolute value of number +func Abs(value float64) float64 { + return math.Abs(value) +} + +// Sign returns signum of number: 1 in case of value > 0, -1 in case of value < 0, 0 otherwise +func Sign(value float64) float64 { + if value > 0 { + return 1 + } else if value < 0 { + return -1 + } else { + return 0 + } +} + +// IsNegative returns true if value < 0 +func IsNegative(value float64) bool { + return value < 0 +} + +// IsPositive returns true if value > 0 +func IsPositive(value float64) bool { + return value > 0 +} + +// IsNonNegative returns true if value >= 0 +func IsNonNegative(value float64) bool { + return value >= 0 +} + +// IsNonPositive returns true if value <= 0 +func IsNonPositive(value float64) bool { + return value <= 0 +} + +// InRange returns true if value lies between left and right border +func InRangeInt(value, left, right interface{}) bool { + value64, _ := ToInt(value) + left64, _ := ToInt(left) + right64, _ := ToInt(right) + if left64 > right64 { + left64, right64 = right64, left64 + } + return value64 >= left64 && value64 <= right64 +} + +// InRange returns true if value lies between left and right border +func InRangeFloat32(value, left, right float32) bool { + if left > right { + left, right = right, left + } + return value >= left && value <= right +} + +// InRange returns true if value lies between left and right border +func InRangeFloat64(value, left, right float64) bool { + if left > right { + left, right = right, left + } + return value >= left && value <= right +} + +// InRange returns true if value lies between left and right border, generic type to handle int, float32 or float64, all types must the same type +func InRange(value interface{}, left interface{}, right interface{}) bool { + + reflectValue := reflect.TypeOf(value).Kind() + reflectLeft := reflect.TypeOf(left).Kind() + reflectRight := reflect.TypeOf(right).Kind() + + if reflectValue == reflect.Int && reflectLeft == reflect.Int && reflectRight == reflect.Int { + return InRangeInt(value.(int), left.(int), right.(int)) + } else if reflectValue == reflect.Float32 && reflectLeft == reflect.Float32 && reflectRight == reflect.Float32 { + return InRangeFloat32(value.(float32), left.(float32), right.(float32)) + } else if reflectValue == reflect.Float64 && reflectLeft == reflect.Float64 && reflectRight == reflect.Float64 { + return InRangeFloat64(value.(float64), left.(float64), right.(float64)) + } else { + return false + } +} + +// IsWhole returns true if value is whole number +func IsWhole(value float64) bool { + return math.Remainder(value, 1) == 0 +} + +// IsNatural returns true if value is natural number (positive and whole) +func IsNatural(value float64) bool { + return IsWhole(value) && IsPositive(value) +} diff --git a/go/vendor/github.com/asaskevich/govalidator/patterns.go b/go/vendor/github.com/asaskevich/govalidator/patterns.go new file mode 100644 index 0000000..8609cd2 --- /dev/null +++ b/go/vendor/github.com/asaskevich/govalidator/patterns.go @@ -0,0 +1,97 @@ +package govalidator + +import "regexp" + +// Basic regular expressions for validating strings +const ( + //Email string = "^(((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+(\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|\\.|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.)+(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.?$" + CreditCard string = "^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11})$" + ISBN10 string = "^(?:[0-9]{9}X|[0-9]{10})$" + ISBN13 string = "^(?:[0-9]{13})$" + UUID3 string = "^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$" + UUID4 string = "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + UUID5 string = "^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + UUID string = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" + Alpha string = "^[a-zA-Z]+$" + Alphanumeric string = "^[a-zA-Z0-9]+$" + Numeric string = "^[0-9]+$" + Int string = "^(?:[-+]?(?:0|[1-9][0-9]*))$" + Float string = "^(?:[-+]?(?:[0-9]+))?(?:\\.[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$" + Hexadecimal string = "^[0-9a-fA-F]+$" + Hexcolor string = "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$" + RGBcolor string = "^rgb\\(\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*\\)$" + ASCII string = "^[\x00-\x7F]+$" + Multibyte string = "[^\x00-\x7F]" + FullWidth string = "[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" + HalfWidth string = "[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" + Base64 string = "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{4})$" + PrintableASCII string = "^[\x20-\x7E]+$" + DataURI string = "^data:.+\\/(.+);base64$" + Latitude string = "^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?)$" + Longitude string = "^[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$" + DNSName string = `^([a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*[\._]?$` + IP string = `(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))` + URLSchema string = `((ftp|tcp|udp|wss?|https?):\/\/)` + URLUsername string = `(\S+(:\S*)?@)` + URLPath string = `((\/|\?|#)[^\s]*)` + URLPort string = `(:(\d{1,5}))` + URLIP string = `([1-9]\d?|1\d\d|2[01]\d|22[0-3])(\.(1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.([0-9]\d?|1\d\d|2[0-4]\d|25[0-4]))` + URLSubdomain string = `((www\.)|([a-zA-Z0-9]([-\.][-\._a-zA-Z0-9]+)*))` + URL string = `^` + URLSchema + `?` + URLUsername + `?` + `((` + URLIP + `|(\[` + IP + `\])|(([a-zA-Z0-9]([a-zA-Z0-9-_]+)?[a-zA-Z0-9]([-\.][a-zA-Z0-9]+)*)|(` + URLSubdomain + `?))?(([a-zA-Z\x{00a1}-\x{ffff}0-9]+-?-?)*[a-zA-Z\x{00a1}-\x{ffff}0-9]+)(?:\.([a-zA-Z\x{00a1}-\x{ffff}]{1,}))?))\.?` + URLPort + `?` + URLPath + `?$` + SSN string = `^\d{3}[- ]?\d{2}[- ]?\d{4}$` + WinPath string = `^[a-zA-Z]:\\(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$` + UnixPath string = `^(/[^/\x00]*)+/?$` + Semver string = "^v?(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(-(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\\+[0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*)?$" + tagName string = "valid" + hasLowerCase string = ".*[[:lower:]]" + hasUpperCase string = ".*[[:upper:]]" +) + +// Used by IsFilePath func +const ( + // Unknown is unresolved OS type + Unknown = iota + // Win is Windows type + Win + // Unix is *nix OS types + Unix +) + +var ( + userRegexp = regexp.MustCompile("^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+$") + hostRegexp = regexp.MustCompile("^[^\\s]+\\.[^\\s]+$") + userDotRegexp = regexp.MustCompile("(^[.]{1})|([.]{1}$)|([.]{2,})") + //rxEmail = regexp.MustCompile(Email) + rxCreditCard = regexp.MustCompile(CreditCard) + rxISBN10 = regexp.MustCompile(ISBN10) + rxISBN13 = regexp.MustCompile(ISBN13) + rxUUID3 = regexp.MustCompile(UUID3) + rxUUID4 = regexp.MustCompile(UUID4) + rxUUID5 = regexp.MustCompile(UUID5) + rxUUID = regexp.MustCompile(UUID) + rxAlpha = regexp.MustCompile(Alpha) + rxAlphanumeric = regexp.MustCompile(Alphanumeric) + rxNumeric = regexp.MustCompile(Numeric) + rxInt = regexp.MustCompile(Int) + rxFloat = regexp.MustCompile(Float) + rxHexadecimal = regexp.MustCompile(Hexadecimal) + rxHexcolor = regexp.MustCompile(Hexcolor) + rxRGBcolor = regexp.MustCompile(RGBcolor) + rxASCII = regexp.MustCompile(ASCII) + rxPrintableASCII = regexp.MustCompile(PrintableASCII) + rxMultibyte = regexp.MustCompile(Multibyte) + rxFullWidth = regexp.MustCompile(FullWidth) + rxHalfWidth = regexp.MustCompile(HalfWidth) + rxBase64 = regexp.MustCompile(Base64) + rxDataURI = regexp.MustCompile(DataURI) + rxLatitude = regexp.MustCompile(Latitude) + rxLongitude = regexp.MustCompile(Longitude) + rxDNSName = regexp.MustCompile(DNSName) + rxURL = regexp.MustCompile(URL) + rxSSN = regexp.MustCompile(SSN) + rxWinPath = regexp.MustCompile(WinPath) + rxUnixPath = regexp.MustCompile(UnixPath) + rxSemver = regexp.MustCompile(Semver) + rxHasLowerCase = regexp.MustCompile(hasLowerCase) + rxHasUpperCase = regexp.MustCompile(hasUpperCase) +) diff --git a/go/vendor/github.com/asaskevich/govalidator/types.go b/go/vendor/github.com/asaskevich/govalidator/types.go new file mode 100644 index 0000000..ddd30b1 --- /dev/null +++ b/go/vendor/github.com/asaskevich/govalidator/types.go @@ -0,0 +1,616 @@ +package govalidator + +import ( + "reflect" + "regexp" + "sync" +) + +// Validator is a wrapper for a validator function that returns bool and accepts string. +type Validator func(str string) bool + +// CustomTypeValidator is a wrapper for validator functions that returns bool and accepts any type. +// The second parameter should be the context (in the case of validating a struct: the whole object being validated). +type CustomTypeValidator func(i interface{}, o interface{}) bool + +// ParamValidator is a wrapper for validator functions that accepts additional parameters. +type ParamValidator func(str string, params ...string) bool +type tagOptionsMap map[string]string + +// UnsupportedTypeError is a wrapper for reflect.Type +type UnsupportedTypeError struct { + Type reflect.Type +} + +// stringValues is a slice of reflect.Value holding *reflect.StringValue. +// It implements the methods to sort by string. +type stringValues []reflect.Value + +// ParamTagMap is a map of functions accept variants parameters +var ParamTagMap = map[string]ParamValidator{ + "length": ByteLength, + "range": Range, + "runelength": RuneLength, + "stringlength": StringLength, + "matches": StringMatches, + "in": isInRaw, + "rsapub": IsRsaPub, +} + +// ParamTagRegexMap maps param tags to their respective regexes. +var ParamTagRegexMap = map[string]*regexp.Regexp{ + "range": regexp.MustCompile("^range\\((\\d+)\\|(\\d+)\\)$"), + "length": regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"), + "runelength": regexp.MustCompile("^runelength\\((\\d+)\\|(\\d+)\\)$"), + "stringlength": regexp.MustCompile("^stringlength\\((\\d+)\\|(\\d+)\\)$"), + "in": regexp.MustCompile(`^in\((.*)\)`), + "matches": regexp.MustCompile(`^matches\((.+)\)$`), + "rsapub": regexp.MustCompile("^rsapub\\((\\d+)\\)$"), +} + +type customTypeTagMap struct { + validators map[string]CustomTypeValidator + + sync.RWMutex +} + +func (tm *customTypeTagMap) Get(name string) (CustomTypeValidator, bool) { + tm.RLock() + defer tm.RUnlock() + v, ok := tm.validators[name] + return v, ok +} + +func (tm *customTypeTagMap) Set(name string, ctv CustomTypeValidator) { + tm.Lock() + defer tm.Unlock() + tm.validators[name] = ctv +} + +// CustomTypeTagMap is a map of functions that can be used as tags for ValidateStruct function. +// Use this to validate compound or custom types that need to be handled as a whole, e.g. +// `type UUID [16]byte` (this would be handled as an array of bytes). +var CustomTypeTagMap = &customTypeTagMap{validators: make(map[string]CustomTypeValidator)} + +// TagMap is a map of functions, that can be used as tags for ValidateStruct function. +var TagMap = map[string]Validator{ + "email": IsEmail, + "url": IsURL, + "dialstring": IsDialString, + "requrl": IsRequestURL, + "requri": IsRequestURI, + "alpha": IsAlpha, + "utfletter": IsUTFLetter, + "alphanum": IsAlphanumeric, + "utfletternum": IsUTFLetterNumeric, + "numeric": IsNumeric, + "utfnumeric": IsUTFNumeric, + "utfdigit": IsUTFDigit, + "hexadecimal": IsHexadecimal, + "hexcolor": IsHexcolor, + "rgbcolor": IsRGBcolor, + "lowercase": IsLowerCase, + "uppercase": IsUpperCase, + "int": IsInt, + "float": IsFloat, + "null": IsNull, + "uuid": IsUUID, + "uuidv3": IsUUIDv3, + "uuidv4": IsUUIDv4, + "uuidv5": IsUUIDv5, + "creditcard": IsCreditCard, + "isbn10": IsISBN10, + "isbn13": IsISBN13, + "json": IsJSON, + "multibyte": IsMultibyte, + "ascii": IsASCII, + "printableascii": IsPrintableASCII, + "fullwidth": IsFullWidth, + "halfwidth": IsHalfWidth, + "variablewidth": IsVariableWidth, + "base64": IsBase64, + "datauri": IsDataURI, + "ip": IsIP, + "port": IsPort, + "ipv4": IsIPv4, + "ipv6": IsIPv6, + "dns": IsDNSName, + "host": IsHost, + "mac": IsMAC, + "latitude": IsLatitude, + "longitude": IsLongitude, + "ssn": IsSSN, + "semver": IsSemver, + "rfc3339": IsRFC3339, + "rfc3339WithoutZone": IsRFC3339WithoutZone, + "ISO3166Alpha2": IsISO3166Alpha2, + "ISO3166Alpha3": IsISO3166Alpha3, + "ISO4217": IsISO4217, +} + +// ISO3166Entry stores country codes +type ISO3166Entry struct { + EnglishShortName string + FrenchShortName string + Alpha2Code string + Alpha3Code string + Numeric string +} + +//ISO3166List based on https://www.iso.org/obp/ui/#search/code/ Code Type "Officially Assigned Codes" +var ISO3166List = []ISO3166Entry{ + {"Afghanistan", "Afghanistan (l')", "AF", "AFG", "004"}, + {"Albania", "Albanie (l')", "AL", "ALB", "008"}, + {"Antarctica", "Antarctique (l')", "AQ", "ATA", "010"}, + {"Algeria", "Algérie (l')", "DZ", "DZA", "012"}, + {"American Samoa", "Samoa américaines (les)", "AS", "ASM", "016"}, + {"Andorra", "Andorre (l')", "AD", "AND", "020"}, + {"Angola", "Angola (l')", "AO", "AGO", "024"}, + {"Antigua and Barbuda", "Antigua-et-Barbuda", "AG", "ATG", "028"}, + {"Azerbaijan", "Azerbaïdjan (l')", "AZ", "AZE", "031"}, + {"Argentina", "Argentine (l')", "AR", "ARG", "032"}, + {"Australia", "Australie (l')", "AU", "AUS", "036"}, + {"Austria", "Autriche (l')", "AT", "AUT", "040"}, + {"Bahamas (the)", "Bahamas (les)", "BS", "BHS", "044"}, + {"Bahrain", "Bahreïn", "BH", "BHR", "048"}, + {"Bangladesh", "Bangladesh (le)", "BD", "BGD", "050"}, + {"Armenia", "Arménie (l')", "AM", "ARM", "051"}, + {"Barbados", "Barbade (la)", "BB", "BRB", "052"}, + {"Belgium", "Belgique (la)", "BE", "BEL", "056"}, + {"Bermuda", "Bermudes (les)", "BM", "BMU", "060"}, + {"Bhutan", "Bhoutan (le)", "BT", "BTN", "064"}, + {"Bolivia (Plurinational State of)", "Bolivie (État plurinational de)", "BO", "BOL", "068"}, + {"Bosnia and Herzegovina", "Bosnie-Herzégovine (la)", "BA", "BIH", "070"}, + {"Botswana", "Botswana (le)", "BW", "BWA", "072"}, + {"Bouvet Island", "Bouvet (l'Île)", "BV", "BVT", "074"}, + {"Brazil", "Brésil (le)", "BR", "BRA", "076"}, + {"Belize", "Belize (le)", "BZ", "BLZ", "084"}, + {"British Indian Ocean Territory (the)", "Indien (le Territoire britannique de l'océan)", "IO", "IOT", "086"}, + {"Solomon Islands", "Salomon (Îles)", "SB", "SLB", "090"}, + {"Virgin Islands (British)", "Vierges britanniques (les Îles)", "VG", "VGB", "092"}, + {"Brunei Darussalam", "Brunéi Darussalam (le)", "BN", "BRN", "096"}, + {"Bulgaria", "Bulgarie (la)", "BG", "BGR", "100"}, + {"Myanmar", "Myanmar (le)", "MM", "MMR", "104"}, + {"Burundi", "Burundi (le)", "BI", "BDI", "108"}, + {"Belarus", "Bélarus (le)", "BY", "BLR", "112"}, + {"Cambodia", "Cambodge (le)", "KH", "KHM", "116"}, + {"Cameroon", "Cameroun (le)", "CM", "CMR", "120"}, + {"Canada", "Canada (le)", "CA", "CAN", "124"}, + {"Cabo Verde", "Cabo Verde", "CV", "CPV", "132"}, + {"Cayman Islands (the)", "Caïmans (les Îles)", "KY", "CYM", "136"}, + {"Central African Republic (the)", "République centrafricaine (la)", "CF", "CAF", "140"}, + {"Sri Lanka", "Sri Lanka", "LK", "LKA", "144"}, + {"Chad", "Tchad (le)", "TD", "TCD", "148"}, + {"Chile", "Chili (le)", "CL", "CHL", "152"}, + {"China", "Chine (la)", "CN", "CHN", "156"}, + {"Taiwan (Province of China)", "Taïwan (Province de Chine)", "TW", "TWN", "158"}, + {"Christmas Island", "Christmas (l'Île)", "CX", "CXR", "162"}, + {"Cocos (Keeling) Islands (the)", "Cocos (les Îles)/ Keeling (les Îles)", "CC", "CCK", "166"}, + {"Colombia", "Colombie (la)", "CO", "COL", "170"}, + {"Comoros (the)", "Comores (les)", "KM", "COM", "174"}, + {"Mayotte", "Mayotte", "YT", "MYT", "175"}, + {"Congo (the)", "Congo (le)", "CG", "COG", "178"}, + {"Congo (the Democratic Republic of the)", "Congo (la République démocratique du)", "CD", "COD", "180"}, + {"Cook Islands (the)", "Cook (les Îles)", "CK", "COK", "184"}, + {"Costa Rica", "Costa Rica (le)", "CR", "CRI", "188"}, + {"Croatia", "Croatie (la)", "HR", "HRV", "191"}, + {"Cuba", "Cuba", "CU", "CUB", "192"}, + {"Cyprus", "Chypre", "CY", "CYP", "196"}, + {"Czech Republic (the)", "tchèque (la République)", "CZ", "CZE", "203"}, + {"Benin", "Bénin (le)", "BJ", "BEN", "204"}, + {"Denmark", "Danemark (le)", "DK", "DNK", "208"}, + {"Dominica", "Dominique (la)", "DM", "DMA", "212"}, + {"Dominican Republic (the)", "dominicaine (la République)", "DO", "DOM", "214"}, + {"Ecuador", "Équateur (l')", "EC", "ECU", "218"}, + {"El Salvador", "El Salvador", "SV", "SLV", "222"}, + {"Equatorial Guinea", "Guinée équatoriale (la)", "GQ", "GNQ", "226"}, + {"Ethiopia", "Éthiopie (l')", "ET", "ETH", "231"}, + {"Eritrea", "Érythrée (l')", "ER", "ERI", "232"}, + {"Estonia", "Estonie (l')", "EE", "EST", "233"}, + {"Faroe Islands (the)", "Féroé (les Îles)", "FO", "FRO", "234"}, + {"Falkland Islands (the) [Malvinas]", "Falkland (les Îles)/Malouines (les Îles)", "FK", "FLK", "238"}, + {"South Georgia and the South Sandwich Islands", "Géorgie du Sud-et-les Îles Sandwich du Sud (la)", "GS", "SGS", "239"}, + {"Fiji", "Fidji (les)", "FJ", "FJI", "242"}, + {"Finland", "Finlande (la)", "FI", "FIN", "246"}, + {"Åland Islands", "Åland(les Îles)", "AX", "ALA", "248"}, + {"France", "France (la)", "FR", "FRA", "250"}, + {"French Guiana", "Guyane française (la )", "GF", "GUF", "254"}, + {"French Polynesia", "Polynésie française (la)", "PF", "PYF", "258"}, + {"French Southern Territories (the)", "Terres australes françaises (les)", "TF", "ATF", "260"}, + {"Djibouti", "Djibouti", "DJ", "DJI", "262"}, + {"Gabon", "Gabon (le)", "GA", "GAB", "266"}, + {"Georgia", "Géorgie (la)", "GE", "GEO", "268"}, + {"Gambia (the)", "Gambie (la)", "GM", "GMB", "270"}, + {"Palestine, State of", "Palestine, État de", "PS", "PSE", "275"}, + {"Germany", "Allemagne (l')", "DE", "DEU", "276"}, + {"Ghana", "Ghana (le)", "GH", "GHA", "288"}, + {"Gibraltar", "Gibraltar", "GI", "GIB", "292"}, + {"Kiribati", "Kiribati", "KI", "KIR", "296"}, + {"Greece", "Grèce (la)", "GR", "GRC", "300"}, + {"Greenland", "Groenland (le)", "GL", "GRL", "304"}, + {"Grenada", "Grenade (la)", "GD", "GRD", "308"}, + {"Guadeloupe", "Guadeloupe (la)", "GP", "GLP", "312"}, + {"Guam", "Guam", "GU", "GUM", "316"}, + {"Guatemala", "Guatemala (le)", "GT", "GTM", "320"}, + {"Guinea", "Guinée (la)", "GN", "GIN", "324"}, + {"Guyana", "Guyana (le)", "GY", "GUY", "328"}, + {"Haiti", "Haïti", "HT", "HTI", "332"}, + {"Heard Island and McDonald Islands", "Heard-et-Îles MacDonald (l'Île)", "HM", "HMD", "334"}, + {"Holy See (the)", "Saint-Siège (le)", "VA", "VAT", "336"}, + {"Honduras", "Honduras (le)", "HN", "HND", "340"}, + {"Hong Kong", "Hong Kong", "HK", "HKG", "344"}, + {"Hungary", "Hongrie (la)", "HU", "HUN", "348"}, + {"Iceland", "Islande (l')", "IS", "ISL", "352"}, + {"India", "Inde (l')", "IN", "IND", "356"}, + {"Indonesia", "Indonésie (l')", "ID", "IDN", "360"}, + {"Iran (Islamic Republic of)", "Iran (République Islamique d')", "IR", "IRN", "364"}, + {"Iraq", "Iraq (l')", "IQ", "IRQ", "368"}, + {"Ireland", "Irlande (l')", "IE", "IRL", "372"}, + {"Israel", "Israël", "IL", "ISR", "376"}, + {"Italy", "Italie (l')", "IT", "ITA", "380"}, + {"Côte d'Ivoire", "Côte d'Ivoire (la)", "CI", "CIV", "384"}, + {"Jamaica", "Jamaïque (la)", "JM", "JAM", "388"}, + {"Japan", "Japon (le)", "JP", "JPN", "392"}, + {"Kazakhstan", "Kazakhstan (le)", "KZ", "KAZ", "398"}, + {"Jordan", "Jordanie (la)", "JO", "JOR", "400"}, + {"Kenya", "Kenya (le)", "KE", "KEN", "404"}, + {"Korea (the Democratic People's Republic of)", "Corée (la République populaire démocratique de)", "KP", "PRK", "408"}, + {"Korea (the Republic of)", "Corée (la République de)", "KR", "KOR", "410"}, + {"Kuwait", "Koweït (le)", "KW", "KWT", "414"}, + {"Kyrgyzstan", "Kirghizistan (le)", "KG", "KGZ", "417"}, + {"Lao People's Democratic Republic (the)", "Lao, République démocratique populaire", "LA", "LAO", "418"}, + {"Lebanon", "Liban (le)", "LB", "LBN", "422"}, + {"Lesotho", "Lesotho (le)", "LS", "LSO", "426"}, + {"Latvia", "Lettonie (la)", "LV", "LVA", "428"}, + {"Liberia", "Libéria (le)", "LR", "LBR", "430"}, + {"Libya", "Libye (la)", "LY", "LBY", "434"}, + {"Liechtenstein", "Liechtenstein (le)", "LI", "LIE", "438"}, + {"Lithuania", "Lituanie (la)", "LT", "LTU", "440"}, + {"Luxembourg", "Luxembourg (le)", "LU", "LUX", "442"}, + {"Macao", "Macao", "MO", "MAC", "446"}, + {"Madagascar", "Madagascar", "MG", "MDG", "450"}, + {"Malawi", "Malawi (le)", "MW", "MWI", "454"}, + {"Malaysia", "Malaisie (la)", "MY", "MYS", "458"}, + {"Maldives", "Maldives (les)", "MV", "MDV", "462"}, + {"Mali", "Mali (le)", "ML", "MLI", "466"}, + {"Malta", "Malte", "MT", "MLT", "470"}, + {"Martinique", "Martinique (la)", "MQ", "MTQ", "474"}, + {"Mauritania", "Mauritanie (la)", "MR", "MRT", "478"}, + {"Mauritius", "Maurice", "MU", "MUS", "480"}, + {"Mexico", "Mexique (le)", "MX", "MEX", "484"}, + {"Monaco", "Monaco", "MC", "MCO", "492"}, + {"Mongolia", "Mongolie (la)", "MN", "MNG", "496"}, + {"Moldova (the Republic of)", "Moldova , République de", "MD", "MDA", "498"}, + {"Montenegro", "Monténégro (le)", "ME", "MNE", "499"}, + {"Montserrat", "Montserrat", "MS", "MSR", "500"}, + {"Morocco", "Maroc (le)", "MA", "MAR", "504"}, + {"Mozambique", "Mozambique (le)", "MZ", "MOZ", "508"}, + {"Oman", "Oman", "OM", "OMN", "512"}, + {"Namibia", "Namibie (la)", "NA", "NAM", "516"}, + {"Nauru", "Nauru", "NR", "NRU", "520"}, + {"Nepal", "Népal (le)", "NP", "NPL", "524"}, + {"Netherlands (the)", "Pays-Bas (les)", "NL", "NLD", "528"}, + {"Curaçao", "Curaçao", "CW", "CUW", "531"}, + {"Aruba", "Aruba", "AW", "ABW", "533"}, + {"Sint Maarten (Dutch part)", "Saint-Martin (partie néerlandaise)", "SX", "SXM", "534"}, + {"Bonaire, Sint Eustatius and Saba", "Bonaire, Saint-Eustache et Saba", "BQ", "BES", "535"}, + {"New Caledonia", "Nouvelle-Calédonie (la)", "NC", "NCL", "540"}, + {"Vanuatu", "Vanuatu (le)", "VU", "VUT", "548"}, + {"New Zealand", "Nouvelle-Zélande (la)", "NZ", "NZL", "554"}, + {"Nicaragua", "Nicaragua (le)", "NI", "NIC", "558"}, + {"Niger (the)", "Niger (le)", "NE", "NER", "562"}, + {"Nigeria", "Nigéria (le)", "NG", "NGA", "566"}, + {"Niue", "Niue", "NU", "NIU", "570"}, + {"Norfolk Island", "Norfolk (l'Île)", "NF", "NFK", "574"}, + {"Norway", "Norvège (la)", "NO", "NOR", "578"}, + {"Northern Mariana Islands (the)", "Mariannes du Nord (les Îles)", "MP", "MNP", "580"}, + {"United States Minor Outlying Islands (the)", "Îles mineures éloignées des États-Unis (les)", "UM", "UMI", "581"}, + {"Micronesia (Federated States of)", "Micronésie (États fédérés de)", "FM", "FSM", "583"}, + {"Marshall Islands (the)", "Marshall (Îles)", "MH", "MHL", "584"}, + {"Palau", "Palaos (les)", "PW", "PLW", "585"}, + {"Pakistan", "Pakistan (le)", "PK", "PAK", "586"}, + {"Panama", "Panama (le)", "PA", "PAN", "591"}, + {"Papua New Guinea", "Papouasie-Nouvelle-Guinée (la)", "PG", "PNG", "598"}, + {"Paraguay", "Paraguay (le)", "PY", "PRY", "600"}, + {"Peru", "Pérou (le)", "PE", "PER", "604"}, + {"Philippines (the)", "Philippines (les)", "PH", "PHL", "608"}, + {"Pitcairn", "Pitcairn", "PN", "PCN", "612"}, + {"Poland", "Pologne (la)", "PL", "POL", "616"}, + {"Portugal", "Portugal (le)", "PT", "PRT", "620"}, + {"Guinea-Bissau", "Guinée-Bissau (la)", "GW", "GNB", "624"}, + {"Timor-Leste", "Timor-Leste (le)", "TL", "TLS", "626"}, + {"Puerto Rico", "Porto Rico", "PR", "PRI", "630"}, + {"Qatar", "Qatar (le)", "QA", "QAT", "634"}, + {"Réunion", "Réunion (La)", "RE", "REU", "638"}, + {"Romania", "Roumanie (la)", "RO", "ROU", "642"}, + {"Russian Federation (the)", "Russie (la Fédération de)", "RU", "RUS", "643"}, + {"Rwanda", "Rwanda (le)", "RW", "RWA", "646"}, + {"Saint Barthélemy", "Saint-Barthélemy", "BL", "BLM", "652"}, + {"Saint Helena, Ascension and Tristan da Cunha", "Sainte-Hélène, Ascension et Tristan da Cunha", "SH", "SHN", "654"}, + {"Saint Kitts and Nevis", "Saint-Kitts-et-Nevis", "KN", "KNA", "659"}, + {"Anguilla", "Anguilla", "AI", "AIA", "660"}, + {"Saint Lucia", "Sainte-Lucie", "LC", "LCA", "662"}, + {"Saint Martin (French part)", "Saint-Martin (partie française)", "MF", "MAF", "663"}, + {"Saint Pierre and Miquelon", "Saint-Pierre-et-Miquelon", "PM", "SPM", "666"}, + {"Saint Vincent and the Grenadines", "Saint-Vincent-et-les Grenadines", "VC", "VCT", "670"}, + {"San Marino", "Saint-Marin", "SM", "SMR", "674"}, + {"Sao Tome and Principe", "Sao Tomé-et-Principe", "ST", "STP", "678"}, + {"Saudi Arabia", "Arabie saoudite (l')", "SA", "SAU", "682"}, + {"Senegal", "Sénégal (le)", "SN", "SEN", "686"}, + {"Serbia", "Serbie (la)", "RS", "SRB", "688"}, + {"Seychelles", "Seychelles (les)", "SC", "SYC", "690"}, + {"Sierra Leone", "Sierra Leone (la)", "SL", "SLE", "694"}, + {"Singapore", "Singapour", "SG", "SGP", "702"}, + {"Slovakia", "Slovaquie (la)", "SK", "SVK", "703"}, + {"Viet Nam", "Viet Nam (le)", "VN", "VNM", "704"}, + {"Slovenia", "Slovénie (la)", "SI", "SVN", "705"}, + {"Somalia", "Somalie (la)", "SO", "SOM", "706"}, + {"South Africa", "Afrique du Sud (l')", "ZA", "ZAF", "710"}, + {"Zimbabwe", "Zimbabwe (le)", "ZW", "ZWE", "716"}, + {"Spain", "Espagne (l')", "ES", "ESP", "724"}, + {"South Sudan", "Soudan du Sud (le)", "SS", "SSD", "728"}, + {"Sudan (the)", "Soudan (le)", "SD", "SDN", "729"}, + {"Western Sahara*", "Sahara occidental (le)*", "EH", "ESH", "732"}, + {"Suriname", "Suriname (le)", "SR", "SUR", "740"}, + {"Svalbard and Jan Mayen", "Svalbard et l'Île Jan Mayen (le)", "SJ", "SJM", "744"}, + {"Swaziland", "Swaziland (le)", "SZ", "SWZ", "748"}, + {"Sweden", "Suède (la)", "SE", "SWE", "752"}, + {"Switzerland", "Suisse (la)", "CH", "CHE", "756"}, + {"Syrian Arab Republic", "République arabe syrienne (la)", "SY", "SYR", "760"}, + {"Tajikistan", "Tadjikistan (le)", "TJ", "TJK", "762"}, + {"Thailand", "Thaïlande (la)", "TH", "THA", "764"}, + {"Togo", "Togo (le)", "TG", "TGO", "768"}, + {"Tokelau", "Tokelau (les)", "TK", "TKL", "772"}, + {"Tonga", "Tonga (les)", "TO", "TON", "776"}, + {"Trinidad and Tobago", "Trinité-et-Tobago (la)", "TT", "TTO", "780"}, + {"United Arab Emirates (the)", "Émirats arabes unis (les)", "AE", "ARE", "784"}, + {"Tunisia", "Tunisie (la)", "TN", "TUN", "788"}, + {"Turkey", "Turquie (la)", "TR", "TUR", "792"}, + {"Turkmenistan", "Turkménistan (le)", "TM", "TKM", "795"}, + {"Turks and Caicos Islands (the)", "Turks-et-Caïcos (les Îles)", "TC", "TCA", "796"}, + {"Tuvalu", "Tuvalu (les)", "TV", "TUV", "798"}, + {"Uganda", "Ouganda (l')", "UG", "UGA", "800"}, + {"Ukraine", "Ukraine (l')", "UA", "UKR", "804"}, + {"Macedonia (the former Yugoslav Republic of)", "Macédoine (l'ex‑République yougoslave de)", "MK", "MKD", "807"}, + {"Egypt", "Égypte (l')", "EG", "EGY", "818"}, + {"United Kingdom of Great Britain and Northern Ireland (the)", "Royaume-Uni de Grande-Bretagne et d'Irlande du Nord (le)", "GB", "GBR", "826"}, + {"Guernsey", "Guernesey", "GG", "GGY", "831"}, + {"Jersey", "Jersey", "JE", "JEY", "832"}, + {"Isle of Man", "Île de Man", "IM", "IMN", "833"}, + {"Tanzania, United Republic of", "Tanzanie, République-Unie de", "TZ", "TZA", "834"}, + {"United States of America (the)", "États-Unis d'Amérique (les)", "US", "USA", "840"}, + {"Virgin Islands (U.S.)", "Vierges des États-Unis (les Îles)", "VI", "VIR", "850"}, + {"Burkina Faso", "Burkina Faso (le)", "BF", "BFA", "854"}, + {"Uruguay", "Uruguay (l')", "UY", "URY", "858"}, + {"Uzbekistan", "Ouzbékistan (l')", "UZ", "UZB", "860"}, + {"Venezuela (Bolivarian Republic of)", "Venezuela (République bolivarienne du)", "VE", "VEN", "862"}, + {"Wallis and Futuna", "Wallis-et-Futuna", "WF", "WLF", "876"}, + {"Samoa", "Samoa (le)", "WS", "WSM", "882"}, + {"Yemen", "Yémen (le)", "YE", "YEM", "887"}, + {"Zambia", "Zambie (la)", "ZM", "ZMB", "894"}, +} + +// ISO4217List is the list of ISO currency codes +var ISO4217List = []string{ + "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", + "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", + "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", + "DJF", "DKK", "DOP", "DZD", + "EGP", "ERN", "ETB", "EUR", + "FJD", "FKP", + "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", + "HKD", "HNL", "HRK", "HTG", "HUF", + "IDR", "ILS", "INR", "IQD", "IRR", "ISK", + "JMD", "JOD", "JPY", + "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", + "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", + "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", + "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", + "OMR", + "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", + "QAR", + "RON", "RSD", "RUB", "RWF", + "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", + "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", + "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UZS", + "VEF", "VND", "VUV", + "WST", + "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", + "YER", + "ZAR", "ZMW", "ZWL", +} + +// ISO693Entry stores ISO language codes +type ISO693Entry struct { + Alpha3bCode string + Alpha2Code string + English string +} + +//ISO693List based on http://data.okfn.org/data/core/language-codes/r/language-codes-3b2.json +var ISO693List = []ISO693Entry{ + {Alpha3bCode: "aar", Alpha2Code: "aa", English: "Afar"}, + {Alpha3bCode: "abk", Alpha2Code: "ab", English: "Abkhazian"}, + {Alpha3bCode: "afr", Alpha2Code: "af", English: "Afrikaans"}, + {Alpha3bCode: "aka", Alpha2Code: "ak", English: "Akan"}, + {Alpha3bCode: "alb", Alpha2Code: "sq", English: "Albanian"}, + {Alpha3bCode: "amh", Alpha2Code: "am", English: "Amharic"}, + {Alpha3bCode: "ara", Alpha2Code: "ar", English: "Arabic"}, + {Alpha3bCode: "arg", Alpha2Code: "an", English: "Aragonese"}, + {Alpha3bCode: "arm", Alpha2Code: "hy", English: "Armenian"}, + {Alpha3bCode: "asm", Alpha2Code: "as", English: "Assamese"}, + {Alpha3bCode: "ava", Alpha2Code: "av", English: "Avaric"}, + {Alpha3bCode: "ave", Alpha2Code: "ae", English: "Avestan"}, + {Alpha3bCode: "aym", Alpha2Code: "ay", English: "Aymara"}, + {Alpha3bCode: "aze", Alpha2Code: "az", English: "Azerbaijani"}, + {Alpha3bCode: "bak", Alpha2Code: "ba", English: "Bashkir"}, + {Alpha3bCode: "bam", Alpha2Code: "bm", English: "Bambara"}, + {Alpha3bCode: "baq", Alpha2Code: "eu", English: "Basque"}, + {Alpha3bCode: "bel", Alpha2Code: "be", English: "Belarusian"}, + {Alpha3bCode: "ben", Alpha2Code: "bn", English: "Bengali"}, + {Alpha3bCode: "bih", Alpha2Code: "bh", English: "Bihari languages"}, + {Alpha3bCode: "bis", Alpha2Code: "bi", English: "Bislama"}, + {Alpha3bCode: "bos", Alpha2Code: "bs", English: "Bosnian"}, + {Alpha3bCode: "bre", Alpha2Code: "br", English: "Breton"}, + {Alpha3bCode: "bul", Alpha2Code: "bg", English: "Bulgarian"}, + {Alpha3bCode: "bur", Alpha2Code: "my", English: "Burmese"}, + {Alpha3bCode: "cat", Alpha2Code: "ca", English: "Catalan; Valencian"}, + {Alpha3bCode: "cha", Alpha2Code: "ch", English: "Chamorro"}, + {Alpha3bCode: "che", Alpha2Code: "ce", English: "Chechen"}, + {Alpha3bCode: "chi", Alpha2Code: "zh", English: "Chinese"}, + {Alpha3bCode: "chu", Alpha2Code: "cu", English: "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"}, + {Alpha3bCode: "chv", Alpha2Code: "cv", English: "Chuvash"}, + {Alpha3bCode: "cor", Alpha2Code: "kw", English: "Cornish"}, + {Alpha3bCode: "cos", Alpha2Code: "co", English: "Corsican"}, + {Alpha3bCode: "cre", Alpha2Code: "cr", English: "Cree"}, + {Alpha3bCode: "cze", Alpha2Code: "cs", English: "Czech"}, + {Alpha3bCode: "dan", Alpha2Code: "da", English: "Danish"}, + {Alpha3bCode: "div", Alpha2Code: "dv", English: "Divehi; Dhivehi; Maldivian"}, + {Alpha3bCode: "dut", Alpha2Code: "nl", English: "Dutch; Flemish"}, + {Alpha3bCode: "dzo", Alpha2Code: "dz", English: "Dzongkha"}, + {Alpha3bCode: "eng", Alpha2Code: "en", English: "English"}, + {Alpha3bCode: "epo", Alpha2Code: "eo", English: "Esperanto"}, + {Alpha3bCode: "est", Alpha2Code: "et", English: "Estonian"}, + {Alpha3bCode: "ewe", Alpha2Code: "ee", English: "Ewe"}, + {Alpha3bCode: "fao", Alpha2Code: "fo", English: "Faroese"}, + {Alpha3bCode: "fij", Alpha2Code: "fj", English: "Fijian"}, + {Alpha3bCode: "fin", Alpha2Code: "fi", English: "Finnish"}, + {Alpha3bCode: "fre", Alpha2Code: "fr", English: "French"}, + {Alpha3bCode: "fry", Alpha2Code: "fy", English: "Western Frisian"}, + {Alpha3bCode: "ful", Alpha2Code: "ff", English: "Fulah"}, + {Alpha3bCode: "geo", Alpha2Code: "ka", English: "Georgian"}, + {Alpha3bCode: "ger", Alpha2Code: "de", English: "German"}, + {Alpha3bCode: "gla", Alpha2Code: "gd", English: "Gaelic; Scottish Gaelic"}, + {Alpha3bCode: "gle", Alpha2Code: "ga", English: "Irish"}, + {Alpha3bCode: "glg", Alpha2Code: "gl", English: "Galician"}, + {Alpha3bCode: "glv", Alpha2Code: "gv", English: "Manx"}, + {Alpha3bCode: "gre", Alpha2Code: "el", English: "Greek, Modern (1453-)"}, + {Alpha3bCode: "grn", Alpha2Code: "gn", English: "Guarani"}, + {Alpha3bCode: "guj", Alpha2Code: "gu", English: "Gujarati"}, + {Alpha3bCode: "hat", Alpha2Code: "ht", English: "Haitian; Haitian Creole"}, + {Alpha3bCode: "hau", Alpha2Code: "ha", English: "Hausa"}, + {Alpha3bCode: "heb", Alpha2Code: "he", English: "Hebrew"}, + {Alpha3bCode: "her", Alpha2Code: "hz", English: "Herero"}, + {Alpha3bCode: "hin", Alpha2Code: "hi", English: "Hindi"}, + {Alpha3bCode: "hmo", Alpha2Code: "ho", English: "Hiri Motu"}, + {Alpha3bCode: "hrv", Alpha2Code: "hr", English: "Croatian"}, + {Alpha3bCode: "hun", Alpha2Code: "hu", English: "Hungarian"}, + {Alpha3bCode: "ibo", Alpha2Code: "ig", English: "Igbo"}, + {Alpha3bCode: "ice", Alpha2Code: "is", English: "Icelandic"}, + {Alpha3bCode: "ido", Alpha2Code: "io", English: "Ido"}, + {Alpha3bCode: "iii", Alpha2Code: "ii", English: "Sichuan Yi; Nuosu"}, + {Alpha3bCode: "iku", Alpha2Code: "iu", English: "Inuktitut"}, + {Alpha3bCode: "ile", Alpha2Code: "ie", English: "Interlingue; Occidental"}, + {Alpha3bCode: "ina", Alpha2Code: "ia", English: "Interlingua (International Auxiliary Language Association)"}, + {Alpha3bCode: "ind", Alpha2Code: "id", English: "Indonesian"}, + {Alpha3bCode: "ipk", Alpha2Code: "ik", English: "Inupiaq"}, + {Alpha3bCode: "ita", Alpha2Code: "it", English: "Italian"}, + {Alpha3bCode: "jav", Alpha2Code: "jv", English: "Javanese"}, + {Alpha3bCode: "jpn", Alpha2Code: "ja", English: "Japanese"}, + {Alpha3bCode: "kal", Alpha2Code: "kl", English: "Kalaallisut; Greenlandic"}, + {Alpha3bCode: "kan", Alpha2Code: "kn", English: "Kannada"}, + {Alpha3bCode: "kas", Alpha2Code: "ks", English: "Kashmiri"}, + {Alpha3bCode: "kau", Alpha2Code: "kr", English: "Kanuri"}, + {Alpha3bCode: "kaz", Alpha2Code: "kk", English: "Kazakh"}, + {Alpha3bCode: "khm", Alpha2Code: "km", English: "Central Khmer"}, + {Alpha3bCode: "kik", Alpha2Code: "ki", English: "Kikuyu; Gikuyu"}, + {Alpha3bCode: "kin", Alpha2Code: "rw", English: "Kinyarwanda"}, + {Alpha3bCode: "kir", Alpha2Code: "ky", English: "Kirghiz; Kyrgyz"}, + {Alpha3bCode: "kom", Alpha2Code: "kv", English: "Komi"}, + {Alpha3bCode: "kon", Alpha2Code: "kg", English: "Kongo"}, + {Alpha3bCode: "kor", Alpha2Code: "ko", English: "Korean"}, + {Alpha3bCode: "kua", Alpha2Code: "kj", English: "Kuanyama; Kwanyama"}, + {Alpha3bCode: "kur", Alpha2Code: "ku", English: "Kurdish"}, + {Alpha3bCode: "lao", Alpha2Code: "lo", English: "Lao"}, + {Alpha3bCode: "lat", Alpha2Code: "la", English: "Latin"}, + {Alpha3bCode: "lav", Alpha2Code: "lv", English: "Latvian"}, + {Alpha3bCode: "lim", Alpha2Code: "li", English: "Limburgan; Limburger; Limburgish"}, + {Alpha3bCode: "lin", Alpha2Code: "ln", English: "Lingala"}, + {Alpha3bCode: "lit", Alpha2Code: "lt", English: "Lithuanian"}, + {Alpha3bCode: "ltz", Alpha2Code: "lb", English: "Luxembourgish; Letzeburgesch"}, + {Alpha3bCode: "lub", Alpha2Code: "lu", English: "Luba-Katanga"}, + {Alpha3bCode: "lug", Alpha2Code: "lg", English: "Ganda"}, + {Alpha3bCode: "mac", Alpha2Code: "mk", English: "Macedonian"}, + {Alpha3bCode: "mah", Alpha2Code: "mh", English: "Marshallese"}, + {Alpha3bCode: "mal", Alpha2Code: "ml", English: "Malayalam"}, + {Alpha3bCode: "mao", Alpha2Code: "mi", English: "Maori"}, + {Alpha3bCode: "mar", Alpha2Code: "mr", English: "Marathi"}, + {Alpha3bCode: "may", Alpha2Code: "ms", English: "Malay"}, + {Alpha3bCode: "mlg", Alpha2Code: "mg", English: "Malagasy"}, + {Alpha3bCode: "mlt", Alpha2Code: "mt", English: "Maltese"}, + {Alpha3bCode: "mon", Alpha2Code: "mn", English: "Mongolian"}, + {Alpha3bCode: "nau", Alpha2Code: "na", English: "Nauru"}, + {Alpha3bCode: "nav", Alpha2Code: "nv", English: "Navajo; Navaho"}, + {Alpha3bCode: "nbl", Alpha2Code: "nr", English: "Ndebele, South; South Ndebele"}, + {Alpha3bCode: "nde", Alpha2Code: "nd", English: "Ndebele, North; North Ndebele"}, + {Alpha3bCode: "ndo", Alpha2Code: "ng", English: "Ndonga"}, + {Alpha3bCode: "nep", Alpha2Code: "ne", English: "Nepali"}, + {Alpha3bCode: "nno", Alpha2Code: "nn", English: "Norwegian Nynorsk; Nynorsk, Norwegian"}, + {Alpha3bCode: "nob", Alpha2Code: "nb", English: "Bokmål, Norwegian; Norwegian Bokmål"}, + {Alpha3bCode: "nor", Alpha2Code: "no", English: "Norwegian"}, + {Alpha3bCode: "nya", Alpha2Code: "ny", English: "Chichewa; Chewa; Nyanja"}, + {Alpha3bCode: "oci", Alpha2Code: "oc", English: "Occitan (post 1500); Provençal"}, + {Alpha3bCode: "oji", Alpha2Code: "oj", English: "Ojibwa"}, + {Alpha3bCode: "ori", Alpha2Code: "or", English: "Oriya"}, + {Alpha3bCode: "orm", Alpha2Code: "om", English: "Oromo"}, + {Alpha3bCode: "oss", Alpha2Code: "os", English: "Ossetian; Ossetic"}, + {Alpha3bCode: "pan", Alpha2Code: "pa", English: "Panjabi; Punjabi"}, + {Alpha3bCode: "per", Alpha2Code: "fa", English: "Persian"}, + {Alpha3bCode: "pli", Alpha2Code: "pi", English: "Pali"}, + {Alpha3bCode: "pol", Alpha2Code: "pl", English: "Polish"}, + {Alpha3bCode: "por", Alpha2Code: "pt", English: "Portuguese"}, + {Alpha3bCode: "pus", Alpha2Code: "ps", English: "Pushto; Pashto"}, + {Alpha3bCode: "que", Alpha2Code: "qu", English: "Quechua"}, + {Alpha3bCode: "roh", Alpha2Code: "rm", English: "Romansh"}, + {Alpha3bCode: "rum", Alpha2Code: "ro", English: "Romanian; Moldavian; Moldovan"}, + {Alpha3bCode: "run", Alpha2Code: "rn", English: "Rundi"}, + {Alpha3bCode: "rus", Alpha2Code: "ru", English: "Russian"}, + {Alpha3bCode: "sag", Alpha2Code: "sg", English: "Sango"}, + {Alpha3bCode: "san", Alpha2Code: "sa", English: "Sanskrit"}, + {Alpha3bCode: "sin", Alpha2Code: "si", English: "Sinhala; Sinhalese"}, + {Alpha3bCode: "slo", Alpha2Code: "sk", English: "Slovak"}, + {Alpha3bCode: "slv", Alpha2Code: "sl", English: "Slovenian"}, + {Alpha3bCode: "sme", Alpha2Code: "se", English: "Northern Sami"}, + {Alpha3bCode: "smo", Alpha2Code: "sm", English: "Samoan"}, + {Alpha3bCode: "sna", Alpha2Code: "sn", English: "Shona"}, + {Alpha3bCode: "snd", Alpha2Code: "sd", English: "Sindhi"}, + {Alpha3bCode: "som", Alpha2Code: "so", English: "Somali"}, + {Alpha3bCode: "sot", Alpha2Code: "st", English: "Sotho, Southern"}, + {Alpha3bCode: "spa", Alpha2Code: "es", English: "Spanish; Castilian"}, + {Alpha3bCode: "srd", Alpha2Code: "sc", English: "Sardinian"}, + {Alpha3bCode: "srp", Alpha2Code: "sr", English: "Serbian"}, + {Alpha3bCode: "ssw", Alpha2Code: "ss", English: "Swati"}, + {Alpha3bCode: "sun", Alpha2Code: "su", English: "Sundanese"}, + {Alpha3bCode: "swa", Alpha2Code: "sw", English: "Swahili"}, + {Alpha3bCode: "swe", Alpha2Code: "sv", English: "Swedish"}, + {Alpha3bCode: "tah", Alpha2Code: "ty", English: "Tahitian"}, + {Alpha3bCode: "tam", Alpha2Code: "ta", English: "Tamil"}, + {Alpha3bCode: "tat", Alpha2Code: "tt", English: "Tatar"}, + {Alpha3bCode: "tel", Alpha2Code: "te", English: "Telugu"}, + {Alpha3bCode: "tgk", Alpha2Code: "tg", English: "Tajik"}, + {Alpha3bCode: "tgl", Alpha2Code: "tl", English: "Tagalog"}, + {Alpha3bCode: "tha", Alpha2Code: "th", English: "Thai"}, + {Alpha3bCode: "tib", Alpha2Code: "bo", English: "Tibetan"}, + {Alpha3bCode: "tir", Alpha2Code: "ti", English: "Tigrinya"}, + {Alpha3bCode: "ton", Alpha2Code: "to", English: "Tonga (Tonga Islands)"}, + {Alpha3bCode: "tsn", Alpha2Code: "tn", English: "Tswana"}, + {Alpha3bCode: "tso", Alpha2Code: "ts", English: "Tsonga"}, + {Alpha3bCode: "tuk", Alpha2Code: "tk", English: "Turkmen"}, + {Alpha3bCode: "tur", Alpha2Code: "tr", English: "Turkish"}, + {Alpha3bCode: "twi", Alpha2Code: "tw", English: "Twi"}, + {Alpha3bCode: "uig", Alpha2Code: "ug", English: "Uighur; Uyghur"}, + {Alpha3bCode: "ukr", Alpha2Code: "uk", English: "Ukrainian"}, + {Alpha3bCode: "urd", Alpha2Code: "ur", English: "Urdu"}, + {Alpha3bCode: "uzb", Alpha2Code: "uz", English: "Uzbek"}, + {Alpha3bCode: "ven", Alpha2Code: "ve", English: "Venda"}, + {Alpha3bCode: "vie", Alpha2Code: "vi", English: "Vietnamese"}, + {Alpha3bCode: "vol", Alpha2Code: "vo", English: "Volapük"}, + {Alpha3bCode: "wel", Alpha2Code: "cy", English: "Welsh"}, + {Alpha3bCode: "wln", Alpha2Code: "wa", English: "Walloon"}, + {Alpha3bCode: "wol", Alpha2Code: "wo", English: "Wolof"}, + {Alpha3bCode: "xho", Alpha2Code: "xh", English: "Xhosa"}, + {Alpha3bCode: "yid", Alpha2Code: "yi", English: "Yiddish"}, + {Alpha3bCode: "yor", Alpha2Code: "yo", English: "Yoruba"}, + {Alpha3bCode: "zha", Alpha2Code: "za", English: "Zhuang; Chuang"}, + {Alpha3bCode: "zul", Alpha2Code: "zu", English: "Zulu"}, +} diff --git a/go/vendor/github.com/asaskevich/govalidator/utils.go b/go/vendor/github.com/asaskevich/govalidator/utils.go new file mode 100644 index 0000000..6a8871c --- /dev/null +++ b/go/vendor/github.com/asaskevich/govalidator/utils.go @@ -0,0 +1,264 @@ +package govalidator + +import ( + "errors" + "fmt" + "html" + "math" + "path" + "regexp" + "strings" + "unicode" + "unicode/utf8" +) + +// Contains check if the string contains the substring. +func Contains(str, substring string) bool { + return strings.Contains(str, substring) +} + +// Matches check if string matches the pattern (pattern is regular expression) +// In case of error return false +func Matches(str, pattern string) bool { + match, _ := regexp.MatchString(pattern, str) + return match +} + +// LeftTrim trim characters from the left-side of the input. +// If second argument is empty, it's will be remove leading spaces. +func LeftTrim(str, chars string) string { + if chars == "" { + return strings.TrimLeftFunc(str, unicode.IsSpace) + } + r, _ := regexp.Compile("^[" + chars + "]+") + return r.ReplaceAllString(str, "") +} + +// RightTrim trim characters from the right-side of the input. +// If second argument is empty, it's will be remove spaces. +func RightTrim(str, chars string) string { + if chars == "" { + return strings.TrimRightFunc(str, unicode.IsSpace) + } + r, _ := regexp.Compile("[" + chars + "]+$") + return r.ReplaceAllString(str, "") +} + +// Trim trim characters from both sides of the input. +// If second argument is empty, it's will be remove spaces. +func Trim(str, chars string) string { + return LeftTrim(RightTrim(str, chars), chars) +} + +// WhiteList remove characters that do not appear in the whitelist. +func WhiteList(str, chars string) string { + pattern := "[^" + chars + "]+" + r, _ := regexp.Compile(pattern) + return r.ReplaceAllString(str, "") +} + +// BlackList remove characters that appear in the blacklist. +func BlackList(str, chars string) string { + pattern := "[" + chars + "]+" + r, _ := regexp.Compile(pattern) + return r.ReplaceAllString(str, "") +} + +// StripLow remove characters with a numerical value < 32 and 127, mostly control characters. +// If keep_new_lines is true, newline characters are preserved (\n and \r, hex 0xA and 0xD). +func StripLow(str string, keepNewLines bool) string { + chars := "" + if keepNewLines { + chars = "\x00-\x09\x0B\x0C\x0E-\x1F\x7F" + } else { + chars = "\x00-\x1F\x7F" + } + return BlackList(str, chars) +} + +// ReplacePattern replace regular expression pattern in string +func ReplacePattern(str, pattern, replace string) string { + r, _ := regexp.Compile(pattern) + return r.ReplaceAllString(str, replace) +} + +// Escape replace <, >, & and " with HTML entities. +var Escape = html.EscapeString + +func addSegment(inrune, segment []rune) []rune { + if len(segment) == 0 { + return inrune + } + if len(inrune) != 0 { + inrune = append(inrune, '_') + } + inrune = append(inrune, segment...) + return inrune +} + +// UnderscoreToCamelCase converts from underscore separated form to camel case form. +// Ex.: my_func => MyFunc +func UnderscoreToCamelCase(s string) string { + return strings.Replace(strings.Title(strings.Replace(strings.ToLower(s), "_", " ", -1)), " ", "", -1) +} + +// CamelCaseToUnderscore converts from camel case form to underscore separated form. +// Ex.: MyFunc => my_func +func CamelCaseToUnderscore(str string) string { + var output []rune + var segment []rune + for _, r := range str { + + // not treat number as separate segment + if !unicode.IsLower(r) && string(r) != "_" && !unicode.IsNumber(r) { + output = addSegment(output, segment) + segment = nil + } + segment = append(segment, unicode.ToLower(r)) + } + output = addSegment(output, segment) + return string(output) +} + +// Reverse return reversed string +func Reverse(s string) string { + r := []rune(s) + for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 { + r[i], r[j] = r[j], r[i] + } + return string(r) +} + +// GetLines split string by "\n" and return array of lines +func GetLines(s string) []string { + return strings.Split(s, "\n") +} + +// GetLine return specified line of multiline string +func GetLine(s string, index int) (string, error) { + lines := GetLines(s) + if index < 0 || index >= len(lines) { + return "", errors.New("line index out of bounds") + } + return lines[index], nil +} + +// RemoveTags remove all tags from HTML string +func RemoveTags(s string) string { + return ReplacePattern(s, "<[^>]*>", "") +} + +// SafeFileName return safe string that can be used in file names +func SafeFileName(str string) string { + name := strings.ToLower(str) + name = path.Clean(path.Base(name)) + name = strings.Trim(name, " ") + separators, err := regexp.Compile(`[ &_=+:]`) + if err == nil { + name = separators.ReplaceAllString(name, "-") + } + legal, err := regexp.Compile(`[^[:alnum:]-.]`) + if err == nil { + name = legal.ReplaceAllString(name, "") + } + for strings.Contains(name, "--") { + name = strings.Replace(name, "--", "-", -1) + } + return name +} + +// NormalizeEmail canonicalize an email address. +// The local part of the email address is lowercased for all domains; the hostname is always lowercased and +// the local part of the email address is always lowercased for hosts that are known to be case-insensitive (currently only GMail). +// Normalization follows special rules for known providers: currently, GMail addresses have dots removed in the local part and +// are stripped of tags (e.g. some.one+tag@gmail.com becomes someone@gmail.com) and all @googlemail.com addresses are +// normalized to @gmail.com. +func NormalizeEmail(str string) (string, error) { + if !IsEmail(str) { + return "", fmt.Errorf("%s is not an email", str) + } + parts := strings.Split(str, "@") + parts[0] = strings.ToLower(parts[0]) + parts[1] = strings.ToLower(parts[1]) + if parts[1] == "gmail.com" || parts[1] == "googlemail.com" { + parts[1] = "gmail.com" + parts[0] = strings.Split(ReplacePattern(parts[0], `\.`, ""), "+")[0] + } + return strings.Join(parts, "@"), nil +} + +// Truncate a string to the closest length without breaking words. +func Truncate(str string, length int, ending string) string { + var aftstr, befstr string + if len(str) > length { + words := strings.Fields(str) + before, present := 0, 0 + for i := range words { + befstr = aftstr + before = present + aftstr = aftstr + words[i] + " " + present = len(aftstr) + if present > length && i != 0 { + if (length - before) < (present - length) { + return Trim(befstr, " /\\.,\"'#!?&@+-") + ending + } + return Trim(aftstr, " /\\.,\"'#!?&@+-") + ending + } + } + } + + return str +} + +// PadLeft pad left side of string if size of string is less then indicated pad length +func PadLeft(str string, padStr string, padLen int) string { + return buildPadStr(str, padStr, padLen, true, false) +} + +// PadRight pad right side of string if size of string is less then indicated pad length +func PadRight(str string, padStr string, padLen int) string { + return buildPadStr(str, padStr, padLen, false, true) +} + +// PadBoth pad sides of string if size of string is less then indicated pad length +func PadBoth(str string, padStr string, padLen int) string { + return buildPadStr(str, padStr, padLen, true, true) +} + +// PadString either left, right or both sides, not the padding string can be unicode and more then one +// character +func buildPadStr(str string, padStr string, padLen int, padLeft bool, padRight bool) string { + + // When padded length is less then the current string size + if padLen < utf8.RuneCountInString(str) { + return str + } + + padLen -= utf8.RuneCountInString(str) + + targetLen := padLen + + targetLenLeft := targetLen + targetLenRight := targetLen + if padLeft && padRight { + targetLenLeft = padLen / 2 + targetLenRight = padLen - targetLenLeft + } + + strToRepeatLen := utf8.RuneCountInString(padStr) + + repeatTimes := int(math.Ceil(float64(targetLen) / float64(strToRepeatLen))) + repeatedString := strings.Repeat(padStr, repeatTimes) + + leftSide := "" + if padLeft { + leftSide = repeatedString[0:targetLenLeft] + } + + rightSide := "" + if padRight { + rightSide = repeatedString[0:targetLenRight] + } + + return leftSide + str + rightSide +} diff --git a/go/vendor/github.com/asaskevich/govalidator/validator.go b/go/vendor/github.com/asaskevich/govalidator/validator.go new file mode 100644 index 0000000..071f43c --- /dev/null +++ b/go/vendor/github.com/asaskevich/govalidator/validator.go @@ -0,0 +1,1213 @@ +// Package govalidator is package of validators and sanitizers for strings, structs and collections. +package govalidator + +import ( + "bytes" + "crypto/rsa" + "crypto/x509" + "encoding/base64" + "encoding/json" + "encoding/pem" + "fmt" + "io/ioutil" + "net" + "net/url" + "reflect" + "regexp" + "sort" + "strconv" + "strings" + "time" + "unicode" + "unicode/utf8" +) + +var ( + fieldsRequiredByDefault bool + notNumberRegexp = regexp.MustCompile("[^0-9]+") + whiteSpacesAndMinus = regexp.MustCompile("[\\s-]+") + paramsRegexp = regexp.MustCompile("\\(.*\\)$") +) + +const maxURLRuneCount = 2083 +const minURLRuneCount = 3 +const RF3339WithoutZone = "2006-01-02T15:04:05" + +// SetFieldsRequiredByDefault causes validation to fail when struct fields +// do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). +// This struct definition will fail govalidator.ValidateStruct() (and the field values do not matter): +// type exampleStruct struct { +// Name string `` +// Email string `valid:"email"` +// This, however, will only fail when Email is empty or an invalid email address: +// type exampleStruct2 struct { +// Name string `valid:"-"` +// Email string `valid:"email"` +// Lastly, this will only fail when Email is an invalid email address but not when it's empty: +// type exampleStruct2 struct { +// Name string `valid:"-"` +// Email string `valid:"email,optional"` +func SetFieldsRequiredByDefault(value bool) { + fieldsRequiredByDefault = value +} + +// IsEmail check if the string is an email. +func IsEmail(email string) bool { + if len(email) < 6 || len(email) > 254 { + return false + } + at := strings.LastIndex(email, "@") + if at <= 0 || at > len(email)-3 { + return false + } + user := email[:at] + host := email[at+1:] + if len(user) > 64 { + return false + } + if userDotRegexp.MatchString(user) || !userRegexp.MatchString(user) || !hostRegexp.MatchString(host) { + return false + } + switch host { + case "localhost", "example.com": + return true + } + if _, err := net.LookupMX(host); err != nil { + if _, err := net.LookupIP(host); err != nil { + return false + } + } + + return true +} + +// IsURL check if the string is an URL. +func IsURL(str string) bool { + if str == "" || utf8.RuneCountInString(str) >= maxURLRuneCount || len(str) <= minURLRuneCount || strings.HasPrefix(str, ".") { + return false + } + strTemp := str + if strings.Index(str, ":") >= 0 && strings.Index(str, "://") == -1 { + // support no indicated urlscheme but with colon for port number + // http:// is appended so url.Parse will succeed, strTemp used so it does not impact rxURL.MatchString + strTemp = "http://" + str + } + u, err := url.Parse(strTemp) + if err != nil { + return false + } + if strings.HasPrefix(u.Host, ".") { + return false + } + if u.Host == "" && (u.Path != "" && !strings.Contains(u.Path, ".")) { + return false + } + return rxURL.MatchString(str) +} + +// IsRequestURL check if the string rawurl, assuming +// it was received in an HTTP request, is a valid +// URL confirm to RFC 3986 +func IsRequestURL(rawurl string) bool { + url, err := url.ParseRequestURI(rawurl) + if err != nil { + return false //Couldn't even parse the rawurl + } + if len(url.Scheme) == 0 { + return false //No Scheme found + } + return true +} + +// IsRequestURI check if the string rawurl, assuming +// it was received in an HTTP request, is an +// absolute URI or an absolute path. +func IsRequestURI(rawurl string) bool { + _, err := url.ParseRequestURI(rawurl) + return err == nil +} + +// IsAlpha check if the string contains only letters (a-zA-Z). Empty string is valid. +func IsAlpha(str string) bool { + if IsNull(str) { + return true + } + return rxAlpha.MatchString(str) +} + +//IsUTFLetter check if the string contains only unicode letter characters. +//Similar to IsAlpha but for all languages. Empty string is valid. +func IsUTFLetter(str string) bool { + if IsNull(str) { + return true + } + + for _, c := range str { + if !unicode.IsLetter(c) { + return false + } + } + return true + +} + +// IsAlphanumeric check if the string contains only letters and numbers. Empty string is valid. +func IsAlphanumeric(str string) bool { + if IsNull(str) { + return true + } + return rxAlphanumeric.MatchString(str) +} + +// IsUTFLetterNumeric check if the string contains only unicode letters and numbers. Empty string is valid. +func IsUTFLetterNumeric(str string) bool { + if IsNull(str) { + return true + } + for _, c := range str { + if !unicode.IsLetter(c) && !unicode.IsNumber(c) { //letters && numbers are ok + return false + } + } + return true + +} + +// IsNumeric check if the string contains only numbers. Empty string is valid. +func IsNumeric(str string) bool { + if IsNull(str) { + return true + } + return rxNumeric.MatchString(str) +} + +// IsUTFNumeric check if the string contains only unicode numbers of any kind. +// Numbers can be 0-9 but also Fractions ¾,Roman Ⅸ and Hangzhou 〩. Empty string is valid. +func IsUTFNumeric(str string) bool { + if IsNull(str) { + return true + } + if strings.IndexAny(str, "+-") > 0 { + return false + } + if len(str) > 1 { + str = strings.TrimPrefix(str, "-") + str = strings.TrimPrefix(str, "+") + } + for _, c := range str { + if unicode.IsNumber(c) == false { //numbers && minus sign are ok + return false + } + } + return true + +} + +// IsUTFDigit check if the string contains only unicode radix-10 decimal digits. Empty string is valid. +func IsUTFDigit(str string) bool { + if IsNull(str) { + return true + } + if strings.IndexAny(str, "+-") > 0 { + return false + } + if len(str) > 1 { + str = strings.TrimPrefix(str, "-") + str = strings.TrimPrefix(str, "+") + } + for _, c := range str { + if !unicode.IsDigit(c) { //digits && minus sign are ok + return false + } + } + return true + +} + +// IsHexadecimal check if the string is a hexadecimal number. +func IsHexadecimal(str string) bool { + return rxHexadecimal.MatchString(str) +} + +// IsHexcolor check if the string is a hexadecimal color. +func IsHexcolor(str string) bool { + return rxHexcolor.MatchString(str) +} + +// IsRGBcolor check if the string is a valid RGB color in form rgb(RRR, GGG, BBB). +func IsRGBcolor(str string) bool { + return rxRGBcolor.MatchString(str) +} + +// IsLowerCase check if the string is lowercase. Empty string is valid. +func IsLowerCase(str string) bool { + if IsNull(str) { + return true + } + return str == strings.ToLower(str) +} + +// IsUpperCase check if the string is uppercase. Empty string is valid. +func IsUpperCase(str string) bool { + if IsNull(str) { + return true + } + return str == strings.ToUpper(str) +} + +// HasLowerCase check if the string contains at least 1 lowercase. Empty string is valid. +func HasLowerCase(str string) bool { + if IsNull(str) { + return true + } + return rxHasLowerCase.MatchString(str) +} + +// HasUpperCase check if the string contians as least 1 uppercase. Empty string is valid. +func HasUpperCase(str string) bool { + if IsNull(str) { + return true + } + return rxHasUpperCase.MatchString(str) +} + +// IsInt check if the string is an integer. Empty string is valid. +func IsInt(str string) bool { + if IsNull(str) { + return true + } + return rxInt.MatchString(str) +} + +// IsFloat check if the string is a float. +func IsFloat(str string) bool { + return str != "" && rxFloat.MatchString(str) +} + +// IsDivisibleBy check if the string is a number that's divisible by another. +// If second argument is not valid integer or zero, it's return false. +// Otherwise, if first argument is not valid integer or zero, it's return true (Invalid string converts to zero). +func IsDivisibleBy(str, num string) bool { + f, _ := ToFloat(str) + p := int64(f) + q, _ := ToInt(num) + if q == 0 { + return false + } + return (p == 0) || (p%q == 0) +} + +// IsNull check if the string is null. +func IsNull(str string) bool { + return len(str) == 0 +} + +// IsByteLength check if the string's length (in bytes) falls in a range. +func IsByteLength(str string, min, max int) bool { + return len(str) >= min && len(str) <= max +} + +// IsUUIDv3 check if the string is a UUID version 3. +func IsUUIDv3(str string) bool { + return rxUUID3.MatchString(str) +} + +// IsUUIDv4 check if the string is a UUID version 4. +func IsUUIDv4(str string) bool { + return rxUUID4.MatchString(str) +} + +// IsUUIDv5 check if the string is a UUID version 5. +func IsUUIDv5(str string) bool { + return rxUUID5.MatchString(str) +} + +// IsUUID check if the string is a UUID (version 3, 4 or 5). +func IsUUID(str string) bool { + return rxUUID.MatchString(str) +} + +// IsCreditCard check if the string is a credit card. +func IsCreditCard(str string) bool { + sanitized := notNumberRegexp.ReplaceAllString(str, "") + if !rxCreditCard.MatchString(sanitized) { + return false + } + var sum int64 + var digit string + var tmpNum int64 + var shouldDouble bool + for i := len(sanitized) - 1; i >= 0; i-- { + digit = sanitized[i:(i + 1)] + tmpNum, _ = ToInt(digit) + if shouldDouble { + tmpNum *= 2 + if tmpNum >= 10 { + sum += ((tmpNum % 10) + 1) + } else { + sum += tmpNum + } + } else { + sum += tmpNum + } + shouldDouble = !shouldDouble + } + + if sum%10 == 0 { + return true + } + return false +} + +// IsISBN10 check if the string is an ISBN version 10. +func IsISBN10(str string) bool { + return IsISBN(str, 10) +} + +// IsISBN13 check if the string is an ISBN version 13. +func IsISBN13(str string) bool { + return IsISBN(str, 13) +} + +// IsISBN check if the string is an ISBN (version 10 or 13). +// If version value is not equal to 10 or 13, it will be check both variants. +func IsISBN(str string, version int) bool { + sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "") + var checksum int32 + var i int32 + if version == 10 { + if !rxISBN10.MatchString(sanitized) { + return false + } + for i = 0; i < 9; i++ { + checksum += (i + 1) * int32(sanitized[i]-'0') + } + if sanitized[9] == 'X' { + checksum += 10 * 10 + } else { + checksum += 10 * int32(sanitized[9]-'0') + } + if checksum%11 == 0 { + return true + } + return false + } else if version == 13 { + if !rxISBN13.MatchString(sanitized) { + return false + } + factor := []int32{1, 3} + for i = 0; i < 12; i++ { + checksum += factor[i%2] * int32(sanitized[i]-'0') + } + if (int32(sanitized[12]-'0'))-((10-(checksum%10))%10) == 0 { + return true + } + return false + } + return IsISBN(str, 10) || IsISBN(str, 13) +} + +// IsJSON check if the string is valid JSON (note: uses json.Unmarshal). +func IsJSON(str string) bool { + var js json.RawMessage + return json.Unmarshal([]byte(str), &js) == nil +} + +// IsMultibyte check if the string contains one or more multibyte chars. Empty string is valid. +func IsMultibyte(str string) bool { + if IsNull(str) { + return true + } + return rxMultibyte.MatchString(str) +} + +// IsASCII check if the string contains ASCII chars only. Empty string is valid. +func IsASCII(str string) bool { + if IsNull(str) { + return true + } + return rxASCII.MatchString(str) +} + +// IsPrintableASCII check if the string contains printable ASCII chars only. Empty string is valid. +func IsPrintableASCII(str string) bool { + if IsNull(str) { + return true + } + return rxPrintableASCII.MatchString(str) +} + +// IsFullWidth check if the string contains any full-width chars. Empty string is valid. +func IsFullWidth(str string) bool { + if IsNull(str) { + return true + } + return rxFullWidth.MatchString(str) +} + +// IsHalfWidth check if the string contains any half-width chars. Empty string is valid. +func IsHalfWidth(str string) bool { + if IsNull(str) { + return true + } + return rxHalfWidth.MatchString(str) +} + +// IsVariableWidth check if the string contains a mixture of full and half-width chars. Empty string is valid. +func IsVariableWidth(str string) bool { + if IsNull(str) { + return true + } + return rxHalfWidth.MatchString(str) && rxFullWidth.MatchString(str) +} + +// IsBase64 check if a string is base64 encoded. +func IsBase64(str string) bool { + return rxBase64.MatchString(str) +} + +// IsFilePath check is a string is Win or Unix file path and returns it's type. +func IsFilePath(str string) (bool, int) { + if rxWinPath.MatchString(str) { + //check windows path limit see: + // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath + if len(str[3:]) > 32767 { + return false, Win + } + return true, Win + } else if rxUnixPath.MatchString(str) { + return true, Unix + } + return false, Unknown +} + +// IsDataURI checks if a string is base64 encoded data URI such as an image +func IsDataURI(str string) bool { + dataURI := strings.Split(str, ",") + if !rxDataURI.MatchString(dataURI[0]) { + return false + } + return IsBase64(dataURI[1]) +} + +// IsISO3166Alpha2 checks if a string is valid two-letter country code +func IsISO3166Alpha2(str string) bool { + for _, entry := range ISO3166List { + if str == entry.Alpha2Code { + return true + } + } + return false +} + +// IsISO3166Alpha3 checks if a string is valid three-letter country code +func IsISO3166Alpha3(str string) bool { + for _, entry := range ISO3166List { + if str == entry.Alpha3Code { + return true + } + } + return false +} + +// IsISO693Alpha2 checks if a string is valid two-letter language code +func IsISO693Alpha2(str string) bool { + for _, entry := range ISO693List { + if str == entry.Alpha2Code { + return true + } + } + return false +} + +// IsISO693Alpha3b checks if a string is valid three-letter language code +func IsISO693Alpha3b(str string) bool { + for _, entry := range ISO693List { + if str == entry.Alpha3bCode { + return true + } + } + return false +} + +// IsDNSName will validate the given string as a DNS name +func IsDNSName(str string) bool { + if str == "" || len(strings.Replace(str, ".", "", -1)) > 255 { + // constraints already violated + return false + } + return !IsIP(str) && rxDNSName.MatchString(str) +} + +// IsHash checks if a string is a hash of type algorithm. +// Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b'] +func IsHash(str string, algorithm string) bool { + len := "0" + algo := strings.ToLower(algorithm) + + if algo == "crc32" || algo == "crc32b" { + len = "8" + } else if algo == "md5" || algo == "md4" || algo == "ripemd128" || algo == "tiger128" { + len = "32" + } else if algo == "sha1" || algo == "ripemd160" || algo == "tiger160" { + len = "40" + } else if algo == "tiger192" { + len = "48" + } else if algo == "sha256" { + len = "64" + } else if algo == "sha384" { + len = "96" + } else if algo == "sha512" { + len = "128" + } else { + return false + } + + return Matches(str, "^[a-f0-9]{"+len+"}$") +} + +// IsDialString validates the given string for usage with the various Dial() functions +func IsDialString(str string) bool { + + if h, p, err := net.SplitHostPort(str); err == nil && h != "" && p != "" && (IsDNSName(h) || IsIP(h)) && IsPort(p) { + return true + } + + return false +} + +// IsIP checks if a string is either IP version 4 or 6. +func IsIP(str string) bool { + return net.ParseIP(str) != nil +} + +// IsPort checks if a string represents a valid port +func IsPort(str string) bool { + if i, err := strconv.Atoi(str); err == nil && i > 0 && i < 65536 { + return true + } + return false +} + +// IsIPv4 check if the string is an IP version 4. +func IsIPv4(str string) bool { + ip := net.ParseIP(str) + return ip != nil && strings.Contains(str, ".") +} + +// IsIPv6 check if the string is an IP version 6. +func IsIPv6(str string) bool { + ip := net.ParseIP(str) + return ip != nil && strings.Contains(str, ":") +} + +// IsCIDR check if the string is an valid CIDR notiation (IPV4 & IPV6) +func IsCIDR(str string) bool { + _, _, err := net.ParseCIDR(str) + return err == nil +} + +// IsMAC check if a string is valid MAC address. +// Possible MAC formats: +// 01:23:45:67:89:ab +// 01:23:45:67:89:ab:cd:ef +// 01-23-45-67-89-ab +// 01-23-45-67-89-ab-cd-ef +// 0123.4567.89ab +// 0123.4567.89ab.cdef +func IsMAC(str string) bool { + _, err := net.ParseMAC(str) + return err == nil +} + +// IsHost checks if the string is a valid IP (both v4 and v6) or a valid DNS name +func IsHost(str string) bool { + return IsIP(str) || IsDNSName(str) +} + +// IsMongoID check if the string is a valid hex-encoded representation of a MongoDB ObjectId. +func IsMongoID(str string) bool { + return rxHexadecimal.MatchString(str) && (len(str) == 24) +} + +// IsLatitude check if a string is valid latitude. +func IsLatitude(str string) bool { + return rxLatitude.MatchString(str) +} + +// IsLongitude check if a string is valid longitude. +func IsLongitude(str string) bool { + return rxLongitude.MatchString(str) +} + +// IsRsaPublicKey check if a string is valid public key with provided length +func IsRsaPublicKey(str string, keylen int) bool { + bb := bytes.NewBufferString(str) + pemBytes, err := ioutil.ReadAll(bb) + if err != nil { + return false + } + block, _ := pem.Decode(pemBytes) + if block != nil && block.Type != "PUBLIC KEY" { + return false + } + var der []byte + + if block != nil { + der = block.Bytes + } else { + der, err = base64.StdEncoding.DecodeString(str) + if err != nil { + return false + } + } + + key, err := x509.ParsePKIXPublicKey(der) + if err != nil { + return false + } + pubkey, ok := key.(*rsa.PublicKey) + if !ok { + return false + } + bitlen := len(pubkey.N.Bytes()) * 8 + return bitlen == int(keylen) +} + +func toJSONName(tag string) string { + if tag == "" { + return "" + } + + // JSON name always comes first. If there's no options then split[0] is + // JSON name, if JSON name is not set, then split[0] is an empty string. + split := strings.SplitN(tag, ",", 2) + + name := split[0] + + // However it is possible that the field is skipped when + // (de-)serializing from/to JSON, in which case assume that there is no + // tag name to use + if name == "-" { + return "" + } + return name +} + +// ValidateStruct use tags for fields. +// result will be equal to `false` if there are any errors. +func ValidateStruct(s interface{}) (bool, error) { + if s == nil { + return true, nil + } + result := true + var err error + val := reflect.ValueOf(s) + if val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr { + val = val.Elem() + } + // we only accept structs + if val.Kind() != reflect.Struct { + return false, fmt.Errorf("function only accepts structs; got %s", val.Kind()) + } + var errs Errors + for i := 0; i < val.NumField(); i++ { + valueField := val.Field(i) + typeField := val.Type().Field(i) + if typeField.PkgPath != "" { + continue // Private field + } + structResult := true + if (valueField.Kind() == reflect.Struct || + (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) && + typeField.Tag.Get(tagName) != "-" { + var err error + structResult, err = ValidateStruct(valueField.Interface()) + if err != nil { + errs = append(errs, err) + } + } + resultField, err2 := typeCheck(valueField, typeField, val, nil) + if err2 != nil { + + // Replace structure name with JSON name if there is a tag on the variable + jsonTag := toJSONName(typeField.Tag.Get("json")) + if jsonTag != "" { + switch jsonError := err2.(type) { + case Error: + jsonError.Name = jsonTag + err2 = jsonError + case Errors: + for i2, err3 := range jsonError { + switch customErr := err3.(type) { + case Error: + customErr.Name = jsonTag + jsonError[i2] = customErr + } + } + + err2 = jsonError + } + } + + errs = append(errs, err2) + } + result = result && resultField && structResult + } + if len(errs) > 0 { + err = errs + } + return result, err +} + +// parseTagIntoMap parses a struct tag `valid:required~Some error message,length(2|3)` into map[string]string{"required": "Some error message", "length(2|3)": ""} +func parseTagIntoMap(tag string) tagOptionsMap { + optionsMap := make(tagOptionsMap) + options := strings.Split(tag, ",") + + for _, option := range options { + option = strings.TrimSpace(option) + + validationOptions := strings.Split(option, "~") + if !isValidTag(validationOptions[0]) { + continue + } + if len(validationOptions) == 2 { + optionsMap[validationOptions[0]] = validationOptions[1] + } else { + optionsMap[validationOptions[0]] = "" + } + } + return optionsMap +} + +func isValidTag(s string) bool { + if s == "" { + return false + } + for _, c := range s { + switch { + case strings.ContainsRune("\\'\"!#$%&()*+-./:<=>?@[]^_{|}~ ", c): + // Backslash and quote chars are reserved, but + // otherwise any punctuation chars are allowed + // in a tag name. + default: + if !unicode.IsLetter(c) && !unicode.IsDigit(c) { + return false + } + } + } + return true +} + +// IsSSN will validate the given string as a U.S. Social Security Number +func IsSSN(str string) bool { + if str == "" || len(str) != 11 { + return false + } + return rxSSN.MatchString(str) +} + +// IsSemver check if string is valid semantic version +func IsSemver(str string) bool { + return rxSemver.MatchString(str) +} + +// IsTime check if string is valid according to given format +func IsTime(str string, format string) bool { + _, err := time.Parse(format, str) + return err == nil +} + +// IsRFC3339 check if string is valid timestamp value according to RFC3339 +func IsRFC3339(str string) bool { + return IsTime(str, time.RFC3339) +} + +// IsRFC3339WithoutZone check if string is valid timestamp value according to RFC3339 which excludes the timezone. +func IsRFC3339WithoutZone(str string) bool { + return IsTime(str, RF3339WithoutZone) +} + +// IsISO4217 check if string is valid ISO currency code +func IsISO4217(str string) bool { + for _, currency := range ISO4217List { + if str == currency { + return true + } + } + + return false +} + +// ByteLength check string's length +func ByteLength(str string, params ...string) bool { + if len(params) == 2 { + min, _ := ToInt(params[0]) + max, _ := ToInt(params[1]) + return len(str) >= int(min) && len(str) <= int(max) + } + + return false +} + +// RuneLength check string's length +// Alias for StringLength +func RuneLength(str string, params ...string) bool { + return StringLength(str, params...) +} + +// IsRsaPub check whether string is valid RSA key +// Alias for IsRsaPublicKey +func IsRsaPub(str string, params ...string) bool { + if len(params) == 1 { + len, _ := ToInt(params[0]) + return IsRsaPublicKey(str, int(len)) + } + + return false +} + +// StringMatches checks if a string matches a given pattern. +func StringMatches(s string, params ...string) bool { + if len(params) == 1 { + pattern := params[0] + return Matches(s, pattern) + } + return false +} + +// StringLength check string's length (including multi byte strings) +func StringLength(str string, params ...string) bool { + + if len(params) == 2 { + strLength := utf8.RuneCountInString(str) + min, _ := ToInt(params[0]) + max, _ := ToInt(params[1]) + return strLength >= int(min) && strLength <= int(max) + } + + return false +} + +// Range check string's length +func Range(str string, params ...string) bool { + if len(params) == 2 { + value, _ := ToFloat(str) + min, _ := ToFloat(params[0]) + max, _ := ToFloat(params[1]) + return InRange(value, min, max) + } + + return false +} + +func isInRaw(str string, params ...string) bool { + if len(params) == 1 { + rawParams := params[0] + + parsedParams := strings.Split(rawParams, "|") + + return IsIn(str, parsedParams...) + } + + return false +} + +// IsIn check if string str is a member of the set of strings params +func IsIn(str string, params ...string) bool { + for _, param := range params { + if str == param { + return true + } + } + + return false +} + +func checkRequired(v reflect.Value, t reflect.StructField, options tagOptionsMap) (bool, error) { + if requiredOption, isRequired := options["required"]; isRequired { + if len(requiredOption) > 0 { + return false, Error{t.Name, fmt.Errorf(requiredOption), true, "required"} + } + return false, Error{t.Name, fmt.Errorf("non zero value required"), false, "required"} + } else if _, isOptional := options["optional"]; fieldsRequiredByDefault && !isOptional { + return false, Error{t.Name, fmt.Errorf("Missing required field"), false, "required"} + } + // not required and empty is valid + return true, nil +} + +func typeCheck(v reflect.Value, t reflect.StructField, o reflect.Value, options tagOptionsMap) (isValid bool, resultErr error) { + if !v.IsValid() { + return false, nil + } + + tag := t.Tag.Get(tagName) + + // Check if the field should be ignored + switch tag { + case "": + if !fieldsRequiredByDefault { + return true, nil + } + return false, Error{t.Name, fmt.Errorf("All fields are required to at least have one validation defined"), false, "required"} + case "-": + return true, nil + } + + isRootType := false + if options == nil { + isRootType = true + options = parseTagIntoMap(tag) + } + + if isEmptyValue(v) { + // an empty value is not validated, check only required + return checkRequired(v, t, options) + } + + var customTypeErrors Errors + for validatorName, customErrorMessage := range options { + if validatefunc, ok := CustomTypeTagMap.Get(validatorName); ok { + delete(options, validatorName) + + if result := validatefunc(v.Interface(), o.Interface()); !result { + if len(customErrorMessage) > 0 { + customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: fmt.Errorf(customErrorMessage), CustomErrorMessageExists: true, Validator: stripParams(validatorName)}) + continue + } + customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: fmt.Errorf("%s does not validate as %s", fmt.Sprint(v), validatorName), CustomErrorMessageExists: false, Validator: stripParams(validatorName)}) + } + } + } + + if len(customTypeErrors.Errors()) > 0 { + return false, customTypeErrors + } + + if isRootType { + // Ensure that we've checked the value by all specified validators before report that the value is valid + defer func() { + delete(options, "optional") + delete(options, "required") + + if isValid && resultErr == nil && len(options) != 0 { + for validator := range options { + isValid = false + resultErr = Error{t.Name, fmt.Errorf( + "The following validator is invalid or can't be applied to the field: %q", validator), false, stripParams(validator)} + return + } + } + }() + } + + switch v.Kind() { + case reflect.Bool, + reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, + reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, + reflect.Float32, reflect.Float64, + reflect.String: + // for each tag option check the map of validator functions + for validatorSpec, customErrorMessage := range options { + var negate bool + validator := validatorSpec + customMsgExists := len(customErrorMessage) > 0 + + // Check whether the tag looks like '!something' or 'something' + if validator[0] == '!' { + validator = validator[1:] + negate = true + } + + // Check for param validators + for key, value := range ParamTagRegexMap { + ps := value.FindStringSubmatch(validator) + if len(ps) == 0 { + continue + } + + validatefunc, ok := ParamTagMap[key] + if !ok { + continue + } + + delete(options, validatorSpec) + + switch v.Kind() { + case reflect.String, + reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, + reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, + reflect.Float32, reflect.Float64: + + field := fmt.Sprint(v) // make value into string, then validate with regex + if result := validatefunc(field, ps[1:]...); (!result && !negate) || (result && negate) { + if customMsgExists { + return false, Error{t.Name, fmt.Errorf(customErrorMessage), customMsgExists, stripParams(validatorSpec)} + } + if negate { + return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec)} + } + return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec)} + } + default: + // type not yet supported, fail + return false, Error{t.Name, fmt.Errorf("Validator %s doesn't support kind %s", validator, v.Kind()), false, stripParams(validatorSpec)} + } + } + + if validatefunc, ok := TagMap[validator]; ok { + delete(options, validatorSpec) + + switch v.Kind() { + case reflect.String: + field := fmt.Sprint(v) // make value into string, then validate with regex + if result := validatefunc(field); !result && !negate || result && negate { + if customMsgExists { + return false, Error{t.Name, fmt.Errorf(customErrorMessage), customMsgExists, stripParams(validatorSpec)} + } + if negate { + return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec)} + } + return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec)} + } + default: + //Not Yet Supported Types (Fail here!) + err := fmt.Errorf("Validator %s doesn't support kind %s for value %v", validator, v.Kind(), v) + return false, Error{t.Name, err, false, stripParams(validatorSpec)} + } + } + } + return true, nil + case reflect.Map: + if v.Type().Key().Kind() != reflect.String { + return false, &UnsupportedTypeError{v.Type()} + } + var sv stringValues + sv = v.MapKeys() + sort.Sort(sv) + result := true + for _, k := range sv { + var resultItem bool + var err error + if v.MapIndex(k).Kind() != reflect.Struct { + resultItem, err = typeCheck(v.MapIndex(k), t, o, options) + if err != nil { + return false, err + } + } else { + resultItem, err = ValidateStruct(v.MapIndex(k).Interface()) + if err != nil { + return false, err + } + } + result = result && resultItem + } + return result, nil + case reflect.Slice, reflect.Array: + result := true + for i := 0; i < v.Len(); i++ { + var resultItem bool + var err error + if v.Index(i).Kind() != reflect.Struct { + resultItem, err = typeCheck(v.Index(i), t, o, options) + if err != nil { + return false, err + } + } else { + resultItem, err = ValidateStruct(v.Index(i).Interface()) + if err != nil { + return false, err + } + } + result = result && resultItem + } + return result, nil + case reflect.Interface: + // If the value is an interface then encode its element + if v.IsNil() { + return true, nil + } + return ValidateStruct(v.Interface()) + case reflect.Ptr: + // If the value is a pointer then check its element + if v.IsNil() { + return true, nil + } + return typeCheck(v.Elem(), t, o, options) + case reflect.Struct: + return ValidateStruct(v.Interface()) + default: + return false, &UnsupportedTypeError{v.Type()} + } +} + +func stripParams(validatorString string) string { + return paramsRegexp.ReplaceAllString(validatorString, "") +} + +func isEmptyValue(v reflect.Value) bool { + switch v.Kind() { + case reflect.String, reflect.Array: + return v.Len() == 0 + case reflect.Map, reflect.Slice: + return v.Len() == 0 || v.IsNil() + 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 reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface()) +} + +// ErrorByField returns error for specified field of the struct +// validated by ValidateStruct or empty string if there are no errors +// or this field doesn't exists or doesn't have any errors. +func ErrorByField(e error, field string) string { + if e == nil { + return "" + } + return ErrorsByField(e)[field] +} + +// ErrorsByField returns map of errors of the struct validated +// by ValidateStruct or empty map if there are no errors. +func ErrorsByField(e error) map[string]string { + m := make(map[string]string) + if e == nil { + return m + } + // prototype for ValidateStruct + + switch e.(type) { + case Error: + m[e.(Error).Name] = e.(Error).Err.Error() + case Errors: + for _, item := range e.(Errors).Errors() { + n := ErrorsByField(item) + for k, v := range n { + m[k] = v + } + } + } + + return m +} + +// Error returns string equivalent for reflect.Type +func (e *UnsupportedTypeError) Error() string { + return "validator: unsupported type: " + e.Type.String() +} + +func (sv stringValues) Len() int { return len(sv) } +func (sv stringValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] } +func (sv stringValues) Less(i, j int) bool { return sv.get(i) < sv.get(j) } +func (sv stringValues) get(i int) string { return sv[i].String() } diff --git a/go/vendor/github.com/asaskevich/govalidator/wercker.yml b/go/vendor/github.com/asaskevich/govalidator/wercker.yml new file mode 100644 index 0000000..cac7a5f --- /dev/null +++ b/go/vendor/github.com/asaskevich/govalidator/wercker.yml @@ -0,0 +1,15 @@ +box: golang +build: + steps: + - setup-go-workspace + + - script: + name: go get + code: | + go version + go get -t ./... + + - script: + name: go test + code: | + go test -race ./... diff --git a/go/vendor/github.com/cenkalti/backoff/.gitignore b/go/vendor/github.com/cenkalti/backoff/.gitignore new file mode 100644 index 0000000..0026861 --- /dev/null +++ b/go/vendor/github.com/cenkalti/backoff/.gitignore @@ -0,0 +1,22 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe diff --git a/go/vendor/github.com/cenkalti/backoff/.travis.yml b/go/vendor/github.com/cenkalti/backoff/.travis.yml new file mode 100644 index 0000000..d6f85ad --- /dev/null +++ b/go/vendor/github.com/cenkalti/backoff/.travis.yml @@ -0,0 +1,10 @@ +language: go +go: + - 1.3.3 + - 1.x + - tip +before_install: + - go get github.com/mattn/goveralls + - go get golang.org/x/tools/cmd/cover +script: + - $HOME/gopath/bin/goveralls -service=travis-ci diff --git a/go/vendor/github.com/cenkalti/backoff/LICENSE b/go/vendor/github.com/cenkalti/backoff/LICENSE new file mode 100644 index 0000000..89b8179 --- /dev/null +++ b/go/vendor/github.com/cenkalti/backoff/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Cenk Altı + +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. diff --git a/go/vendor/github.com/cenkalti/backoff/README.md b/go/vendor/github.com/cenkalti/backoff/README.md new file mode 100644 index 0000000..13b347f --- /dev/null +++ b/go/vendor/github.com/cenkalti/backoff/README.md @@ -0,0 +1,30 @@ +# Exponential Backoff [![GoDoc][godoc image]][godoc] [![Build Status][travis image]][travis] [![Coverage Status][coveralls image]][coveralls] + +This is a Go port of the exponential backoff algorithm from [Google's HTTP Client Library for Java][google-http-java-client]. + +[Exponential backoff][exponential backoff wiki] +is an algorithm that uses feedback to multiplicatively decrease the rate of some process, +in order to gradually find an acceptable rate. +The retries exponentially increase and stop increasing when a certain threshold is met. + +## Usage + +See https://godoc.org/github.com/cenkalti/backoff#pkg-examples + +## Contributing + +* I would like to keep this library as small as possible. +* Please don't send a PR without opening an issue and discussing it first. +* If proposed change is not a common use case, I will probably not accept it. + +[godoc]: https://godoc.org/github.com/cenkalti/backoff +[godoc image]: https://godoc.org/github.com/cenkalti/backoff?status.png +[travis]: https://travis-ci.org/cenkalti/backoff +[travis image]: https://travis-ci.org/cenkalti/backoff.png?branch=master +[coveralls]: https://coveralls.io/github/cenkalti/backoff?branch=master +[coveralls image]: https://coveralls.io/repos/github/cenkalti/backoff/badge.svg?branch=master + +[google-http-java-client]: https://github.com/google/google-http-java-client +[exponential backoff wiki]: http://en.wikipedia.org/wiki/Exponential_backoff + +[advanced example]: https://godoc.org/github.com/cenkalti/backoff#example_ diff --git a/go/vendor/github.com/cenkalti/backoff/backoff.go b/go/vendor/github.com/cenkalti/backoff/backoff.go new file mode 100644 index 0000000..3676ee4 --- /dev/null +++ b/go/vendor/github.com/cenkalti/backoff/backoff.go @@ -0,0 +1,66 @@ +// Package backoff implements backoff algorithms for retrying operations. +// +// Use Retry function for retrying operations that may fail. +// If Retry does not meet your needs, +// copy/paste the function into your project and modify as you wish. +// +// There is also Ticker type similar to time.Ticker. +// You can use it if you need to work with channels. +// +// See Examples section below for usage examples. +package backoff + +import "time" + +// BackOff is a backoff policy for retrying an operation. +type BackOff interface { + // NextBackOff returns the duration to wait before retrying the operation, + // or backoff. Stop to indicate that no more retries should be made. + // + // Example usage: + // + // duration := backoff.NextBackOff(); + // if (duration == backoff.Stop) { + // // Do not retry operation. + // } else { + // // Sleep for duration and retry operation. + // } + // + NextBackOff() time.Duration + + // Reset to initial state. + Reset() +} + +// Stop indicates that no more retries should be made for use in NextBackOff(). +const Stop time.Duration = -1 + +// ZeroBackOff is a fixed backoff policy whose backoff time is always zero, +// meaning that the operation is retried immediately without waiting, indefinitely. +type ZeroBackOff struct{} + +func (b *ZeroBackOff) Reset() {} + +func (b *ZeroBackOff) NextBackOff() time.Duration { return 0 } + +// StopBackOff is a fixed backoff policy that always returns backoff.Stop for +// NextBackOff(), meaning that the operation should never be retried. +type StopBackOff struct{} + +func (b *StopBackOff) Reset() {} + +func (b *StopBackOff) NextBackOff() time.Duration { return Stop } + +// ConstantBackOff is a backoff policy that always returns the same backoff delay. +// This is in contrast to an exponential backoff policy, +// which returns a delay that grows longer as you call NextBackOff() over and over again. +type ConstantBackOff struct { + Interval time.Duration +} + +func (b *ConstantBackOff) Reset() {} +func (b *ConstantBackOff) NextBackOff() time.Duration { return b.Interval } + +func NewConstantBackOff(d time.Duration) *ConstantBackOff { + return &ConstantBackOff{Interval: d} +} diff --git a/go/vendor/github.com/cenkalti/backoff/context.go b/go/vendor/github.com/cenkalti/backoff/context.go new file mode 100644 index 0000000..5d15709 --- /dev/null +++ b/go/vendor/github.com/cenkalti/backoff/context.go @@ -0,0 +1,60 @@ +package backoff + +import ( + "time" + + "golang.org/x/net/context" +) + +// BackOffContext is a backoff policy that stops retrying after the context +// is canceled. +type BackOffContext interface { + BackOff + Context() context.Context +} + +type backOffContext struct { + BackOff + ctx context.Context +} + +// WithContext returns a BackOffContext with context ctx +// +// ctx must not be nil +func WithContext(b BackOff, ctx context.Context) BackOffContext { + if ctx == nil { + panic("nil context") + } + + if b, ok := b.(*backOffContext); ok { + return &backOffContext{ + BackOff: b.BackOff, + ctx: ctx, + } + } + + return &backOffContext{ + BackOff: b, + ctx: ctx, + } +} + +func ensureContext(b BackOff) BackOffContext { + if cb, ok := b.(BackOffContext); ok { + return cb + } + return WithContext(b, context.Background()) +} + +func (b *backOffContext) Context() context.Context { + return b.ctx +} + +func (b *backOffContext) NextBackOff() time.Duration { + select { + case <-b.Context().Done(): + return Stop + default: + return b.BackOff.NextBackOff() + } +} diff --git a/go/vendor/github.com/cenkalti/backoff/exponential.go b/go/vendor/github.com/cenkalti/backoff/exponential.go new file mode 100644 index 0000000..d9de15a --- /dev/null +++ b/go/vendor/github.com/cenkalti/backoff/exponential.go @@ -0,0 +1,158 @@ +package backoff + +import ( + "math/rand" + "time" +) + +/* +ExponentialBackOff is a backoff implementation that increases the backoff +period for each retry attempt using a randomization function that grows exponentially. + +NextBackOff() is calculated using the following formula: + + randomized interval = + RetryInterval * (random value in range [1 - RandomizationFactor, 1 + RandomizationFactor]) + +In other words NextBackOff() will range between the randomization factor +percentage below and above the retry interval. + +For example, given the following parameters: + + RetryInterval = 2 + RandomizationFactor = 0.5 + Multiplier = 2 + +the actual backoff period used in the next retry attempt will range between 1 and 3 seconds, +multiplied by the exponential, that is, between 2 and 6 seconds. + +Note: MaxInterval caps the RetryInterval and not the randomized interval. + +If the time elapsed since an ExponentialBackOff instance is created goes past the +MaxElapsedTime, then the method NextBackOff() starts returning backoff.Stop. + +The elapsed time can be reset by calling Reset(). + +Example: Given the following default arguments, for 10 tries the sequence will be, +and assuming we go over the MaxElapsedTime on the 10th try: + + Request # RetryInterval (seconds) Randomized Interval (seconds) + + 1 0.5 [0.25, 0.75] + 2 0.75 [0.375, 1.125] + 3 1.125 [0.562, 1.687] + 4 1.687 [0.8435, 2.53] + 5 2.53 [1.265, 3.795] + 6 3.795 [1.897, 5.692] + 7 5.692 [2.846, 8.538] + 8 8.538 [4.269, 12.807] + 9 12.807 [6.403, 19.210] + 10 19.210 backoff.Stop + +Note: Implementation is not thread-safe. +*/ +type ExponentialBackOff struct { + InitialInterval time.Duration + RandomizationFactor float64 + Multiplier float64 + MaxInterval time.Duration + // After MaxElapsedTime the ExponentialBackOff stops. + // It never stops if MaxElapsedTime == 0. + MaxElapsedTime time.Duration + Clock Clock + + currentInterval time.Duration + startTime time.Time + random *rand.Rand +} + +// Clock is an interface that returns current time for BackOff. +type Clock interface { + Now() time.Time +} + +// Default values for ExponentialBackOff. +const ( + DefaultInitialInterval = 500 * time.Millisecond + DefaultRandomizationFactor = 0.5 + DefaultMultiplier = 1.5 + DefaultMaxInterval = 60 * time.Second + DefaultMaxElapsedTime = 15 * time.Minute +) + +// NewExponentialBackOff creates an instance of ExponentialBackOff using default values. +func NewExponentialBackOff() *ExponentialBackOff { + b := &ExponentialBackOff{ + InitialInterval: DefaultInitialInterval, + RandomizationFactor: DefaultRandomizationFactor, + Multiplier: DefaultMultiplier, + MaxInterval: DefaultMaxInterval, + MaxElapsedTime: DefaultMaxElapsedTime, + Clock: SystemClock, + random: rand.New(rand.NewSource(time.Now().UnixNano())), + } + b.Reset() + return b +} + +type systemClock struct{} + +func (t systemClock) Now() time.Time { + return time.Now() +} + +// SystemClock implements Clock interface that uses time.Now(). +var SystemClock = systemClock{} + +// Reset the interval back to the initial retry interval and restarts the timer. +func (b *ExponentialBackOff) Reset() { + b.currentInterval = b.InitialInterval + b.startTime = b.Clock.Now() +} + +// NextBackOff calculates the next backoff interval using the formula: +// Randomized interval = RetryInterval +/- (RandomizationFactor * RetryInterval) +func (b *ExponentialBackOff) NextBackOff() time.Duration { + // Make sure we have not gone over the maximum elapsed time. + if b.MaxElapsedTime != 0 && b.GetElapsedTime() > b.MaxElapsedTime { + return Stop + } + defer b.incrementCurrentInterval() + if b.random == nil { + b.random = rand.New(rand.NewSource(time.Now().UnixNano())) + } + return getRandomValueFromInterval(b.RandomizationFactor, b.random.Float64(), b.currentInterval) +} + +// GetElapsedTime returns the elapsed time since an ExponentialBackOff instance +// is created and is reset when Reset() is called. +// +// The elapsed time is computed using time.Now().UnixNano(). It is +// safe to call even while the backoff policy is used by a running +// ticker. +func (b *ExponentialBackOff) GetElapsedTime() time.Duration { + return b.Clock.Now().Sub(b.startTime) +} + +// Increments the current interval by multiplying it with the multiplier. +func (b *ExponentialBackOff) incrementCurrentInterval() { + // Check for overflow, if overflow is detected set the current interval to the max interval. + if float64(b.currentInterval) >= float64(b.MaxInterval)/b.Multiplier { + b.currentInterval = b.MaxInterval + } else { + b.currentInterval = time.Duration(float64(b.currentInterval) * b.Multiplier) + } +} + +// Returns a random value from the following interval: +// [randomizationFactor * currentInterval, randomizationFactor * currentInterval]. +func getRandomValueFromInterval(randomizationFactor, random float64, currentInterval time.Duration) time.Duration { + var delta = randomizationFactor * float64(currentInterval) + var minInterval = float64(currentInterval) - delta + var maxInterval = float64(currentInterval) + delta + + // Get a random value from the range [minInterval, maxInterval]. + // The formula used below has a +1 because if the minInterval is 1 and the maxInterval is 3 then + // we want a 33% chance for selecting either 1, 2 or 3. + return time.Duration(minInterval + (random * (maxInterval - minInterval + 1))) +} diff --git a/go/vendor/github.com/cenkalti/backoff/retry.go b/go/vendor/github.com/cenkalti/backoff/retry.go new file mode 100644 index 0000000..5dbd825 --- /dev/null +++ b/go/vendor/github.com/cenkalti/backoff/retry.go @@ -0,0 +1,78 @@ +package backoff + +import "time" + +// An Operation is executing by Retry() or RetryNotify(). +// The operation will be retried using a backoff policy if it returns an error. +type Operation func() error + +// Notify is a notify-on-error function. It receives an operation error and +// backoff delay if the operation failed (with an error). +// +// NOTE that if the backoff policy stated to stop retrying, +// the notify function isn't called. +type Notify func(error, time.Duration) + +// Retry the operation o until it does not return error or BackOff stops. +// o is guaranteed to be run at least once. +// It is the caller's responsibility to reset b after Retry returns. +// +// If o returns a *PermanentError, the operation is not retried, and the +// wrapped error is returned. +// +// Retry sleeps the goroutine for the duration returned by BackOff after a +// failed operation returns. +func Retry(o Operation, b BackOff) error { return RetryNotify(o, b, nil) } + +// RetryNotify calls notify function with the error and wait duration +// for each failed attempt before sleep. +func RetryNotify(operation Operation, b BackOff, notify Notify) error { + var err error + var next time.Duration + + cb := ensureContext(b) + + b.Reset() + for { + if err = operation(); err == nil { + return nil + } + + if permanent, ok := err.(*PermanentError); ok { + return permanent.Err + } + + if next = b.NextBackOff(); next == Stop { + return err + } + + if notify != nil { + notify(err, next) + } + + t := time.NewTimer(next) + + select { + case <-cb.Context().Done(): + t.Stop() + return err + case <-t.C: + } + } +} + +// PermanentError signals that the operation should not be retried. +type PermanentError struct { + Err error +} + +func (e *PermanentError) Error() string { + return e.Err.Error() +} + +// Permanent wraps the given err in a *PermanentError. +func Permanent(err error) *PermanentError { + return &PermanentError{ + Err: err, + } +} diff --git a/go/vendor/github.com/cenkalti/backoff/ticker.go b/go/vendor/github.com/cenkalti/backoff/ticker.go new file mode 100644 index 0000000..e742512 --- /dev/null +++ b/go/vendor/github.com/cenkalti/backoff/ticker.go @@ -0,0 +1,84 @@ +package backoff + +import ( + "runtime" + "sync" + "time" +) + +// Ticker holds a channel that delivers `ticks' of a clock at times reported by a BackOff. +// +// Ticks will continue to arrive when the previous operation is still running, +// so operations that take a while to fail could run in quick succession. +type Ticker struct { + C <-chan time.Time + c chan time.Time + b BackOffContext + stop chan struct{} + stopOnce sync.Once +} + +// NewTicker returns a new Ticker containing a channel that will send +// the time at times specified by the BackOff argument. Ticker is +// guaranteed to tick at least once. The channel is closed when Stop +// method is called or BackOff stops. It is not safe to manipulate the +// provided backoff policy (notably calling NextBackOff or Reset) +// while the ticker is running. +func NewTicker(b BackOff) *Ticker { + c := make(chan time.Time) + t := &Ticker{ + C: c, + c: c, + b: ensureContext(b), + stop: make(chan struct{}), + } + t.b.Reset() + go t.run() + runtime.SetFinalizer(t, (*Ticker).Stop) + return t +} + +// Stop turns off a ticker. After Stop, no more ticks will be sent. +func (t *Ticker) Stop() { + t.stopOnce.Do(func() { close(t.stop) }) +} + +func (t *Ticker) run() { + c := t.c + defer close(c) + + // Ticker is guaranteed to tick at least once. + afterC := t.send(time.Now()) + + for { + if afterC == nil { + return + } + + select { + case tick := <-afterC: + afterC = t.send(tick) + case <-t.stop: + t.c = nil // Prevent future ticks from being sent to the channel. + return + case <-t.b.Context().Done(): + return + } + } +} + +func (t *Ticker) send(tick time.Time) <-chan time.Time { + select { + case t.c <- tick: + case <-t.stop: + return nil + } + + next := t.b.NextBackOff() + if next == Stop { + t.Stop() + return nil + } + + return time.After(next) +} diff --git a/go/vendor/github.com/cenkalti/backoff/tries.go b/go/vendor/github.com/cenkalti/backoff/tries.go new file mode 100644 index 0000000..cfeefd9 --- /dev/null +++ b/go/vendor/github.com/cenkalti/backoff/tries.go @@ -0,0 +1,35 @@ +package backoff + +import "time" + +/* +WithMaxRetries creates a wrapper around another BackOff, which will +return Stop if NextBackOff() has been called too many times since +the last time Reset() was called + +Note: Implementation is not thread-safe. +*/ +func WithMaxRetries(b BackOff, max uint64) BackOff { + return &backOffTries{delegate: b, maxTries: max} +} + +type backOffTries struct { + delegate BackOff + maxTries uint64 + numTries uint64 +} + +func (b *backOffTries) NextBackOff() time.Duration { + if b.maxTries > 0 { + if b.maxTries <= b.numTries { + return Stop + } + b.numTries++ + } + return b.delegate.NextBackOff() +} + +func (b *backOffTries) Reset() { + b.numTries = 0 + b.delegate.Reset() +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/AUTHORS b/go/vendor/github.com/digitalocean/go-netbox/AUTHORS new file mode 100644 index 0000000..df81c2d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/AUTHORS @@ -0,0 +1,14 @@ +Maintainer +---------- +DigitalOcean, Inc + +Original Author +--------------- +Matt Layher + + +Contributors +------------ +Allan Liu +Dave Cameron +Quan D. Hoang diff --git a/go/vendor/github.com/digitalocean/go-netbox/LICENSE.md b/go/vendor/github.com/digitalocean/go-netbox/LICENSE.md new file mode 100644 index 0000000..f5f4b8b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/LICENSE.md @@ -0,0 +1,195 @@ +Apache License +============== + +_Version 2.0, January 2004_ +_<>_ + +### Terms and Conditions for use, reproduction, and distribution + +#### 1. Definitions + +“License” shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +“Licensor” shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +“Legal Entity” shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, “control” means **(i)** the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the +outstanding shares, or **(iii)** beneficial ownership of such entity. + +“You” (or “Your”) shall mean an individual or Legal Entity exercising +permissions granted by this License. + +“Source” form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +“Object” form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +“Work” shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +“Derivative Works” shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +“Contribution” shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +“submitted” means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as “Not a Contribution.” + +“Contributor” shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +#### 2. Grant of Copyright License + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +#### 3. Grant of Patent License + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +#### 4. Redistribution + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +* **(a)** You must give any other recipients of the Work or Derivative Works a copy of +this License; and +* **(b)** You must cause any modified files to carry prominent notices stating that You +changed the files; and +* **(c)** You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. + +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +#### 5. Submission of Contributions + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +#### 6. Trademarks + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +#### 7. Disclaimer of Warranty + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an “AS IS” BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +#### 8. Limitation of Liability + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +#### 9. Accepting Warranty or Additional Liability + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +_END OF TERMS AND CONDITIONS_ + +### APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets `[]` replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same “printed page” as the copyright notice for easier identification within +third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. + diff --git a/go/vendor/github.com/digitalocean/go-netbox/copyright_header.txt b/go/vendor/github.com/digitalocean/go-netbox/copyright_header.txt new file mode 100644 index 0000000..52f492e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/copyright_header.txt @@ -0,0 +1,13 @@ +Copyright 2018 The go-netbox 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. \ No newline at end of file diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_choices_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_choices_list_parameters.go new file mode 100644 index 0000000..b8a5a7b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_choices_list_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewCircuitsChoicesListParams creates a new CircuitsChoicesListParams object +// with the default values initialized. +func NewCircuitsChoicesListParams() *CircuitsChoicesListParams { + + return &CircuitsChoicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsChoicesListParamsWithTimeout creates a new CircuitsChoicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsChoicesListParamsWithTimeout(timeout time.Duration) *CircuitsChoicesListParams { + + return &CircuitsChoicesListParams{ + + timeout: timeout, + } +} + +// NewCircuitsChoicesListParamsWithContext creates a new CircuitsChoicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsChoicesListParamsWithContext(ctx context.Context) *CircuitsChoicesListParams { + + return &CircuitsChoicesListParams{ + + Context: ctx, + } +} + +// NewCircuitsChoicesListParamsWithHTTPClient creates a new CircuitsChoicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsChoicesListParamsWithHTTPClient(client *http.Client) *CircuitsChoicesListParams { + + return &CircuitsChoicesListParams{ + HTTPClient: client, + } +} + +/*CircuitsChoicesListParams contains all the parameters to send to the API endpoint +for the circuits choices list operation typically these are written to a http.Request +*/ +type CircuitsChoicesListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits choices list params +func (o *CircuitsChoicesListParams) WithTimeout(timeout time.Duration) *CircuitsChoicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits choices list params +func (o *CircuitsChoicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits choices list params +func (o *CircuitsChoicesListParams) WithContext(ctx context.Context) *CircuitsChoicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits choices list params +func (o *CircuitsChoicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits choices list params +func (o *CircuitsChoicesListParams) WithHTTPClient(client *http.Client) *CircuitsChoicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits choices list params +func (o *CircuitsChoicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsChoicesListParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_choices_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_choices_list_responses.go new file mode 100644 index 0000000..893161c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_choices_list_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// CircuitsChoicesListReader is a Reader for the CircuitsChoicesList structure. +type CircuitsChoicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsChoicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsChoicesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsChoicesListOK creates a CircuitsChoicesListOK with default headers values +func NewCircuitsChoicesListOK() *CircuitsChoicesListOK { + return &CircuitsChoicesListOK{} +} + +/*CircuitsChoicesListOK handles this case with default header values. + +CircuitsChoicesListOK circuits choices list o k +*/ +type CircuitsChoicesListOK struct { +} + +func (o *CircuitsChoicesListOK) Error() string { + return fmt.Sprintf("[GET /circuits/_choices/][%d] circuitsChoicesListOK ", 200) +} + +func (o *CircuitsChoicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_choices_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_choices_read_parameters.go new file mode 100644 index 0000000..170d8b9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_choices_read_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewCircuitsChoicesReadParams creates a new CircuitsChoicesReadParams object +// with the default values initialized. +func NewCircuitsChoicesReadParams() *CircuitsChoicesReadParams { + var () + return &CircuitsChoicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsChoicesReadParamsWithTimeout creates a new CircuitsChoicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsChoicesReadParamsWithTimeout(timeout time.Duration) *CircuitsChoicesReadParams { + var () + return &CircuitsChoicesReadParams{ + + timeout: timeout, + } +} + +// NewCircuitsChoicesReadParamsWithContext creates a new CircuitsChoicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsChoicesReadParamsWithContext(ctx context.Context) *CircuitsChoicesReadParams { + var () + return &CircuitsChoicesReadParams{ + + Context: ctx, + } +} + +// NewCircuitsChoicesReadParamsWithHTTPClient creates a new CircuitsChoicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsChoicesReadParamsWithHTTPClient(client *http.Client) *CircuitsChoicesReadParams { + var () + return &CircuitsChoicesReadParams{ + HTTPClient: client, + } +} + +/*CircuitsChoicesReadParams contains all the parameters to send to the API endpoint +for the circuits choices read operation typically these are written to a http.Request +*/ +type CircuitsChoicesReadParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits choices read params +func (o *CircuitsChoicesReadParams) WithTimeout(timeout time.Duration) *CircuitsChoicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits choices read params +func (o *CircuitsChoicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits choices read params +func (o *CircuitsChoicesReadParams) WithContext(ctx context.Context) *CircuitsChoicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits choices read params +func (o *CircuitsChoicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits choices read params +func (o *CircuitsChoicesReadParams) WithHTTPClient(client *http.Client) *CircuitsChoicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits choices read params +func (o *CircuitsChoicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits choices read params +func (o *CircuitsChoicesReadParams) WithID(id string) *CircuitsChoicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits choices read params +func (o *CircuitsChoicesReadParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsChoicesReadParams) 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", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_choices_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_choices_read_responses.go new file mode 100644 index 0000000..f991ba8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_choices_read_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// CircuitsChoicesReadReader is a Reader for the CircuitsChoicesRead structure. +type CircuitsChoicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsChoicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsChoicesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsChoicesReadOK creates a CircuitsChoicesReadOK with default headers values +func NewCircuitsChoicesReadOK() *CircuitsChoicesReadOK { + return &CircuitsChoicesReadOK{} +} + +/*CircuitsChoicesReadOK handles this case with default header values. + +CircuitsChoicesReadOK circuits choices read o k +*/ +type CircuitsChoicesReadOK struct { +} + +func (o *CircuitsChoicesReadOK) Error() string { + return fmt.Sprintf("[GET /circuits/_choices/{id}/][%d] circuitsChoicesReadOK ", 200) +} + +func (o *CircuitsChoicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_create_parameters.go new file mode 100644 index 0000000..d5e6554 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewCircuitsCircuitTerminationsCreateParams creates a new CircuitsCircuitTerminationsCreateParams object +// with the default values initialized. +func NewCircuitsCircuitTerminationsCreateParams() *CircuitsCircuitTerminationsCreateParams { + var () + return &CircuitsCircuitTerminationsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTerminationsCreateParamsWithTimeout creates a new CircuitsCircuitTerminationsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTerminationsCreateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsCreateParams { + var () + return &CircuitsCircuitTerminationsCreateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTerminationsCreateParamsWithContext creates a new CircuitsCircuitTerminationsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTerminationsCreateParamsWithContext(ctx context.Context) *CircuitsCircuitTerminationsCreateParams { + var () + return &CircuitsCircuitTerminationsCreateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTerminationsCreateParamsWithHTTPClient creates a new CircuitsCircuitTerminationsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTerminationsCreateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsCreateParams { + var () + return &CircuitsCircuitTerminationsCreateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTerminationsCreateParams contains all the parameters to send to the API endpoint +for the circuits circuit terminations create operation typically these are written to a http.Request +*/ +type CircuitsCircuitTerminationsCreateParams struct { + + /*Data*/ + Data *models.WritableCircuitTermination + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit terminations create params +func (o *CircuitsCircuitTerminationsCreateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit terminations create params +func (o *CircuitsCircuitTerminationsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit terminations create params +func (o *CircuitsCircuitTerminationsCreateParams) WithContext(ctx context.Context) *CircuitsCircuitTerminationsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit terminations create params +func (o *CircuitsCircuitTerminationsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit terminations create params +func (o *CircuitsCircuitTerminationsCreateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit terminations create params +func (o *CircuitsCircuitTerminationsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuit terminations create params +func (o *CircuitsCircuitTerminationsCreateParams) WithData(data *models.WritableCircuitTermination) *CircuitsCircuitTerminationsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuit terminations create params +func (o *CircuitsCircuitTerminationsCreateParams) SetData(data *models.WritableCircuitTermination) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTerminationsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_create_responses.go new file mode 100644 index 0000000..fd0bee5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsCircuitTerminationsCreateReader is a Reader for the CircuitsCircuitTerminationsCreate structure. +type CircuitsCircuitTerminationsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTerminationsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewCircuitsCircuitTerminationsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitTerminationsCreateCreated creates a CircuitsCircuitTerminationsCreateCreated with default headers values +func NewCircuitsCircuitTerminationsCreateCreated() *CircuitsCircuitTerminationsCreateCreated { + return &CircuitsCircuitTerminationsCreateCreated{} +} + +/*CircuitsCircuitTerminationsCreateCreated handles this case with default header values. + +CircuitsCircuitTerminationsCreateCreated circuits circuit terminations create created +*/ +type CircuitsCircuitTerminationsCreateCreated struct { + Payload *models.WritableCircuitTermination +} + +func (o *CircuitsCircuitTerminationsCreateCreated) Error() string { + return fmt.Sprintf("[POST /circuits/circuit-terminations/][%d] circuitsCircuitTerminationsCreateCreated %+v", 201, o.Payload) +} + +func (o *CircuitsCircuitTerminationsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCircuitTermination) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_delete_parameters.go new file mode 100644 index 0000000..04fc84f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewCircuitsCircuitTerminationsDeleteParams creates a new CircuitsCircuitTerminationsDeleteParams object +// with the default values initialized. +func NewCircuitsCircuitTerminationsDeleteParams() *CircuitsCircuitTerminationsDeleteParams { + var () + return &CircuitsCircuitTerminationsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTerminationsDeleteParamsWithTimeout creates a new CircuitsCircuitTerminationsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTerminationsDeleteParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsDeleteParams { + var () + return &CircuitsCircuitTerminationsDeleteParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTerminationsDeleteParamsWithContext creates a new CircuitsCircuitTerminationsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTerminationsDeleteParamsWithContext(ctx context.Context) *CircuitsCircuitTerminationsDeleteParams { + var () + return &CircuitsCircuitTerminationsDeleteParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTerminationsDeleteParamsWithHTTPClient creates a new CircuitsCircuitTerminationsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTerminationsDeleteParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsDeleteParams { + var () + return &CircuitsCircuitTerminationsDeleteParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTerminationsDeleteParams contains all the parameters to send to the API endpoint +for the circuits circuit terminations delete operation typically these are written to a http.Request +*/ +type CircuitsCircuitTerminationsDeleteParams struct { + + /*ID + A unique integer value identifying this circuit termination. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit terminations delete params +func (o *CircuitsCircuitTerminationsDeleteParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit terminations delete params +func (o *CircuitsCircuitTerminationsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit terminations delete params +func (o *CircuitsCircuitTerminationsDeleteParams) WithContext(ctx context.Context) *CircuitsCircuitTerminationsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit terminations delete params +func (o *CircuitsCircuitTerminationsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit terminations delete params +func (o *CircuitsCircuitTerminationsDeleteParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit terminations delete params +func (o *CircuitsCircuitTerminationsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits circuit terminations delete params +func (o *CircuitsCircuitTerminationsDeleteParams) WithID(id int64) *CircuitsCircuitTerminationsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit terminations delete params +func (o *CircuitsCircuitTerminationsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTerminationsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_delete_responses.go new file mode 100644 index 0000000..cc3336e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// CircuitsCircuitTerminationsDeleteReader is a Reader for the CircuitsCircuitTerminationsDelete structure. +type CircuitsCircuitTerminationsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTerminationsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewCircuitsCircuitTerminationsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitTerminationsDeleteNoContent creates a CircuitsCircuitTerminationsDeleteNoContent with default headers values +func NewCircuitsCircuitTerminationsDeleteNoContent() *CircuitsCircuitTerminationsDeleteNoContent { + return &CircuitsCircuitTerminationsDeleteNoContent{} +} + +/*CircuitsCircuitTerminationsDeleteNoContent handles this case with default header values. + +CircuitsCircuitTerminationsDeleteNoContent circuits circuit terminations delete no content +*/ +type CircuitsCircuitTerminationsDeleteNoContent struct { +} + +func (o *CircuitsCircuitTerminationsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /circuits/circuit-terminations/{id}/][%d] circuitsCircuitTerminationsDeleteNoContent ", 204) +} + +func (o *CircuitsCircuitTerminationsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_list_parameters.go new file mode 100644 index 0000000..c25cbe1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_list_parameters.go @@ -0,0 +1,427 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewCircuitsCircuitTerminationsListParams creates a new CircuitsCircuitTerminationsListParams object +// with the default values initialized. +func NewCircuitsCircuitTerminationsListParams() *CircuitsCircuitTerminationsListParams { + var () + return &CircuitsCircuitTerminationsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTerminationsListParamsWithTimeout creates a new CircuitsCircuitTerminationsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTerminationsListParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsListParams { + var () + return &CircuitsCircuitTerminationsListParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTerminationsListParamsWithContext creates a new CircuitsCircuitTerminationsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTerminationsListParamsWithContext(ctx context.Context) *CircuitsCircuitTerminationsListParams { + var () + return &CircuitsCircuitTerminationsListParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTerminationsListParamsWithHTTPClient creates a new CircuitsCircuitTerminationsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTerminationsListParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsListParams { + var () + return &CircuitsCircuitTerminationsListParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTerminationsListParams contains all the parameters to send to the API endpoint +for the circuits circuit terminations list operation typically these are written to a http.Request +*/ +type CircuitsCircuitTerminationsListParams struct { + + /*CircuitID*/ + CircuitID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*PortSpeed*/ + PortSpeed *float64 + /*Q*/ + Q *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*TermSide*/ + TermSide *string + /*UpstreamSpeed*/ + UpstreamSpeed *float64 + /*XconnectID*/ + XconnectID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithContext(ctx context.Context) *CircuitsCircuitTerminationsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCircuitID adds the circuitID to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithCircuitID(circuitID *string) *CircuitsCircuitTerminationsListParams { + o.SetCircuitID(circuitID) + return o +} + +// SetCircuitID adds the circuitId to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetCircuitID(circuitID *string) { + o.CircuitID = circuitID +} + +// WithLimit adds the limit to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithLimit(limit *int64) *CircuitsCircuitTerminationsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithOffset(offset *int64) *CircuitsCircuitTerminationsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPortSpeed adds the portSpeed to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithPortSpeed(portSpeed *float64) *CircuitsCircuitTerminationsListParams { + o.SetPortSpeed(portSpeed) + return o +} + +// SetPortSpeed adds the portSpeed to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetPortSpeed(portSpeed *float64) { + o.PortSpeed = portSpeed +} + +// WithQ adds the q to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithQ(q *string) *CircuitsCircuitTerminationsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetQ(q *string) { + o.Q = q +} + +// WithSite adds the site to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithSite(site *string) *CircuitsCircuitTerminationsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithSiteID(siteID *string) *CircuitsCircuitTerminationsListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithTermSide adds the termSide to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithTermSide(termSide *string) *CircuitsCircuitTerminationsListParams { + o.SetTermSide(termSide) + return o +} + +// SetTermSide adds the termSide to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetTermSide(termSide *string) { + o.TermSide = termSide +} + +// WithUpstreamSpeed adds the upstreamSpeed to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithUpstreamSpeed(upstreamSpeed *float64) *CircuitsCircuitTerminationsListParams { + o.SetUpstreamSpeed(upstreamSpeed) + return o +} + +// SetUpstreamSpeed adds the upstreamSpeed to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetUpstreamSpeed(upstreamSpeed *float64) { + o.UpstreamSpeed = upstreamSpeed +} + +// WithXconnectID adds the xconnectID to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithXconnectID(xconnectID *string) *CircuitsCircuitTerminationsListParams { + o.SetXconnectID(xconnectID) + return o +} + +// SetXconnectID adds the xconnectId to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetXconnectID(xconnectID *string) { + o.XconnectID = xconnectID +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTerminationsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CircuitID != nil { + + // query param circuit_id + var qrCircuitID string + if o.CircuitID != nil { + qrCircuitID = *o.CircuitID + } + qCircuitID := qrCircuitID + if qCircuitID != "" { + if err := r.SetQueryParam("circuit_id", qCircuitID); 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.PortSpeed != nil { + + // query param port_speed + var qrPortSpeed float64 + if o.PortSpeed != nil { + qrPortSpeed = *o.PortSpeed + } + qPortSpeed := swag.FormatFloat64(qrPortSpeed) + if qPortSpeed != "" { + if err := r.SetQueryParam("port_speed", qPortSpeed); 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.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.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.TermSide != nil { + + // query param term_side + var qrTermSide string + if o.TermSide != nil { + qrTermSide = *o.TermSide + } + qTermSide := qrTermSide + if qTermSide != "" { + if err := r.SetQueryParam("term_side", qTermSide); err != nil { + return err + } + } + + } + + if o.UpstreamSpeed != nil { + + // query param upstream_speed + var qrUpstreamSpeed float64 + if o.UpstreamSpeed != nil { + qrUpstreamSpeed = *o.UpstreamSpeed + } + qUpstreamSpeed := swag.FormatFloat64(qrUpstreamSpeed) + if qUpstreamSpeed != "" { + if err := r.SetQueryParam("upstream_speed", qUpstreamSpeed); err != nil { + return err + } + } + + } + + if o.XconnectID != nil { + + // query param xconnect_id + var qrXconnectID string + if o.XconnectID != nil { + qrXconnectID = *o.XconnectID + } + qXconnectID := qrXconnectID + if qXconnectID != "" { + if err := r.SetQueryParam("xconnect_id", qXconnectID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_list_responses.go new file mode 100644 index 0000000..29be56d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsCircuitTerminationsListReader is a Reader for the CircuitsCircuitTerminationsList structure. +type CircuitsCircuitTerminationsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTerminationsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitTerminationsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitTerminationsListOK creates a CircuitsCircuitTerminationsListOK with default headers values +func NewCircuitsCircuitTerminationsListOK() *CircuitsCircuitTerminationsListOK { + return &CircuitsCircuitTerminationsListOK{} +} + +/*CircuitsCircuitTerminationsListOK handles this case with default header values. + +CircuitsCircuitTerminationsListOK circuits circuit terminations list o k +*/ +type CircuitsCircuitTerminationsListOK struct { + Payload *models.CircuitsCircuitTerminationsListOKBody +} + +func (o *CircuitsCircuitTerminationsListOK) Error() string { + return fmt.Sprintf("[GET /circuits/circuit-terminations/][%d] circuitsCircuitTerminationsListOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitTerminationsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitsCircuitTerminationsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_partial_update_parameters.go new file mode 100644 index 0000000..294471a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewCircuitsCircuitTerminationsPartialUpdateParams creates a new CircuitsCircuitTerminationsPartialUpdateParams object +// with the default values initialized. +func NewCircuitsCircuitTerminationsPartialUpdateParams() *CircuitsCircuitTerminationsPartialUpdateParams { + var () + return &CircuitsCircuitTerminationsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTerminationsPartialUpdateParamsWithTimeout creates a new CircuitsCircuitTerminationsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTerminationsPartialUpdateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsPartialUpdateParams { + var () + return &CircuitsCircuitTerminationsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTerminationsPartialUpdateParamsWithContext creates a new CircuitsCircuitTerminationsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTerminationsPartialUpdateParamsWithContext(ctx context.Context) *CircuitsCircuitTerminationsPartialUpdateParams { + var () + return &CircuitsCircuitTerminationsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTerminationsPartialUpdateParamsWithHTTPClient creates a new CircuitsCircuitTerminationsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTerminationsPartialUpdateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsPartialUpdateParams { + var () + return &CircuitsCircuitTerminationsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTerminationsPartialUpdateParams contains all the parameters to send to the API endpoint +for the circuits circuit terminations partial update operation typically these are written to a http.Request +*/ +type CircuitsCircuitTerminationsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableCircuitTermination + /*ID + A unique integer value identifying this circuit termination. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) WithContext(ctx context.Context) *CircuitsCircuitTerminationsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) WithData(data *models.WritableCircuitTermination) *CircuitsCircuitTerminationsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) SetData(data *models.WritableCircuitTermination) { + o.Data = data +} + +// WithID adds the id to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) WithID(id int64) *CircuitsCircuitTerminationsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTerminationsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_partial_update_responses.go new file mode 100644 index 0000000..4ad26a9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsCircuitTerminationsPartialUpdateReader is a Reader for the CircuitsCircuitTerminationsPartialUpdate structure. +type CircuitsCircuitTerminationsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTerminationsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitTerminationsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitTerminationsPartialUpdateOK creates a CircuitsCircuitTerminationsPartialUpdateOK with default headers values +func NewCircuitsCircuitTerminationsPartialUpdateOK() *CircuitsCircuitTerminationsPartialUpdateOK { + return &CircuitsCircuitTerminationsPartialUpdateOK{} +} + +/*CircuitsCircuitTerminationsPartialUpdateOK handles this case with default header values. + +CircuitsCircuitTerminationsPartialUpdateOK circuits circuit terminations partial update o k +*/ +type CircuitsCircuitTerminationsPartialUpdateOK struct { + Payload *models.WritableCircuitTermination +} + +func (o *CircuitsCircuitTerminationsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /circuits/circuit-terminations/{id}/][%d] circuitsCircuitTerminationsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitTerminationsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCircuitTermination) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_read_parameters.go new file mode 100644 index 0000000..9751e38 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewCircuitsCircuitTerminationsReadParams creates a new CircuitsCircuitTerminationsReadParams object +// with the default values initialized. +func NewCircuitsCircuitTerminationsReadParams() *CircuitsCircuitTerminationsReadParams { + var () + return &CircuitsCircuitTerminationsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTerminationsReadParamsWithTimeout creates a new CircuitsCircuitTerminationsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTerminationsReadParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsReadParams { + var () + return &CircuitsCircuitTerminationsReadParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTerminationsReadParamsWithContext creates a new CircuitsCircuitTerminationsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTerminationsReadParamsWithContext(ctx context.Context) *CircuitsCircuitTerminationsReadParams { + var () + return &CircuitsCircuitTerminationsReadParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTerminationsReadParamsWithHTTPClient creates a new CircuitsCircuitTerminationsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTerminationsReadParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsReadParams { + var () + return &CircuitsCircuitTerminationsReadParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTerminationsReadParams contains all the parameters to send to the API endpoint +for the circuits circuit terminations read operation typically these are written to a http.Request +*/ +type CircuitsCircuitTerminationsReadParams struct { + + /*ID + A unique integer value identifying this circuit termination. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit terminations read params +func (o *CircuitsCircuitTerminationsReadParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit terminations read params +func (o *CircuitsCircuitTerminationsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit terminations read params +func (o *CircuitsCircuitTerminationsReadParams) WithContext(ctx context.Context) *CircuitsCircuitTerminationsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit terminations read params +func (o *CircuitsCircuitTerminationsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit terminations read params +func (o *CircuitsCircuitTerminationsReadParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit terminations read params +func (o *CircuitsCircuitTerminationsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits circuit terminations read params +func (o *CircuitsCircuitTerminationsReadParams) WithID(id int64) *CircuitsCircuitTerminationsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit terminations read params +func (o *CircuitsCircuitTerminationsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTerminationsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_read_responses.go new file mode 100644 index 0000000..18d3308 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsCircuitTerminationsReadReader is a Reader for the CircuitsCircuitTerminationsRead structure. +type CircuitsCircuitTerminationsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTerminationsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitTerminationsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitTerminationsReadOK creates a CircuitsCircuitTerminationsReadOK with default headers values +func NewCircuitsCircuitTerminationsReadOK() *CircuitsCircuitTerminationsReadOK { + return &CircuitsCircuitTerminationsReadOK{} +} + +/*CircuitsCircuitTerminationsReadOK handles this case with default header values. + +CircuitsCircuitTerminationsReadOK circuits circuit terminations read o k +*/ +type CircuitsCircuitTerminationsReadOK struct { + Payload *models.CircuitTermination +} + +func (o *CircuitsCircuitTerminationsReadOK) Error() string { + return fmt.Sprintf("[GET /circuits/circuit-terminations/{id}/][%d] circuitsCircuitTerminationsReadOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitTerminationsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitTermination) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_update_parameters.go new file mode 100644 index 0000000..4c793ef --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewCircuitsCircuitTerminationsUpdateParams creates a new CircuitsCircuitTerminationsUpdateParams object +// with the default values initialized. +func NewCircuitsCircuitTerminationsUpdateParams() *CircuitsCircuitTerminationsUpdateParams { + var () + return &CircuitsCircuitTerminationsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTerminationsUpdateParamsWithTimeout creates a new CircuitsCircuitTerminationsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTerminationsUpdateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsUpdateParams { + var () + return &CircuitsCircuitTerminationsUpdateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTerminationsUpdateParamsWithContext creates a new CircuitsCircuitTerminationsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTerminationsUpdateParamsWithContext(ctx context.Context) *CircuitsCircuitTerminationsUpdateParams { + var () + return &CircuitsCircuitTerminationsUpdateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTerminationsUpdateParamsWithHTTPClient creates a new CircuitsCircuitTerminationsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTerminationsUpdateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsUpdateParams { + var () + return &CircuitsCircuitTerminationsUpdateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTerminationsUpdateParams contains all the parameters to send to the API endpoint +for the circuits circuit terminations update operation typically these are written to a http.Request +*/ +type CircuitsCircuitTerminationsUpdateParams struct { + + /*Data*/ + Data *models.WritableCircuitTermination + /*ID + A unique integer value identifying this circuit termination. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) WithContext(ctx context.Context) *CircuitsCircuitTerminationsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) WithData(data *models.WritableCircuitTermination) *CircuitsCircuitTerminationsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) SetData(data *models.WritableCircuitTermination) { + o.Data = data +} + +// WithID adds the id to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) WithID(id int64) *CircuitsCircuitTerminationsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTerminationsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_update_responses.go new file mode 100644 index 0000000..a69b94e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_terminations_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsCircuitTerminationsUpdateReader is a Reader for the CircuitsCircuitTerminationsUpdate structure. +type CircuitsCircuitTerminationsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTerminationsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitTerminationsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitTerminationsUpdateOK creates a CircuitsCircuitTerminationsUpdateOK with default headers values +func NewCircuitsCircuitTerminationsUpdateOK() *CircuitsCircuitTerminationsUpdateOK { + return &CircuitsCircuitTerminationsUpdateOK{} +} + +/*CircuitsCircuitTerminationsUpdateOK handles this case with default header values. + +CircuitsCircuitTerminationsUpdateOK circuits circuit terminations update o k +*/ +type CircuitsCircuitTerminationsUpdateOK struct { + Payload *models.WritableCircuitTermination +} + +func (o *CircuitsCircuitTerminationsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /circuits/circuit-terminations/{id}/][%d] circuitsCircuitTerminationsUpdateOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitTerminationsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCircuitTermination) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_create_parameters.go new file mode 100644 index 0000000..0c20aac --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewCircuitsCircuitTypesCreateParams creates a new CircuitsCircuitTypesCreateParams object +// with the default values initialized. +func NewCircuitsCircuitTypesCreateParams() *CircuitsCircuitTypesCreateParams { + var () + return &CircuitsCircuitTypesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTypesCreateParamsWithTimeout creates a new CircuitsCircuitTypesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTypesCreateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTypesCreateParams { + var () + return &CircuitsCircuitTypesCreateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTypesCreateParamsWithContext creates a new CircuitsCircuitTypesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTypesCreateParamsWithContext(ctx context.Context) *CircuitsCircuitTypesCreateParams { + var () + return &CircuitsCircuitTypesCreateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTypesCreateParamsWithHTTPClient creates a new CircuitsCircuitTypesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTypesCreateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTypesCreateParams { + var () + return &CircuitsCircuitTypesCreateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTypesCreateParams contains all the parameters to send to the API endpoint +for the circuits circuit types create operation typically these are written to a http.Request +*/ +type CircuitsCircuitTypesCreateParams struct { + + /*Data*/ + Data *models.CircuitType + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit types create params +func (o *CircuitsCircuitTypesCreateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTypesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit types create params +func (o *CircuitsCircuitTypesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit types create params +func (o *CircuitsCircuitTypesCreateParams) WithContext(ctx context.Context) *CircuitsCircuitTypesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit types create params +func (o *CircuitsCircuitTypesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit types create params +func (o *CircuitsCircuitTypesCreateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTypesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit types create params +func (o *CircuitsCircuitTypesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuit types create params +func (o *CircuitsCircuitTypesCreateParams) WithData(data *models.CircuitType) *CircuitsCircuitTypesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuit types create params +func (o *CircuitsCircuitTypesCreateParams) SetData(data *models.CircuitType) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTypesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_create_responses.go new file mode 100644 index 0000000..042fd2f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsCircuitTypesCreateReader is a Reader for the CircuitsCircuitTypesCreate structure. +type CircuitsCircuitTypesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTypesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewCircuitsCircuitTypesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitTypesCreateCreated creates a CircuitsCircuitTypesCreateCreated with default headers values +func NewCircuitsCircuitTypesCreateCreated() *CircuitsCircuitTypesCreateCreated { + return &CircuitsCircuitTypesCreateCreated{} +} + +/*CircuitsCircuitTypesCreateCreated handles this case with default header values. + +CircuitsCircuitTypesCreateCreated circuits circuit types create created +*/ +type CircuitsCircuitTypesCreateCreated struct { + Payload *models.CircuitType +} + +func (o *CircuitsCircuitTypesCreateCreated) Error() string { + return fmt.Sprintf("[POST /circuits/circuit-types/][%d] circuitsCircuitTypesCreateCreated %+v", 201, o.Payload) +} + +func (o *CircuitsCircuitTypesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_delete_parameters.go new file mode 100644 index 0000000..7e9eb16 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewCircuitsCircuitTypesDeleteParams creates a new CircuitsCircuitTypesDeleteParams object +// with the default values initialized. +func NewCircuitsCircuitTypesDeleteParams() *CircuitsCircuitTypesDeleteParams { + var () + return &CircuitsCircuitTypesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTypesDeleteParamsWithTimeout creates a new CircuitsCircuitTypesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTypesDeleteParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTypesDeleteParams { + var () + return &CircuitsCircuitTypesDeleteParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTypesDeleteParamsWithContext creates a new CircuitsCircuitTypesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTypesDeleteParamsWithContext(ctx context.Context) *CircuitsCircuitTypesDeleteParams { + var () + return &CircuitsCircuitTypesDeleteParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTypesDeleteParamsWithHTTPClient creates a new CircuitsCircuitTypesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTypesDeleteParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTypesDeleteParams { + var () + return &CircuitsCircuitTypesDeleteParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTypesDeleteParams contains all the parameters to send to the API endpoint +for the circuits circuit types delete operation typically these are written to a http.Request +*/ +type CircuitsCircuitTypesDeleteParams struct { + + /*ID + A unique integer value identifying this circuit type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit types delete params +func (o *CircuitsCircuitTypesDeleteParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTypesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit types delete params +func (o *CircuitsCircuitTypesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit types delete params +func (o *CircuitsCircuitTypesDeleteParams) WithContext(ctx context.Context) *CircuitsCircuitTypesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit types delete params +func (o *CircuitsCircuitTypesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit types delete params +func (o *CircuitsCircuitTypesDeleteParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTypesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit types delete params +func (o *CircuitsCircuitTypesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits circuit types delete params +func (o *CircuitsCircuitTypesDeleteParams) WithID(id int64) *CircuitsCircuitTypesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit types delete params +func (o *CircuitsCircuitTypesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTypesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_delete_responses.go new file mode 100644 index 0000000..cc10b20 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// CircuitsCircuitTypesDeleteReader is a Reader for the CircuitsCircuitTypesDelete structure. +type CircuitsCircuitTypesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTypesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewCircuitsCircuitTypesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitTypesDeleteNoContent creates a CircuitsCircuitTypesDeleteNoContent with default headers values +func NewCircuitsCircuitTypesDeleteNoContent() *CircuitsCircuitTypesDeleteNoContent { + return &CircuitsCircuitTypesDeleteNoContent{} +} + +/*CircuitsCircuitTypesDeleteNoContent handles this case with default header values. + +CircuitsCircuitTypesDeleteNoContent circuits circuit types delete no content +*/ +type CircuitsCircuitTypesDeleteNoContent struct { +} + +func (o *CircuitsCircuitTypesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /circuits/circuit-types/{id}/][%d] circuitsCircuitTypesDeleteNoContent ", 204) +} + +func (o *CircuitsCircuitTypesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_list_parameters.go new file mode 100644 index 0000000..00c01d9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_list_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewCircuitsCircuitTypesListParams creates a new CircuitsCircuitTypesListParams object +// with the default values initialized. +func NewCircuitsCircuitTypesListParams() *CircuitsCircuitTypesListParams { + var () + return &CircuitsCircuitTypesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTypesListParamsWithTimeout creates a new CircuitsCircuitTypesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTypesListParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTypesListParams { + var () + return &CircuitsCircuitTypesListParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTypesListParamsWithContext creates a new CircuitsCircuitTypesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTypesListParamsWithContext(ctx context.Context) *CircuitsCircuitTypesListParams { + var () + return &CircuitsCircuitTypesListParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTypesListParamsWithHTTPClient creates a new CircuitsCircuitTypesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTypesListParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTypesListParams { + var () + return &CircuitsCircuitTypesListParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTypesListParams contains all the parameters to send to the API endpoint +for the circuits circuit types list operation typically these are written to a http.Request +*/ +type CircuitsCircuitTypesListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTypesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithContext(ctx context.Context) *CircuitsCircuitTypesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTypesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithLimit(limit *int64) *CircuitsCircuitTypesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithName(name *string) *CircuitsCircuitTypesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithOffset(offset *int64) *CircuitsCircuitTypesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithSlug(slug *string) *CircuitsCircuitTypesListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTypesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_list_responses.go new file mode 100644 index 0000000..5d13ece --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsCircuitTypesListReader is a Reader for the CircuitsCircuitTypesList structure. +type CircuitsCircuitTypesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTypesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitTypesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitTypesListOK creates a CircuitsCircuitTypesListOK with default headers values +func NewCircuitsCircuitTypesListOK() *CircuitsCircuitTypesListOK { + return &CircuitsCircuitTypesListOK{} +} + +/*CircuitsCircuitTypesListOK handles this case with default header values. + +CircuitsCircuitTypesListOK circuits circuit types list o k +*/ +type CircuitsCircuitTypesListOK struct { + Payload *models.CircuitsCircuitTypesListOKBody +} + +func (o *CircuitsCircuitTypesListOK) Error() string { + return fmt.Sprintf("[GET /circuits/circuit-types/][%d] circuitsCircuitTypesListOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitTypesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitsCircuitTypesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_partial_update_parameters.go new file mode 100644 index 0000000..2bd833a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewCircuitsCircuitTypesPartialUpdateParams creates a new CircuitsCircuitTypesPartialUpdateParams object +// with the default values initialized. +func NewCircuitsCircuitTypesPartialUpdateParams() *CircuitsCircuitTypesPartialUpdateParams { + var () + return &CircuitsCircuitTypesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTypesPartialUpdateParamsWithTimeout creates a new CircuitsCircuitTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTypesPartialUpdateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTypesPartialUpdateParams { + var () + return &CircuitsCircuitTypesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTypesPartialUpdateParamsWithContext creates a new CircuitsCircuitTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTypesPartialUpdateParamsWithContext(ctx context.Context) *CircuitsCircuitTypesPartialUpdateParams { + var () + return &CircuitsCircuitTypesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTypesPartialUpdateParamsWithHTTPClient creates a new CircuitsCircuitTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTypesPartialUpdateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTypesPartialUpdateParams { + var () + return &CircuitsCircuitTypesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTypesPartialUpdateParams contains all the parameters to send to the API endpoint +for the circuits circuit types partial update operation typically these are written to a http.Request +*/ +type CircuitsCircuitTypesPartialUpdateParams struct { + + /*Data*/ + Data *models.CircuitType + /*ID + A unique integer value identifying this circuit type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTypesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) WithContext(ctx context.Context) *CircuitsCircuitTypesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTypesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) WithData(data *models.CircuitType) *CircuitsCircuitTypesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) SetData(data *models.CircuitType) { + o.Data = data +} + +// WithID adds the id to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) WithID(id int64) *CircuitsCircuitTypesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTypesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_partial_update_responses.go new file mode 100644 index 0000000..1e8ff2d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsCircuitTypesPartialUpdateReader is a Reader for the CircuitsCircuitTypesPartialUpdate structure. +type CircuitsCircuitTypesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTypesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitTypesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitTypesPartialUpdateOK creates a CircuitsCircuitTypesPartialUpdateOK with default headers values +func NewCircuitsCircuitTypesPartialUpdateOK() *CircuitsCircuitTypesPartialUpdateOK { + return &CircuitsCircuitTypesPartialUpdateOK{} +} + +/*CircuitsCircuitTypesPartialUpdateOK handles this case with default header values. + +CircuitsCircuitTypesPartialUpdateOK circuits circuit types partial update o k +*/ +type CircuitsCircuitTypesPartialUpdateOK struct { + Payload *models.CircuitType +} + +func (o *CircuitsCircuitTypesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /circuits/circuit-types/{id}/][%d] circuitsCircuitTypesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitTypesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_read_parameters.go new file mode 100644 index 0000000..a36b410 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewCircuitsCircuitTypesReadParams creates a new CircuitsCircuitTypesReadParams object +// with the default values initialized. +func NewCircuitsCircuitTypesReadParams() *CircuitsCircuitTypesReadParams { + var () + return &CircuitsCircuitTypesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTypesReadParamsWithTimeout creates a new CircuitsCircuitTypesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTypesReadParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTypesReadParams { + var () + return &CircuitsCircuitTypesReadParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTypesReadParamsWithContext creates a new CircuitsCircuitTypesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTypesReadParamsWithContext(ctx context.Context) *CircuitsCircuitTypesReadParams { + var () + return &CircuitsCircuitTypesReadParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTypesReadParamsWithHTTPClient creates a new CircuitsCircuitTypesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTypesReadParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTypesReadParams { + var () + return &CircuitsCircuitTypesReadParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTypesReadParams contains all the parameters to send to the API endpoint +for the circuits circuit types read operation typically these are written to a http.Request +*/ +type CircuitsCircuitTypesReadParams struct { + + /*ID + A unique integer value identifying this circuit type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit types read params +func (o *CircuitsCircuitTypesReadParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTypesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit types read params +func (o *CircuitsCircuitTypesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit types read params +func (o *CircuitsCircuitTypesReadParams) WithContext(ctx context.Context) *CircuitsCircuitTypesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit types read params +func (o *CircuitsCircuitTypesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit types read params +func (o *CircuitsCircuitTypesReadParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTypesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit types read params +func (o *CircuitsCircuitTypesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits circuit types read params +func (o *CircuitsCircuitTypesReadParams) WithID(id int64) *CircuitsCircuitTypesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit types read params +func (o *CircuitsCircuitTypesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTypesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_read_responses.go new file mode 100644 index 0000000..32c6448 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsCircuitTypesReadReader is a Reader for the CircuitsCircuitTypesRead structure. +type CircuitsCircuitTypesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTypesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitTypesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitTypesReadOK creates a CircuitsCircuitTypesReadOK with default headers values +func NewCircuitsCircuitTypesReadOK() *CircuitsCircuitTypesReadOK { + return &CircuitsCircuitTypesReadOK{} +} + +/*CircuitsCircuitTypesReadOK handles this case with default header values. + +CircuitsCircuitTypesReadOK circuits circuit types read o k +*/ +type CircuitsCircuitTypesReadOK struct { + Payload *models.CircuitType +} + +func (o *CircuitsCircuitTypesReadOK) Error() string { + return fmt.Sprintf("[GET /circuits/circuit-types/{id}/][%d] circuitsCircuitTypesReadOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitTypesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_update_parameters.go new file mode 100644 index 0000000..3fa62cd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewCircuitsCircuitTypesUpdateParams creates a new CircuitsCircuitTypesUpdateParams object +// with the default values initialized. +func NewCircuitsCircuitTypesUpdateParams() *CircuitsCircuitTypesUpdateParams { + var () + return &CircuitsCircuitTypesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTypesUpdateParamsWithTimeout creates a new CircuitsCircuitTypesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTypesUpdateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTypesUpdateParams { + var () + return &CircuitsCircuitTypesUpdateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTypesUpdateParamsWithContext creates a new CircuitsCircuitTypesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTypesUpdateParamsWithContext(ctx context.Context) *CircuitsCircuitTypesUpdateParams { + var () + return &CircuitsCircuitTypesUpdateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTypesUpdateParamsWithHTTPClient creates a new CircuitsCircuitTypesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTypesUpdateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTypesUpdateParams { + var () + return &CircuitsCircuitTypesUpdateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTypesUpdateParams contains all the parameters to send to the API endpoint +for the circuits circuit types update operation typically these are written to a http.Request +*/ +type CircuitsCircuitTypesUpdateParams struct { + + /*Data*/ + Data *models.CircuitType + /*ID + A unique integer value identifying this circuit type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTypesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) WithContext(ctx context.Context) *CircuitsCircuitTypesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTypesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) WithData(data *models.CircuitType) *CircuitsCircuitTypesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) SetData(data *models.CircuitType) { + o.Data = data +} + +// WithID adds the id to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) WithID(id int64) *CircuitsCircuitTypesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTypesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_update_responses.go new file mode 100644 index 0000000..425e912 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuit_types_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsCircuitTypesUpdateReader is a Reader for the CircuitsCircuitTypesUpdate structure. +type CircuitsCircuitTypesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTypesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitTypesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitTypesUpdateOK creates a CircuitsCircuitTypesUpdateOK with default headers values +func NewCircuitsCircuitTypesUpdateOK() *CircuitsCircuitTypesUpdateOK { + return &CircuitsCircuitTypesUpdateOK{} +} + +/*CircuitsCircuitTypesUpdateOK handles this case with default header values. + +CircuitsCircuitTypesUpdateOK circuits circuit types update o k +*/ +type CircuitsCircuitTypesUpdateOK struct { + Payload *models.CircuitType +} + +func (o *CircuitsCircuitTypesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /circuits/circuit-types/{id}/][%d] circuitsCircuitTypesUpdateOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitTypesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_create_parameters.go new file mode 100644 index 0000000..8ef8373 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewCircuitsCircuitsCreateParams creates a new CircuitsCircuitsCreateParams object +// with the default values initialized. +func NewCircuitsCircuitsCreateParams() *CircuitsCircuitsCreateParams { + var () + return &CircuitsCircuitsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitsCreateParamsWithTimeout creates a new CircuitsCircuitsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitsCreateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitsCreateParams { + var () + return &CircuitsCircuitsCreateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitsCreateParamsWithContext creates a new CircuitsCircuitsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitsCreateParamsWithContext(ctx context.Context) *CircuitsCircuitsCreateParams { + var () + return &CircuitsCircuitsCreateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitsCreateParamsWithHTTPClient creates a new CircuitsCircuitsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitsCreateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitsCreateParams { + var () + return &CircuitsCircuitsCreateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitsCreateParams contains all the parameters to send to the API endpoint +for the circuits circuits create operation typically these are written to a http.Request +*/ +type CircuitsCircuitsCreateParams struct { + + /*Data*/ + Data *models.WritableCircuit + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuits create params +func (o *CircuitsCircuitsCreateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuits create params +func (o *CircuitsCircuitsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuits create params +func (o *CircuitsCircuitsCreateParams) WithContext(ctx context.Context) *CircuitsCircuitsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuits create params +func (o *CircuitsCircuitsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuits create params +func (o *CircuitsCircuitsCreateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuits create params +func (o *CircuitsCircuitsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuits create params +func (o *CircuitsCircuitsCreateParams) WithData(data *models.WritableCircuit) *CircuitsCircuitsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuits create params +func (o *CircuitsCircuitsCreateParams) SetData(data *models.WritableCircuit) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_create_responses.go new file mode 100644 index 0000000..9f70763 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsCircuitsCreateReader is a Reader for the CircuitsCircuitsCreate structure. +type CircuitsCircuitsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewCircuitsCircuitsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitsCreateCreated creates a CircuitsCircuitsCreateCreated with default headers values +func NewCircuitsCircuitsCreateCreated() *CircuitsCircuitsCreateCreated { + return &CircuitsCircuitsCreateCreated{} +} + +/*CircuitsCircuitsCreateCreated handles this case with default header values. + +CircuitsCircuitsCreateCreated circuits circuits create created +*/ +type CircuitsCircuitsCreateCreated struct { + Payload *models.WritableCircuit +} + +func (o *CircuitsCircuitsCreateCreated) Error() string { + return fmt.Sprintf("[POST /circuits/circuits/][%d] circuitsCircuitsCreateCreated %+v", 201, o.Payload) +} + +func (o *CircuitsCircuitsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCircuit) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_delete_parameters.go new file mode 100644 index 0000000..bc227a0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewCircuitsCircuitsDeleteParams creates a new CircuitsCircuitsDeleteParams object +// with the default values initialized. +func NewCircuitsCircuitsDeleteParams() *CircuitsCircuitsDeleteParams { + var () + return &CircuitsCircuitsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitsDeleteParamsWithTimeout creates a new CircuitsCircuitsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitsDeleteParamsWithTimeout(timeout time.Duration) *CircuitsCircuitsDeleteParams { + var () + return &CircuitsCircuitsDeleteParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitsDeleteParamsWithContext creates a new CircuitsCircuitsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitsDeleteParamsWithContext(ctx context.Context) *CircuitsCircuitsDeleteParams { + var () + return &CircuitsCircuitsDeleteParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitsDeleteParamsWithHTTPClient creates a new CircuitsCircuitsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitsDeleteParamsWithHTTPClient(client *http.Client) *CircuitsCircuitsDeleteParams { + var () + return &CircuitsCircuitsDeleteParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitsDeleteParams contains all the parameters to send to the API endpoint +for the circuits circuits delete operation typically these are written to a http.Request +*/ +type CircuitsCircuitsDeleteParams struct { + + /*ID + A unique integer value identifying this circuit. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuits delete params +func (o *CircuitsCircuitsDeleteParams) WithTimeout(timeout time.Duration) *CircuitsCircuitsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuits delete params +func (o *CircuitsCircuitsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuits delete params +func (o *CircuitsCircuitsDeleteParams) WithContext(ctx context.Context) *CircuitsCircuitsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuits delete params +func (o *CircuitsCircuitsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuits delete params +func (o *CircuitsCircuitsDeleteParams) WithHTTPClient(client *http.Client) *CircuitsCircuitsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuits delete params +func (o *CircuitsCircuitsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits circuits delete params +func (o *CircuitsCircuitsDeleteParams) WithID(id int64) *CircuitsCircuitsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuits delete params +func (o *CircuitsCircuitsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_delete_responses.go new file mode 100644 index 0000000..2ddec44 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// CircuitsCircuitsDeleteReader is a Reader for the CircuitsCircuitsDelete structure. +type CircuitsCircuitsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewCircuitsCircuitsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitsDeleteNoContent creates a CircuitsCircuitsDeleteNoContent with default headers values +func NewCircuitsCircuitsDeleteNoContent() *CircuitsCircuitsDeleteNoContent { + return &CircuitsCircuitsDeleteNoContent{} +} + +/*CircuitsCircuitsDeleteNoContent handles this case with default header values. + +CircuitsCircuitsDeleteNoContent circuits circuits delete no content +*/ +type CircuitsCircuitsDeleteNoContent struct { +} + +func (o *CircuitsCircuitsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /circuits/circuits/{id}/][%d] circuitsCircuitsDeleteNoContent ", 204) +} + +func (o *CircuitsCircuitsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_list_parameters.go new file mode 100644 index 0000000..01e99ad --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_list_parameters.go @@ -0,0 +1,604 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewCircuitsCircuitsListParams creates a new CircuitsCircuitsListParams object +// with the default values initialized. +func NewCircuitsCircuitsListParams() *CircuitsCircuitsListParams { + var () + return &CircuitsCircuitsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitsListParamsWithTimeout creates a new CircuitsCircuitsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitsListParamsWithTimeout(timeout time.Duration) *CircuitsCircuitsListParams { + var () + return &CircuitsCircuitsListParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitsListParamsWithContext creates a new CircuitsCircuitsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitsListParamsWithContext(ctx context.Context) *CircuitsCircuitsListParams { + var () + return &CircuitsCircuitsListParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitsListParamsWithHTTPClient creates a new CircuitsCircuitsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitsListParamsWithHTTPClient(client *http.Client) *CircuitsCircuitsListParams { + var () + return &CircuitsCircuitsListParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitsListParams contains all the parameters to send to the API endpoint +for the circuits circuits list operation typically these are written to a http.Request +*/ +type CircuitsCircuitsListParams struct { + + /*Cid*/ + Cid *string + /*CommitRate*/ + CommitRate *float64 + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*InstallDate*/ + InstallDate *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Provider*/ + Provider *string + /*ProviderID*/ + ProviderID *string + /*Q*/ + Q *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Status*/ + Status *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + /*Type*/ + Type *string + /*TypeID*/ + TypeID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithTimeout(timeout time.Duration) *CircuitsCircuitsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithContext(ctx context.Context) *CircuitsCircuitsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithHTTPClient(client *http.Client) *CircuitsCircuitsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCid adds the cid to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithCid(cid *string) *CircuitsCircuitsListParams { + o.SetCid(cid) + return o +} + +// SetCid adds the cid to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetCid(cid *string) { + o.Cid = cid +} + +// WithCommitRate adds the commitRate to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithCommitRate(commitRate *float64) *CircuitsCircuitsListParams { + o.SetCommitRate(commitRate) + return o +} + +// SetCommitRate adds the commitRate to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetCommitRate(commitRate *float64) { + o.CommitRate = commitRate +} + +// WithIDIn adds the iDIn to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithIDIn(iDIn *string) *CircuitsCircuitsListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithInstallDate adds the installDate to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithInstallDate(installDate *string) *CircuitsCircuitsListParams { + o.SetInstallDate(installDate) + return o +} + +// SetInstallDate adds the installDate to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetInstallDate(installDate *string) { + o.InstallDate = installDate +} + +// WithLimit adds the limit to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithLimit(limit *int64) *CircuitsCircuitsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithOffset(offset *int64) *CircuitsCircuitsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithProvider adds the provider to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithProvider(provider *string) *CircuitsCircuitsListParams { + o.SetProvider(provider) + return o +} + +// SetProvider adds the provider to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetProvider(provider *string) { + o.Provider = provider +} + +// WithProviderID adds the providerID to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithProviderID(providerID *string) *CircuitsCircuitsListParams { + o.SetProviderID(providerID) + return o +} + +// SetProviderID adds the providerId to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetProviderID(providerID *string) { + o.ProviderID = providerID +} + +// WithQ adds the q to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithQ(q *string) *CircuitsCircuitsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetQ(q *string) { + o.Q = q +} + +// WithSite adds the site to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithSite(site *string) *CircuitsCircuitsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithSiteID(siteID *string) *CircuitsCircuitsListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithStatus adds the status to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithStatus(status *string) *CircuitsCircuitsListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetStatus(status *string) { + o.Status = status +} + +// WithTenant adds the tenant to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithTenant(tenant *string) *CircuitsCircuitsListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithTenantID(tenantID *string) *CircuitsCircuitsListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WithType adds the typeVar to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithType(typeVar *string) *CircuitsCircuitsListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WithTypeID adds the typeID to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithTypeID(typeID *string) *CircuitsCircuitsListParams { + o.SetTypeID(typeID) + return o +} + +// SetTypeID adds the typeId to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetTypeID(typeID *string) { + o.TypeID = typeID +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cid != nil { + + // query param cid + var qrCid string + if o.Cid != nil { + qrCid = *o.Cid + } + qCid := qrCid + if qCid != "" { + if err := r.SetQueryParam("cid", qCid); err != nil { + return err + } + } + + } + + if o.CommitRate != nil { + + // query param commit_rate + var qrCommitRate float64 + if o.CommitRate != nil { + qrCommitRate = *o.CommitRate + } + qCommitRate := swag.FormatFloat64(qrCommitRate) + if qCommitRate != "" { + if err := r.SetQueryParam("commit_rate", qCommitRate); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.InstallDate != nil { + + // query param install_date + var qrInstallDate string + if o.InstallDate != nil { + qrInstallDate = *o.InstallDate + } + qInstallDate := qrInstallDate + if qInstallDate != "" { + if err := r.SetQueryParam("install_date", qInstallDate); 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.Provider != nil { + + // query param provider + var qrProvider string + if o.Provider != nil { + qrProvider = *o.Provider + } + qProvider := qrProvider + if qProvider != "" { + if err := r.SetQueryParam("provider", qProvider); err != nil { + return err + } + } + + } + + if o.ProviderID != nil { + + // query param provider_id + var qrProviderID string + if o.ProviderID != nil { + qrProviderID = *o.ProviderID + } + qProviderID := qrProviderID + if qProviderID != "" { + if err := r.SetQueryParam("provider_id", qProviderID); 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.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.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.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.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.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.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if o.TypeID != nil { + + // query param type_id + var qrTypeID string + if o.TypeID != nil { + qrTypeID = *o.TypeID + } + qTypeID := qrTypeID + if qTypeID != "" { + if err := r.SetQueryParam("type_id", qTypeID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_list_responses.go new file mode 100644 index 0000000..fdd3e77 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsCircuitsListReader is a Reader for the CircuitsCircuitsList structure. +type CircuitsCircuitsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitsListOK creates a CircuitsCircuitsListOK with default headers values +func NewCircuitsCircuitsListOK() *CircuitsCircuitsListOK { + return &CircuitsCircuitsListOK{} +} + +/*CircuitsCircuitsListOK handles this case with default header values. + +CircuitsCircuitsListOK circuits circuits list o k +*/ +type CircuitsCircuitsListOK struct { + Payload *models.CircuitsCircuitsListOKBody +} + +func (o *CircuitsCircuitsListOK) Error() string { + return fmt.Sprintf("[GET /circuits/circuits/][%d] circuitsCircuitsListOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitsCircuitsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_partial_update_parameters.go new file mode 100644 index 0000000..263ab7e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewCircuitsCircuitsPartialUpdateParams creates a new CircuitsCircuitsPartialUpdateParams object +// with the default values initialized. +func NewCircuitsCircuitsPartialUpdateParams() *CircuitsCircuitsPartialUpdateParams { + var () + return &CircuitsCircuitsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitsPartialUpdateParamsWithTimeout creates a new CircuitsCircuitsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitsPartialUpdateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitsPartialUpdateParams { + var () + return &CircuitsCircuitsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitsPartialUpdateParamsWithContext creates a new CircuitsCircuitsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitsPartialUpdateParamsWithContext(ctx context.Context) *CircuitsCircuitsPartialUpdateParams { + var () + return &CircuitsCircuitsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitsPartialUpdateParamsWithHTTPClient creates a new CircuitsCircuitsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitsPartialUpdateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitsPartialUpdateParams { + var () + return &CircuitsCircuitsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitsPartialUpdateParams contains all the parameters to send to the API endpoint +for the circuits circuits partial update operation typically these are written to a http.Request +*/ +type CircuitsCircuitsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableCircuit + /*ID + A unique integer value identifying this circuit. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) WithContext(ctx context.Context) *CircuitsCircuitsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) WithData(data *models.WritableCircuit) *CircuitsCircuitsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) SetData(data *models.WritableCircuit) { + o.Data = data +} + +// WithID adds the id to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) WithID(id int64) *CircuitsCircuitsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_partial_update_responses.go new file mode 100644 index 0000000..0080e47 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsCircuitsPartialUpdateReader is a Reader for the CircuitsCircuitsPartialUpdate structure. +type CircuitsCircuitsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitsPartialUpdateOK creates a CircuitsCircuitsPartialUpdateOK with default headers values +func NewCircuitsCircuitsPartialUpdateOK() *CircuitsCircuitsPartialUpdateOK { + return &CircuitsCircuitsPartialUpdateOK{} +} + +/*CircuitsCircuitsPartialUpdateOK handles this case with default header values. + +CircuitsCircuitsPartialUpdateOK circuits circuits partial update o k +*/ +type CircuitsCircuitsPartialUpdateOK struct { + Payload *models.WritableCircuit +} + +func (o *CircuitsCircuitsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /circuits/circuits/{id}/][%d] circuitsCircuitsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCircuit) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_read_parameters.go new file mode 100644 index 0000000..855a9ba --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewCircuitsCircuitsReadParams creates a new CircuitsCircuitsReadParams object +// with the default values initialized. +func NewCircuitsCircuitsReadParams() *CircuitsCircuitsReadParams { + var () + return &CircuitsCircuitsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitsReadParamsWithTimeout creates a new CircuitsCircuitsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitsReadParamsWithTimeout(timeout time.Duration) *CircuitsCircuitsReadParams { + var () + return &CircuitsCircuitsReadParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitsReadParamsWithContext creates a new CircuitsCircuitsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitsReadParamsWithContext(ctx context.Context) *CircuitsCircuitsReadParams { + var () + return &CircuitsCircuitsReadParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitsReadParamsWithHTTPClient creates a new CircuitsCircuitsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitsReadParamsWithHTTPClient(client *http.Client) *CircuitsCircuitsReadParams { + var () + return &CircuitsCircuitsReadParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitsReadParams contains all the parameters to send to the API endpoint +for the circuits circuits read operation typically these are written to a http.Request +*/ +type CircuitsCircuitsReadParams struct { + + /*ID + A unique integer value identifying this circuit. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuits read params +func (o *CircuitsCircuitsReadParams) WithTimeout(timeout time.Duration) *CircuitsCircuitsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuits read params +func (o *CircuitsCircuitsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuits read params +func (o *CircuitsCircuitsReadParams) WithContext(ctx context.Context) *CircuitsCircuitsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuits read params +func (o *CircuitsCircuitsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuits read params +func (o *CircuitsCircuitsReadParams) WithHTTPClient(client *http.Client) *CircuitsCircuitsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuits read params +func (o *CircuitsCircuitsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits circuits read params +func (o *CircuitsCircuitsReadParams) WithID(id int64) *CircuitsCircuitsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuits read params +func (o *CircuitsCircuitsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_read_responses.go new file mode 100644 index 0000000..d907a3d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsCircuitsReadReader is a Reader for the CircuitsCircuitsRead structure. +type CircuitsCircuitsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitsReadOK creates a CircuitsCircuitsReadOK with default headers values +func NewCircuitsCircuitsReadOK() *CircuitsCircuitsReadOK { + return &CircuitsCircuitsReadOK{} +} + +/*CircuitsCircuitsReadOK handles this case with default header values. + +CircuitsCircuitsReadOK circuits circuits read o k +*/ +type CircuitsCircuitsReadOK struct { + Payload *models.Circuit +} + +func (o *CircuitsCircuitsReadOK) Error() string { + return fmt.Sprintf("[GET /circuits/circuits/{id}/][%d] circuitsCircuitsReadOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Circuit) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_update_parameters.go new file mode 100644 index 0000000..ac26c68 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewCircuitsCircuitsUpdateParams creates a new CircuitsCircuitsUpdateParams object +// with the default values initialized. +func NewCircuitsCircuitsUpdateParams() *CircuitsCircuitsUpdateParams { + var () + return &CircuitsCircuitsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitsUpdateParamsWithTimeout creates a new CircuitsCircuitsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitsUpdateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitsUpdateParams { + var () + return &CircuitsCircuitsUpdateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitsUpdateParamsWithContext creates a new CircuitsCircuitsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitsUpdateParamsWithContext(ctx context.Context) *CircuitsCircuitsUpdateParams { + var () + return &CircuitsCircuitsUpdateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitsUpdateParamsWithHTTPClient creates a new CircuitsCircuitsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitsUpdateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitsUpdateParams { + var () + return &CircuitsCircuitsUpdateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitsUpdateParams contains all the parameters to send to the API endpoint +for the circuits circuits update operation typically these are written to a http.Request +*/ +type CircuitsCircuitsUpdateParams struct { + + /*Data*/ + Data *models.WritableCircuit + /*ID + A unique integer value identifying this circuit. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) WithContext(ctx context.Context) *CircuitsCircuitsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) WithData(data *models.WritableCircuit) *CircuitsCircuitsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) SetData(data *models.WritableCircuit) { + o.Data = data +} + +// WithID adds the id to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) WithID(id int64) *CircuitsCircuitsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_update_responses.go new file mode 100644 index 0000000..11a3ebf --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_circuits_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsCircuitsUpdateReader is a Reader for the CircuitsCircuitsUpdate structure. +type CircuitsCircuitsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsCircuitsUpdateOK creates a CircuitsCircuitsUpdateOK with default headers values +func NewCircuitsCircuitsUpdateOK() *CircuitsCircuitsUpdateOK { + return &CircuitsCircuitsUpdateOK{} +} + +/*CircuitsCircuitsUpdateOK handles this case with default header values. + +CircuitsCircuitsUpdateOK circuits circuits update o k +*/ +type CircuitsCircuitsUpdateOK struct { + Payload *models.WritableCircuit +} + +func (o *CircuitsCircuitsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /circuits/circuits/{id}/][%d] circuitsCircuitsUpdateOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCircuit) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_client.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_client.go new file mode 100644 index 0000000..9f1b959 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_client.go @@ -0,0 +1,827 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new circuits API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for circuits API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +CircuitsChoicesList circuits choices list API +*/ +func (a *Client) CircuitsChoicesList(params *CircuitsChoicesListParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsChoicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsChoicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits__choices_list", + Method: "GET", + PathPattern: "/circuits/_choices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsChoicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsChoicesListOK), nil + +} + +/* +CircuitsChoicesRead circuits choices read API +*/ +func (a *Client) CircuitsChoicesRead(params *CircuitsChoicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsChoicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsChoicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits__choices_read", + Method: "GET", + PathPattern: "/circuits/_choices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsChoicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsChoicesReadOK), nil + +} + +/* +CircuitsCircuitTerminationsCreate circuits circuit terminations create API +*/ +func (a *Client) CircuitsCircuitTerminationsCreate(params *CircuitsCircuitTerminationsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTerminationsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTerminationsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-terminations_create", + Method: "POST", + PathPattern: "/circuits/circuit-terminations/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTerminationsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTerminationsCreateCreated), nil + +} + +/* +CircuitsCircuitTerminationsDelete circuits circuit terminations delete API +*/ +func (a *Client) CircuitsCircuitTerminationsDelete(params *CircuitsCircuitTerminationsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTerminationsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTerminationsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-terminations_delete", + Method: "DELETE", + PathPattern: "/circuits/circuit-terminations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTerminationsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTerminationsDeleteNoContent), nil + +} + +/* +CircuitsCircuitTerminationsList circuits circuit terminations list API +*/ +func (a *Client) CircuitsCircuitTerminationsList(params *CircuitsCircuitTerminationsListParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTerminationsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTerminationsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-terminations_list", + Method: "GET", + PathPattern: "/circuits/circuit-terminations/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTerminationsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTerminationsListOK), nil + +} + +/* +CircuitsCircuitTerminationsPartialUpdate circuits circuit terminations partial update API +*/ +func (a *Client) CircuitsCircuitTerminationsPartialUpdate(params *CircuitsCircuitTerminationsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTerminationsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTerminationsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-terminations_partial_update", + Method: "PATCH", + PathPattern: "/circuits/circuit-terminations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTerminationsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTerminationsPartialUpdateOK), nil + +} + +/* +CircuitsCircuitTerminationsRead circuits circuit terminations read API +*/ +func (a *Client) CircuitsCircuitTerminationsRead(params *CircuitsCircuitTerminationsReadParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTerminationsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTerminationsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-terminations_read", + Method: "GET", + PathPattern: "/circuits/circuit-terminations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTerminationsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTerminationsReadOK), nil + +} + +/* +CircuitsCircuitTerminationsUpdate circuits circuit terminations update API +*/ +func (a *Client) CircuitsCircuitTerminationsUpdate(params *CircuitsCircuitTerminationsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTerminationsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTerminationsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-terminations_update", + Method: "PUT", + PathPattern: "/circuits/circuit-terminations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTerminationsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTerminationsUpdateOK), nil + +} + +/* +CircuitsCircuitTypesCreate circuits circuit types create API +*/ +func (a *Client) CircuitsCircuitTypesCreate(params *CircuitsCircuitTypesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTypesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTypesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-types_create", + Method: "POST", + PathPattern: "/circuits/circuit-types/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTypesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTypesCreateCreated), nil + +} + +/* +CircuitsCircuitTypesDelete circuits circuit types delete API +*/ +func (a *Client) CircuitsCircuitTypesDelete(params *CircuitsCircuitTypesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTypesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTypesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-types_delete", + Method: "DELETE", + PathPattern: "/circuits/circuit-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTypesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTypesDeleteNoContent), nil + +} + +/* +CircuitsCircuitTypesList circuits circuit types list API +*/ +func (a *Client) CircuitsCircuitTypesList(params *CircuitsCircuitTypesListParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTypesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTypesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-types_list", + Method: "GET", + PathPattern: "/circuits/circuit-types/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTypesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTypesListOK), nil + +} + +/* +CircuitsCircuitTypesPartialUpdate circuits circuit types partial update API +*/ +func (a *Client) CircuitsCircuitTypesPartialUpdate(params *CircuitsCircuitTypesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTypesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTypesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-types_partial_update", + Method: "PATCH", + PathPattern: "/circuits/circuit-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTypesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTypesPartialUpdateOK), nil + +} + +/* +CircuitsCircuitTypesRead circuits circuit types read API +*/ +func (a *Client) CircuitsCircuitTypesRead(params *CircuitsCircuitTypesReadParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTypesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTypesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-types_read", + Method: "GET", + PathPattern: "/circuits/circuit-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTypesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTypesReadOK), nil + +} + +/* +CircuitsCircuitTypesUpdate circuits circuit types update API +*/ +func (a *Client) CircuitsCircuitTypesUpdate(params *CircuitsCircuitTypesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTypesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTypesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-types_update", + Method: "PUT", + PathPattern: "/circuits/circuit-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTypesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTypesUpdateOK), nil + +} + +/* +CircuitsCircuitsCreate circuits circuits create API +*/ +func (a *Client) CircuitsCircuitsCreate(params *CircuitsCircuitsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuits_create", + Method: "POST", + PathPattern: "/circuits/circuits/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitsCreateCreated), nil + +} + +/* +CircuitsCircuitsDelete circuits circuits delete API +*/ +func (a *Client) CircuitsCircuitsDelete(params *CircuitsCircuitsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuits_delete", + Method: "DELETE", + PathPattern: "/circuits/circuits/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitsDeleteNoContent), nil + +} + +/* +CircuitsCircuitsList circuits circuits list API +*/ +func (a *Client) CircuitsCircuitsList(params *CircuitsCircuitsListParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuits_list", + Method: "GET", + PathPattern: "/circuits/circuits/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitsListOK), nil + +} + +/* +CircuitsCircuitsPartialUpdate circuits circuits partial update API +*/ +func (a *Client) CircuitsCircuitsPartialUpdate(params *CircuitsCircuitsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuits_partial_update", + Method: "PATCH", + PathPattern: "/circuits/circuits/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitsPartialUpdateOK), nil + +} + +/* +CircuitsCircuitsRead circuits circuits read API +*/ +func (a *Client) CircuitsCircuitsRead(params *CircuitsCircuitsReadParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuits_read", + Method: "GET", + PathPattern: "/circuits/circuits/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitsReadOK), nil + +} + +/* +CircuitsCircuitsUpdate circuits circuits update API +*/ +func (a *Client) CircuitsCircuitsUpdate(params *CircuitsCircuitsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuits_update", + Method: "PUT", + PathPattern: "/circuits/circuits/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitsUpdateOK), nil + +} + +/* +CircuitsProvidersCreate circuits providers create API +*/ +func (a *Client) CircuitsProvidersCreate(params *CircuitsProvidersCreateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsProvidersCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsProvidersCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_providers_create", + Method: "POST", + PathPattern: "/circuits/providers/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsProvidersCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsProvidersCreateCreated), nil + +} + +/* +CircuitsProvidersDelete circuits providers delete API +*/ +func (a *Client) CircuitsProvidersDelete(params *CircuitsProvidersDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsProvidersDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsProvidersDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_providers_delete", + Method: "DELETE", + PathPattern: "/circuits/providers/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsProvidersDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsProvidersDeleteNoContent), nil + +} + +/* +CircuitsProvidersGraphs A convenience method for rendering graphs for a particular provider. +*/ +func (a *Client) CircuitsProvidersGraphs(params *CircuitsProvidersGraphsParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsProvidersGraphsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsProvidersGraphsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_providers_graphs", + Method: "GET", + PathPattern: "/circuits/providers/{id}/graphs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsProvidersGraphsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsProvidersGraphsOK), nil + +} + +/* +CircuitsProvidersList circuits providers list API +*/ +func (a *Client) CircuitsProvidersList(params *CircuitsProvidersListParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsProvidersListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsProvidersListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_providers_list", + Method: "GET", + PathPattern: "/circuits/providers/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsProvidersListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsProvidersListOK), nil + +} + +/* +CircuitsProvidersPartialUpdate circuits providers partial update API +*/ +func (a *Client) CircuitsProvidersPartialUpdate(params *CircuitsProvidersPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsProvidersPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsProvidersPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_providers_partial_update", + Method: "PATCH", + PathPattern: "/circuits/providers/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsProvidersPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsProvidersPartialUpdateOK), nil + +} + +/* +CircuitsProvidersRead circuits providers read API +*/ +func (a *Client) CircuitsProvidersRead(params *CircuitsProvidersReadParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsProvidersReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsProvidersReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_providers_read", + Method: "GET", + PathPattern: "/circuits/providers/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsProvidersReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsProvidersReadOK), nil + +} + +/* +CircuitsProvidersUpdate circuits providers update API +*/ +func (a *Client) CircuitsProvidersUpdate(params *CircuitsProvidersUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsProvidersUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsProvidersUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_providers_update", + Method: "PUT", + PathPattern: "/circuits/providers/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsProvidersUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsProvidersUpdateOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_create_parameters.go new file mode 100644 index 0000000..4faebe3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewCircuitsProvidersCreateParams creates a new CircuitsProvidersCreateParams object +// with the default values initialized. +func NewCircuitsProvidersCreateParams() *CircuitsProvidersCreateParams { + var () + return &CircuitsProvidersCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsProvidersCreateParamsWithTimeout creates a new CircuitsProvidersCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsProvidersCreateParamsWithTimeout(timeout time.Duration) *CircuitsProvidersCreateParams { + var () + return &CircuitsProvidersCreateParams{ + + timeout: timeout, + } +} + +// NewCircuitsProvidersCreateParamsWithContext creates a new CircuitsProvidersCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsProvidersCreateParamsWithContext(ctx context.Context) *CircuitsProvidersCreateParams { + var () + return &CircuitsProvidersCreateParams{ + + Context: ctx, + } +} + +// NewCircuitsProvidersCreateParamsWithHTTPClient creates a new CircuitsProvidersCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsProvidersCreateParamsWithHTTPClient(client *http.Client) *CircuitsProvidersCreateParams { + var () + return &CircuitsProvidersCreateParams{ + HTTPClient: client, + } +} + +/*CircuitsProvidersCreateParams contains all the parameters to send to the API endpoint +for the circuits providers create operation typically these are written to a http.Request +*/ +type CircuitsProvidersCreateParams struct { + + /*Data*/ + Data *models.WritableProvider + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits providers create params +func (o *CircuitsProvidersCreateParams) WithTimeout(timeout time.Duration) *CircuitsProvidersCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits providers create params +func (o *CircuitsProvidersCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits providers create params +func (o *CircuitsProvidersCreateParams) WithContext(ctx context.Context) *CircuitsProvidersCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits providers create params +func (o *CircuitsProvidersCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits providers create params +func (o *CircuitsProvidersCreateParams) WithHTTPClient(client *http.Client) *CircuitsProvidersCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits providers create params +func (o *CircuitsProvidersCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits providers create params +func (o *CircuitsProvidersCreateParams) WithData(data *models.WritableProvider) *CircuitsProvidersCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits providers create params +func (o *CircuitsProvidersCreateParams) SetData(data *models.WritableProvider) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsProvidersCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_create_responses.go new file mode 100644 index 0000000..e1bcea7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsProvidersCreateReader is a Reader for the CircuitsProvidersCreate structure. +type CircuitsProvidersCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsProvidersCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewCircuitsProvidersCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsProvidersCreateCreated creates a CircuitsProvidersCreateCreated with default headers values +func NewCircuitsProvidersCreateCreated() *CircuitsProvidersCreateCreated { + return &CircuitsProvidersCreateCreated{} +} + +/*CircuitsProvidersCreateCreated handles this case with default header values. + +CircuitsProvidersCreateCreated circuits providers create created +*/ +type CircuitsProvidersCreateCreated struct { + Payload *models.WritableProvider +} + +func (o *CircuitsProvidersCreateCreated) Error() string { + return fmt.Sprintf("[POST /circuits/providers/][%d] circuitsProvidersCreateCreated %+v", 201, o.Payload) +} + +func (o *CircuitsProvidersCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableProvider) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_delete_parameters.go new file mode 100644 index 0000000..f07ad0b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewCircuitsProvidersDeleteParams creates a new CircuitsProvidersDeleteParams object +// with the default values initialized. +func NewCircuitsProvidersDeleteParams() *CircuitsProvidersDeleteParams { + var () + return &CircuitsProvidersDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsProvidersDeleteParamsWithTimeout creates a new CircuitsProvidersDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsProvidersDeleteParamsWithTimeout(timeout time.Duration) *CircuitsProvidersDeleteParams { + var () + return &CircuitsProvidersDeleteParams{ + + timeout: timeout, + } +} + +// NewCircuitsProvidersDeleteParamsWithContext creates a new CircuitsProvidersDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsProvidersDeleteParamsWithContext(ctx context.Context) *CircuitsProvidersDeleteParams { + var () + return &CircuitsProvidersDeleteParams{ + + Context: ctx, + } +} + +// NewCircuitsProvidersDeleteParamsWithHTTPClient creates a new CircuitsProvidersDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsProvidersDeleteParamsWithHTTPClient(client *http.Client) *CircuitsProvidersDeleteParams { + var () + return &CircuitsProvidersDeleteParams{ + HTTPClient: client, + } +} + +/*CircuitsProvidersDeleteParams contains all the parameters to send to the API endpoint +for the circuits providers delete operation typically these are written to a http.Request +*/ +type CircuitsProvidersDeleteParams struct { + + /*ID + A unique integer value identifying this provider. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits providers delete params +func (o *CircuitsProvidersDeleteParams) WithTimeout(timeout time.Duration) *CircuitsProvidersDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits providers delete params +func (o *CircuitsProvidersDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits providers delete params +func (o *CircuitsProvidersDeleteParams) WithContext(ctx context.Context) *CircuitsProvidersDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits providers delete params +func (o *CircuitsProvidersDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits providers delete params +func (o *CircuitsProvidersDeleteParams) WithHTTPClient(client *http.Client) *CircuitsProvidersDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits providers delete params +func (o *CircuitsProvidersDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits providers delete params +func (o *CircuitsProvidersDeleteParams) WithID(id int64) *CircuitsProvidersDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits providers delete params +func (o *CircuitsProvidersDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsProvidersDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_delete_responses.go new file mode 100644 index 0000000..f166405 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// CircuitsProvidersDeleteReader is a Reader for the CircuitsProvidersDelete structure. +type CircuitsProvidersDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsProvidersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewCircuitsProvidersDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsProvidersDeleteNoContent creates a CircuitsProvidersDeleteNoContent with default headers values +func NewCircuitsProvidersDeleteNoContent() *CircuitsProvidersDeleteNoContent { + return &CircuitsProvidersDeleteNoContent{} +} + +/*CircuitsProvidersDeleteNoContent handles this case with default header values. + +CircuitsProvidersDeleteNoContent circuits providers delete no content +*/ +type CircuitsProvidersDeleteNoContent struct { +} + +func (o *CircuitsProvidersDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /circuits/providers/{id}/][%d] circuitsProvidersDeleteNoContent ", 204) +} + +func (o *CircuitsProvidersDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_graphs_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_graphs_parameters.go new file mode 100644 index 0000000..a3123fb --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_graphs_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewCircuitsProvidersGraphsParams creates a new CircuitsProvidersGraphsParams object +// with the default values initialized. +func NewCircuitsProvidersGraphsParams() *CircuitsProvidersGraphsParams { + var () + return &CircuitsProvidersGraphsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsProvidersGraphsParamsWithTimeout creates a new CircuitsProvidersGraphsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsProvidersGraphsParamsWithTimeout(timeout time.Duration) *CircuitsProvidersGraphsParams { + var () + return &CircuitsProvidersGraphsParams{ + + timeout: timeout, + } +} + +// NewCircuitsProvidersGraphsParamsWithContext creates a new CircuitsProvidersGraphsParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsProvidersGraphsParamsWithContext(ctx context.Context) *CircuitsProvidersGraphsParams { + var () + return &CircuitsProvidersGraphsParams{ + + Context: ctx, + } +} + +// NewCircuitsProvidersGraphsParamsWithHTTPClient creates a new CircuitsProvidersGraphsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsProvidersGraphsParamsWithHTTPClient(client *http.Client) *CircuitsProvidersGraphsParams { + var () + return &CircuitsProvidersGraphsParams{ + HTTPClient: client, + } +} + +/*CircuitsProvidersGraphsParams contains all the parameters to send to the API endpoint +for the circuits providers graphs operation typically these are written to a http.Request +*/ +type CircuitsProvidersGraphsParams struct { + + /*ID + A unique integer value identifying this provider. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits providers graphs params +func (o *CircuitsProvidersGraphsParams) WithTimeout(timeout time.Duration) *CircuitsProvidersGraphsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits providers graphs params +func (o *CircuitsProvidersGraphsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits providers graphs params +func (o *CircuitsProvidersGraphsParams) WithContext(ctx context.Context) *CircuitsProvidersGraphsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits providers graphs params +func (o *CircuitsProvidersGraphsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits providers graphs params +func (o *CircuitsProvidersGraphsParams) WithHTTPClient(client *http.Client) *CircuitsProvidersGraphsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits providers graphs params +func (o *CircuitsProvidersGraphsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits providers graphs params +func (o *CircuitsProvidersGraphsParams) WithID(id int64) *CircuitsProvidersGraphsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits providers graphs params +func (o *CircuitsProvidersGraphsParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsProvidersGraphsParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_graphs_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_graphs_responses.go new file mode 100644 index 0000000..e57279f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_graphs_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsProvidersGraphsReader is a Reader for the CircuitsProvidersGraphs structure. +type CircuitsProvidersGraphsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsProvidersGraphsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsProvidersGraphsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsProvidersGraphsOK creates a CircuitsProvidersGraphsOK with default headers values +func NewCircuitsProvidersGraphsOK() *CircuitsProvidersGraphsOK { + return &CircuitsProvidersGraphsOK{} +} + +/*CircuitsProvidersGraphsOK handles this case with default header values. + +CircuitsProvidersGraphsOK circuits providers graphs o k +*/ +type CircuitsProvidersGraphsOK struct { + Payload *models.Provider +} + +func (o *CircuitsProvidersGraphsOK) Error() string { + return fmt.Sprintf("[GET /circuits/providers/{id}/graphs/][%d] circuitsProvidersGraphsOK %+v", 200, o.Payload) +} + +func (o *CircuitsProvidersGraphsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Provider) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_list_parameters.go new file mode 100644 index 0000000..e7a40c0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_list_parameters.go @@ -0,0 +1,430 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewCircuitsProvidersListParams creates a new CircuitsProvidersListParams object +// with the default values initialized. +func NewCircuitsProvidersListParams() *CircuitsProvidersListParams { + var () + return &CircuitsProvidersListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsProvidersListParamsWithTimeout creates a new CircuitsProvidersListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsProvidersListParamsWithTimeout(timeout time.Duration) *CircuitsProvidersListParams { + var () + return &CircuitsProvidersListParams{ + + timeout: timeout, + } +} + +// NewCircuitsProvidersListParamsWithContext creates a new CircuitsProvidersListParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsProvidersListParamsWithContext(ctx context.Context) *CircuitsProvidersListParams { + var () + return &CircuitsProvidersListParams{ + + Context: ctx, + } +} + +// NewCircuitsProvidersListParamsWithHTTPClient creates a new CircuitsProvidersListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsProvidersListParamsWithHTTPClient(client *http.Client) *CircuitsProvidersListParams { + var () + return &CircuitsProvidersListParams{ + HTTPClient: client, + } +} + +/*CircuitsProvidersListParams contains all the parameters to send to the API endpoint +for the circuits providers list operation typically these are written to a http.Request +*/ +type CircuitsProvidersListParams struct { + + /*Account*/ + Account *string + /*Asn*/ + Asn *float64 + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits providers list params +func (o *CircuitsProvidersListParams) WithTimeout(timeout time.Duration) *CircuitsProvidersListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits providers list params +func (o *CircuitsProvidersListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits providers list params +func (o *CircuitsProvidersListParams) WithContext(ctx context.Context) *CircuitsProvidersListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits providers list params +func (o *CircuitsProvidersListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits providers list params +func (o *CircuitsProvidersListParams) WithHTTPClient(client *http.Client) *CircuitsProvidersListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits providers list params +func (o *CircuitsProvidersListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccount adds the account to the circuits providers list params +func (o *CircuitsProvidersListParams) WithAccount(account *string) *CircuitsProvidersListParams { + o.SetAccount(account) + return o +} + +// SetAccount adds the account to the circuits providers list params +func (o *CircuitsProvidersListParams) SetAccount(account *string) { + o.Account = account +} + +// WithAsn adds the asn to the circuits providers list params +func (o *CircuitsProvidersListParams) WithAsn(asn *float64) *CircuitsProvidersListParams { + o.SetAsn(asn) + return o +} + +// SetAsn adds the asn to the circuits providers list params +func (o *CircuitsProvidersListParams) SetAsn(asn *float64) { + o.Asn = asn +} + +// WithIDIn adds the iDIn to the circuits providers list params +func (o *CircuitsProvidersListParams) WithIDIn(iDIn *string) *CircuitsProvidersListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the circuits providers list params +func (o *CircuitsProvidersListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the circuits providers list params +func (o *CircuitsProvidersListParams) WithLimit(limit *int64) *CircuitsProvidersListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the circuits providers list params +func (o *CircuitsProvidersListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the circuits providers list params +func (o *CircuitsProvidersListParams) WithName(name *string) *CircuitsProvidersListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the circuits providers list params +func (o *CircuitsProvidersListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the circuits providers list params +func (o *CircuitsProvidersListParams) WithOffset(offset *int64) *CircuitsProvidersListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the circuits providers list params +func (o *CircuitsProvidersListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the circuits providers list params +func (o *CircuitsProvidersListParams) WithQ(q *string) *CircuitsProvidersListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the circuits providers list params +func (o *CircuitsProvidersListParams) SetQ(q *string) { + o.Q = q +} + +// WithSite adds the site to the circuits providers list params +func (o *CircuitsProvidersListParams) WithSite(site *string) *CircuitsProvidersListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the circuits providers list params +func (o *CircuitsProvidersListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the circuits providers list params +func (o *CircuitsProvidersListParams) WithSiteID(siteID *string) *CircuitsProvidersListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the circuits providers list params +func (o *CircuitsProvidersListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithSlug adds the slug to the circuits providers list params +func (o *CircuitsProvidersListParams) WithSlug(slug *string) *CircuitsProvidersListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the circuits providers list params +func (o *CircuitsProvidersListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsProvidersListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Account != nil { + + // query param account + var qrAccount string + if o.Account != nil { + qrAccount = *o.Account + } + qAccount := qrAccount + if qAccount != "" { + if err := r.SetQueryParam("account", qAccount); err != nil { + return err + } + } + + } + + if o.Asn != nil { + + // query param asn + var qrAsn float64 + if o.Asn != nil { + qrAsn = *o.Asn + } + qAsn := swag.FormatFloat64(qrAsn) + if qAsn != "" { + if err := r.SetQueryParam("asn", qAsn); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); 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.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.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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_list_responses.go new file mode 100644 index 0000000..838465f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsProvidersListReader is a Reader for the CircuitsProvidersList structure. +type CircuitsProvidersListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsProvidersListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsProvidersListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsProvidersListOK creates a CircuitsProvidersListOK with default headers values +func NewCircuitsProvidersListOK() *CircuitsProvidersListOK { + return &CircuitsProvidersListOK{} +} + +/*CircuitsProvidersListOK handles this case with default header values. + +CircuitsProvidersListOK circuits providers list o k +*/ +type CircuitsProvidersListOK struct { + Payload *models.CircuitsProvidersListOKBody +} + +func (o *CircuitsProvidersListOK) Error() string { + return fmt.Sprintf("[GET /circuits/providers/][%d] circuitsProvidersListOK %+v", 200, o.Payload) +} + +func (o *CircuitsProvidersListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitsProvidersListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_partial_update_parameters.go new file mode 100644 index 0000000..c1d3d90 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewCircuitsProvidersPartialUpdateParams creates a new CircuitsProvidersPartialUpdateParams object +// with the default values initialized. +func NewCircuitsProvidersPartialUpdateParams() *CircuitsProvidersPartialUpdateParams { + var () + return &CircuitsProvidersPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsProvidersPartialUpdateParamsWithTimeout creates a new CircuitsProvidersPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsProvidersPartialUpdateParamsWithTimeout(timeout time.Duration) *CircuitsProvidersPartialUpdateParams { + var () + return &CircuitsProvidersPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewCircuitsProvidersPartialUpdateParamsWithContext creates a new CircuitsProvidersPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsProvidersPartialUpdateParamsWithContext(ctx context.Context) *CircuitsProvidersPartialUpdateParams { + var () + return &CircuitsProvidersPartialUpdateParams{ + + Context: ctx, + } +} + +// NewCircuitsProvidersPartialUpdateParamsWithHTTPClient creates a new CircuitsProvidersPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsProvidersPartialUpdateParamsWithHTTPClient(client *http.Client) *CircuitsProvidersPartialUpdateParams { + var () + return &CircuitsProvidersPartialUpdateParams{ + HTTPClient: client, + } +} + +/*CircuitsProvidersPartialUpdateParams contains all the parameters to send to the API endpoint +for the circuits providers partial update operation typically these are written to a http.Request +*/ +type CircuitsProvidersPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableProvider + /*ID + A unique integer value identifying this provider. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) WithTimeout(timeout time.Duration) *CircuitsProvidersPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) WithContext(ctx context.Context) *CircuitsProvidersPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) WithHTTPClient(client *http.Client) *CircuitsProvidersPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) WithData(data *models.WritableProvider) *CircuitsProvidersPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) SetData(data *models.WritableProvider) { + o.Data = data +} + +// WithID adds the id to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) WithID(id int64) *CircuitsProvidersPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsProvidersPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_partial_update_responses.go new file mode 100644 index 0000000..55ca289 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsProvidersPartialUpdateReader is a Reader for the CircuitsProvidersPartialUpdate structure. +type CircuitsProvidersPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsProvidersPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsProvidersPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsProvidersPartialUpdateOK creates a CircuitsProvidersPartialUpdateOK with default headers values +func NewCircuitsProvidersPartialUpdateOK() *CircuitsProvidersPartialUpdateOK { + return &CircuitsProvidersPartialUpdateOK{} +} + +/*CircuitsProvidersPartialUpdateOK handles this case with default header values. + +CircuitsProvidersPartialUpdateOK circuits providers partial update o k +*/ +type CircuitsProvidersPartialUpdateOK struct { + Payload *models.WritableProvider +} + +func (o *CircuitsProvidersPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /circuits/providers/{id}/][%d] circuitsProvidersPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *CircuitsProvidersPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableProvider) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_read_parameters.go new file mode 100644 index 0000000..4fa0f3b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewCircuitsProvidersReadParams creates a new CircuitsProvidersReadParams object +// with the default values initialized. +func NewCircuitsProvidersReadParams() *CircuitsProvidersReadParams { + var () + return &CircuitsProvidersReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsProvidersReadParamsWithTimeout creates a new CircuitsProvidersReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsProvidersReadParamsWithTimeout(timeout time.Duration) *CircuitsProvidersReadParams { + var () + return &CircuitsProvidersReadParams{ + + timeout: timeout, + } +} + +// NewCircuitsProvidersReadParamsWithContext creates a new CircuitsProvidersReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsProvidersReadParamsWithContext(ctx context.Context) *CircuitsProvidersReadParams { + var () + return &CircuitsProvidersReadParams{ + + Context: ctx, + } +} + +// NewCircuitsProvidersReadParamsWithHTTPClient creates a new CircuitsProvidersReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsProvidersReadParamsWithHTTPClient(client *http.Client) *CircuitsProvidersReadParams { + var () + return &CircuitsProvidersReadParams{ + HTTPClient: client, + } +} + +/*CircuitsProvidersReadParams contains all the parameters to send to the API endpoint +for the circuits providers read operation typically these are written to a http.Request +*/ +type CircuitsProvidersReadParams struct { + + /*ID + A unique integer value identifying this provider. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits providers read params +func (o *CircuitsProvidersReadParams) WithTimeout(timeout time.Duration) *CircuitsProvidersReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits providers read params +func (o *CircuitsProvidersReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits providers read params +func (o *CircuitsProvidersReadParams) WithContext(ctx context.Context) *CircuitsProvidersReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits providers read params +func (o *CircuitsProvidersReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits providers read params +func (o *CircuitsProvidersReadParams) WithHTTPClient(client *http.Client) *CircuitsProvidersReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits providers read params +func (o *CircuitsProvidersReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits providers read params +func (o *CircuitsProvidersReadParams) WithID(id int64) *CircuitsProvidersReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits providers read params +func (o *CircuitsProvidersReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsProvidersReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_read_responses.go new file mode 100644 index 0000000..d62098f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsProvidersReadReader is a Reader for the CircuitsProvidersRead structure. +type CircuitsProvidersReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsProvidersReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsProvidersReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsProvidersReadOK creates a CircuitsProvidersReadOK with default headers values +func NewCircuitsProvidersReadOK() *CircuitsProvidersReadOK { + return &CircuitsProvidersReadOK{} +} + +/*CircuitsProvidersReadOK handles this case with default header values. + +CircuitsProvidersReadOK circuits providers read o k +*/ +type CircuitsProvidersReadOK struct { + Payload *models.Provider +} + +func (o *CircuitsProvidersReadOK) Error() string { + return fmt.Sprintf("[GET /circuits/providers/{id}/][%d] circuitsProvidersReadOK %+v", 200, o.Payload) +} + +func (o *CircuitsProvidersReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Provider) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_update_parameters.go new file mode 100644 index 0000000..671c5fd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewCircuitsProvidersUpdateParams creates a new CircuitsProvidersUpdateParams object +// with the default values initialized. +func NewCircuitsProvidersUpdateParams() *CircuitsProvidersUpdateParams { + var () + return &CircuitsProvidersUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsProvidersUpdateParamsWithTimeout creates a new CircuitsProvidersUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsProvidersUpdateParamsWithTimeout(timeout time.Duration) *CircuitsProvidersUpdateParams { + var () + return &CircuitsProvidersUpdateParams{ + + timeout: timeout, + } +} + +// NewCircuitsProvidersUpdateParamsWithContext creates a new CircuitsProvidersUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsProvidersUpdateParamsWithContext(ctx context.Context) *CircuitsProvidersUpdateParams { + var () + return &CircuitsProvidersUpdateParams{ + + Context: ctx, + } +} + +// NewCircuitsProvidersUpdateParamsWithHTTPClient creates a new CircuitsProvidersUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsProvidersUpdateParamsWithHTTPClient(client *http.Client) *CircuitsProvidersUpdateParams { + var () + return &CircuitsProvidersUpdateParams{ + HTTPClient: client, + } +} + +/*CircuitsProvidersUpdateParams contains all the parameters to send to the API endpoint +for the circuits providers update operation typically these are written to a http.Request +*/ +type CircuitsProvidersUpdateParams struct { + + /*Data*/ + Data *models.WritableProvider + /*ID + A unique integer value identifying this provider. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) WithTimeout(timeout time.Duration) *CircuitsProvidersUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) WithContext(ctx context.Context) *CircuitsProvidersUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) WithHTTPClient(client *http.Client) *CircuitsProvidersUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) WithData(data *models.WritableProvider) *CircuitsProvidersUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) SetData(data *models.WritableProvider) { + o.Data = data +} + +// WithID adds the id to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) WithID(id int64) *CircuitsProvidersUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsProvidersUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_update_responses.go new file mode 100644 index 0000000..befd105 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/circuits/circuits_providers_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 circuits + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// CircuitsProvidersUpdateReader is a Reader for the CircuitsProvidersUpdate structure. +type CircuitsProvidersUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsProvidersUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsProvidersUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCircuitsProvidersUpdateOK creates a CircuitsProvidersUpdateOK with default headers values +func NewCircuitsProvidersUpdateOK() *CircuitsProvidersUpdateOK { + return &CircuitsProvidersUpdateOK{} +} + +/*CircuitsProvidersUpdateOK handles this case with default header values. + +CircuitsProvidersUpdateOK circuits providers update o k +*/ +type CircuitsProvidersUpdateOK struct { + Payload *models.WritableProvider +} + +func (o *CircuitsProvidersUpdateOK) Error() string { + return fmt.Sprintf("[PUT /circuits/providers/{id}/][%d] circuitsProvidersUpdateOK %+v", 200, o.Payload) +} + +func (o *CircuitsProvidersUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableProvider) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_choices_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_choices_list_parameters.go new file mode 100644 index 0000000..675a843 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_choices_list_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimChoicesListParams creates a new DcimChoicesListParams object +// with the default values initialized. +func NewDcimChoicesListParams() *DcimChoicesListParams { + + return &DcimChoicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimChoicesListParamsWithTimeout creates a new DcimChoicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimChoicesListParamsWithTimeout(timeout time.Duration) *DcimChoicesListParams { + + return &DcimChoicesListParams{ + + timeout: timeout, + } +} + +// NewDcimChoicesListParamsWithContext creates a new DcimChoicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimChoicesListParamsWithContext(ctx context.Context) *DcimChoicesListParams { + + return &DcimChoicesListParams{ + + Context: ctx, + } +} + +// NewDcimChoicesListParamsWithHTTPClient creates a new DcimChoicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimChoicesListParamsWithHTTPClient(client *http.Client) *DcimChoicesListParams { + + return &DcimChoicesListParams{ + HTTPClient: client, + } +} + +/*DcimChoicesListParams contains all the parameters to send to the API endpoint +for the dcim choices list operation typically these are written to a http.Request +*/ +type DcimChoicesListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim choices list params +func (o *DcimChoicesListParams) WithTimeout(timeout time.Duration) *DcimChoicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim choices list params +func (o *DcimChoicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim choices list params +func (o *DcimChoicesListParams) WithContext(ctx context.Context) *DcimChoicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim choices list params +func (o *DcimChoicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim choices list params +func (o *DcimChoicesListParams) WithHTTPClient(client *http.Client) *DcimChoicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim choices list params +func (o *DcimChoicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimChoicesListParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_choices_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_choices_list_responses.go new file mode 100644 index 0000000..cf40dbc --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_choices_list_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimChoicesListReader is a Reader for the DcimChoicesList structure. +type DcimChoicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimChoicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimChoicesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimChoicesListOK creates a DcimChoicesListOK with default headers values +func NewDcimChoicesListOK() *DcimChoicesListOK { + return &DcimChoicesListOK{} +} + +/*DcimChoicesListOK handles this case with default header values. + +DcimChoicesListOK dcim choices list o k +*/ +type DcimChoicesListOK struct { +} + +func (o *DcimChoicesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/_choices/][%d] dcimChoicesListOK ", 200) +} + +func (o *DcimChoicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_choices_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_choices_read_parameters.go new file mode 100644 index 0000000..f0757bd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_choices_read_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimChoicesReadParams creates a new DcimChoicesReadParams object +// with the default values initialized. +func NewDcimChoicesReadParams() *DcimChoicesReadParams { + var () + return &DcimChoicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimChoicesReadParamsWithTimeout creates a new DcimChoicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimChoicesReadParamsWithTimeout(timeout time.Duration) *DcimChoicesReadParams { + var () + return &DcimChoicesReadParams{ + + timeout: timeout, + } +} + +// NewDcimChoicesReadParamsWithContext creates a new DcimChoicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimChoicesReadParamsWithContext(ctx context.Context) *DcimChoicesReadParams { + var () + return &DcimChoicesReadParams{ + + Context: ctx, + } +} + +// NewDcimChoicesReadParamsWithHTTPClient creates a new DcimChoicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimChoicesReadParamsWithHTTPClient(client *http.Client) *DcimChoicesReadParams { + var () + return &DcimChoicesReadParams{ + HTTPClient: client, + } +} + +/*DcimChoicesReadParams contains all the parameters to send to the API endpoint +for the dcim choices read operation typically these are written to a http.Request +*/ +type DcimChoicesReadParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim choices read params +func (o *DcimChoicesReadParams) WithTimeout(timeout time.Duration) *DcimChoicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim choices read params +func (o *DcimChoicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim choices read params +func (o *DcimChoicesReadParams) WithContext(ctx context.Context) *DcimChoicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim choices read params +func (o *DcimChoicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim choices read params +func (o *DcimChoicesReadParams) WithHTTPClient(client *http.Client) *DcimChoicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim choices read params +func (o *DcimChoicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim choices read params +func (o *DcimChoicesReadParams) WithID(id string) *DcimChoicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim choices read params +func (o *DcimChoicesReadParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimChoicesReadParams) 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", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_choices_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_choices_read_responses.go new file mode 100644 index 0000000..ca9b7c0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_choices_read_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimChoicesReadReader is a Reader for the DcimChoicesRead structure. +type DcimChoicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimChoicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimChoicesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimChoicesReadOK creates a DcimChoicesReadOK with default headers values +func NewDcimChoicesReadOK() *DcimChoicesReadOK { + return &DcimChoicesReadOK{} +} + +/*DcimChoicesReadOK handles this case with default header values. + +DcimChoicesReadOK dcim choices read o k +*/ +type DcimChoicesReadOK struct { +} + +func (o *DcimChoicesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/_choices/{id}/][%d] dcimChoicesReadOK ", 200) +} + +func (o *DcimChoicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_client.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_client.go new file mode 100644 index 0000000..4f088b8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_client.go @@ -0,0 +1,4834 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new dcim API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for dcim API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +DcimChoicesList dcim choices list API +*/ +func (a *Client) DcimChoicesList(params *DcimChoicesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimChoicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimChoicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim__choices_list", + Method: "GET", + PathPattern: "/dcim/_choices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimChoicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimChoicesListOK), nil + +} + +/* +DcimChoicesRead dcim choices read API +*/ +func (a *Client) DcimChoicesRead(params *DcimChoicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimChoicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimChoicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim__choices_read", + Method: "GET", + PathPattern: "/dcim/_choices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimChoicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimChoicesReadOK), nil + +} + +/* +DcimConnectedDeviceList This endpoint allows a user to determine what device (if any) is connected to a given peer device and peer +interface. This is useful in a situation where a device boots with no configuration, but can detect its neighbors +via a protocol such as LLDP. Two query parameters must be included in the request: + +* `peer-device`: The name of the peer device +* `peer-interface`: The name of the peer interface +*/ +func (a *Client) DcimConnectedDeviceList(params *DcimConnectedDeviceListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConnectedDeviceListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConnectedDeviceListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_connected-device_list", + Method: "GET", + PathPattern: "/dcim/connected-device/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConnectedDeviceListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConnectedDeviceListOK), nil + +} + +/* +DcimConsoleConnectionsList dcim console connections list API +*/ +func (a *Client) DcimConsoleConnectionsList(params *DcimConsoleConnectionsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleConnectionsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleConnectionsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-connections_list", + Method: "GET", + PathPattern: "/dcim/console-connections/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleConnectionsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleConnectionsListOK), nil + +} + +/* +DcimConsolePortTemplatesCreate dcim console port templates create API +*/ +func (a *Client) DcimConsolePortTemplatesCreate(params *DcimConsolePortTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortTemplatesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortTemplatesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-port-templates_create", + Method: "POST", + PathPattern: "/dcim/console-port-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortTemplatesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortTemplatesCreateCreated), nil + +} + +/* +DcimConsolePortTemplatesDelete dcim console port templates delete API +*/ +func (a *Client) DcimConsolePortTemplatesDelete(params *DcimConsolePortTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortTemplatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortTemplatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-port-templates_delete", + Method: "DELETE", + PathPattern: "/dcim/console-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortTemplatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortTemplatesDeleteNoContent), nil + +} + +/* +DcimConsolePortTemplatesList dcim console port templates list API +*/ +func (a *Client) DcimConsolePortTemplatesList(params *DcimConsolePortTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortTemplatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortTemplatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-port-templates_list", + Method: "GET", + PathPattern: "/dcim/console-port-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortTemplatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortTemplatesListOK), nil + +} + +/* +DcimConsolePortTemplatesPartialUpdate dcim console port templates partial update API +*/ +func (a *Client) DcimConsolePortTemplatesPartialUpdate(params *DcimConsolePortTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortTemplatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortTemplatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-port-templates_partial_update", + Method: "PATCH", + PathPattern: "/dcim/console-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortTemplatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortTemplatesPartialUpdateOK), nil + +} + +/* +DcimConsolePortTemplatesRead dcim console port templates read API +*/ +func (a *Client) DcimConsolePortTemplatesRead(params *DcimConsolePortTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortTemplatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortTemplatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-port-templates_read", + Method: "GET", + PathPattern: "/dcim/console-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortTemplatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortTemplatesReadOK), nil + +} + +/* +DcimConsolePortTemplatesUpdate dcim console port templates update API +*/ +func (a *Client) DcimConsolePortTemplatesUpdate(params *DcimConsolePortTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortTemplatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortTemplatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-port-templates_update", + Method: "PUT", + PathPattern: "/dcim/console-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortTemplatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortTemplatesUpdateOK), nil + +} + +/* +DcimConsolePortsCreate dcim console ports create API +*/ +func (a *Client) DcimConsolePortsCreate(params *DcimConsolePortsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-ports_create", + Method: "POST", + PathPattern: "/dcim/console-ports/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortsCreateCreated), nil + +} + +/* +DcimConsolePortsDelete dcim console ports delete API +*/ +func (a *Client) DcimConsolePortsDelete(params *DcimConsolePortsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-ports_delete", + Method: "DELETE", + PathPattern: "/dcim/console-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortsDeleteNoContent), nil + +} + +/* +DcimConsolePortsList dcim console ports list API +*/ +func (a *Client) DcimConsolePortsList(params *DcimConsolePortsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-ports_list", + Method: "GET", + PathPattern: "/dcim/console-ports/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortsListOK), nil + +} + +/* +DcimConsolePortsPartialUpdate dcim console ports partial update API +*/ +func (a *Client) DcimConsolePortsPartialUpdate(params *DcimConsolePortsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-ports_partial_update", + Method: "PATCH", + PathPattern: "/dcim/console-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortsPartialUpdateOK), nil + +} + +/* +DcimConsolePortsRead dcim console ports read API +*/ +func (a *Client) DcimConsolePortsRead(params *DcimConsolePortsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-ports_read", + Method: "GET", + PathPattern: "/dcim/console-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortsReadOK), nil + +} + +/* +DcimConsolePortsUpdate dcim console ports update API +*/ +func (a *Client) DcimConsolePortsUpdate(params *DcimConsolePortsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-ports_update", + Method: "PUT", + PathPattern: "/dcim/console-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortsUpdateOK), nil + +} + +/* +DcimConsoleServerPortTemplatesCreate dcim console server port templates create API +*/ +func (a *Client) DcimConsoleServerPortTemplatesCreate(params *DcimConsoleServerPortTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortTemplatesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortTemplatesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-port-templates_create", + Method: "POST", + PathPattern: "/dcim/console-server-port-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortTemplatesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortTemplatesCreateCreated), nil + +} + +/* +DcimConsoleServerPortTemplatesDelete dcim console server port templates delete API +*/ +func (a *Client) DcimConsoleServerPortTemplatesDelete(params *DcimConsoleServerPortTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortTemplatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortTemplatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-port-templates_delete", + Method: "DELETE", + PathPattern: "/dcim/console-server-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortTemplatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortTemplatesDeleteNoContent), nil + +} + +/* +DcimConsoleServerPortTemplatesList dcim console server port templates list API +*/ +func (a *Client) DcimConsoleServerPortTemplatesList(params *DcimConsoleServerPortTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortTemplatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortTemplatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-port-templates_list", + Method: "GET", + PathPattern: "/dcim/console-server-port-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortTemplatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortTemplatesListOK), nil + +} + +/* +DcimConsoleServerPortTemplatesPartialUpdate dcim console server port templates partial update API +*/ +func (a *Client) DcimConsoleServerPortTemplatesPartialUpdate(params *DcimConsoleServerPortTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortTemplatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortTemplatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-port-templates_partial_update", + Method: "PATCH", + PathPattern: "/dcim/console-server-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortTemplatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortTemplatesPartialUpdateOK), nil + +} + +/* +DcimConsoleServerPortTemplatesRead dcim console server port templates read API +*/ +func (a *Client) DcimConsoleServerPortTemplatesRead(params *DcimConsoleServerPortTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortTemplatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortTemplatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-port-templates_read", + Method: "GET", + PathPattern: "/dcim/console-server-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortTemplatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortTemplatesReadOK), nil + +} + +/* +DcimConsoleServerPortTemplatesUpdate dcim console server port templates update API +*/ +func (a *Client) DcimConsoleServerPortTemplatesUpdate(params *DcimConsoleServerPortTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortTemplatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortTemplatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-port-templates_update", + Method: "PUT", + PathPattern: "/dcim/console-server-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortTemplatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortTemplatesUpdateOK), nil + +} + +/* +DcimConsoleServerPortsCreate dcim console server ports create API +*/ +func (a *Client) DcimConsoleServerPortsCreate(params *DcimConsoleServerPortsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-ports_create", + Method: "POST", + PathPattern: "/dcim/console-server-ports/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortsCreateCreated), nil + +} + +/* +DcimConsoleServerPortsDelete dcim console server ports delete API +*/ +func (a *Client) DcimConsoleServerPortsDelete(params *DcimConsoleServerPortsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-ports_delete", + Method: "DELETE", + PathPattern: "/dcim/console-server-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortsDeleteNoContent), nil + +} + +/* +DcimConsoleServerPortsList dcim console server ports list API +*/ +func (a *Client) DcimConsoleServerPortsList(params *DcimConsoleServerPortsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-ports_list", + Method: "GET", + PathPattern: "/dcim/console-server-ports/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortsListOK), nil + +} + +/* +DcimConsoleServerPortsPartialUpdate dcim console server ports partial update API +*/ +func (a *Client) DcimConsoleServerPortsPartialUpdate(params *DcimConsoleServerPortsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-ports_partial_update", + Method: "PATCH", + PathPattern: "/dcim/console-server-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortsPartialUpdateOK), nil + +} + +/* +DcimConsoleServerPortsRead dcim console server ports read API +*/ +func (a *Client) DcimConsoleServerPortsRead(params *DcimConsoleServerPortsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-ports_read", + Method: "GET", + PathPattern: "/dcim/console-server-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortsReadOK), nil + +} + +/* +DcimConsoleServerPortsUpdate dcim console server ports update API +*/ +func (a *Client) DcimConsoleServerPortsUpdate(params *DcimConsoleServerPortsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-ports_update", + Method: "PUT", + PathPattern: "/dcim/console-server-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortsUpdateOK), nil + +} + +/* +DcimDeviceBayTemplatesCreate dcim device bay templates create API +*/ +func (a *Client) DcimDeviceBayTemplatesCreate(params *DcimDeviceBayTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBayTemplatesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBayTemplatesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bay-templates_create", + Method: "POST", + PathPattern: "/dcim/device-bay-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBayTemplatesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBayTemplatesCreateCreated), nil + +} + +/* +DcimDeviceBayTemplatesDelete dcim device bay templates delete API +*/ +func (a *Client) DcimDeviceBayTemplatesDelete(params *DcimDeviceBayTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBayTemplatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBayTemplatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bay-templates_delete", + Method: "DELETE", + PathPattern: "/dcim/device-bay-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBayTemplatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBayTemplatesDeleteNoContent), nil + +} + +/* +DcimDeviceBayTemplatesList dcim device bay templates list API +*/ +func (a *Client) DcimDeviceBayTemplatesList(params *DcimDeviceBayTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBayTemplatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBayTemplatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bay-templates_list", + Method: "GET", + PathPattern: "/dcim/device-bay-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBayTemplatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBayTemplatesListOK), nil + +} + +/* +DcimDeviceBayTemplatesPartialUpdate dcim device bay templates partial update API +*/ +func (a *Client) DcimDeviceBayTemplatesPartialUpdate(params *DcimDeviceBayTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBayTemplatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBayTemplatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bay-templates_partial_update", + Method: "PATCH", + PathPattern: "/dcim/device-bay-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBayTemplatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBayTemplatesPartialUpdateOK), nil + +} + +/* +DcimDeviceBayTemplatesRead dcim device bay templates read API +*/ +func (a *Client) DcimDeviceBayTemplatesRead(params *DcimDeviceBayTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBayTemplatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBayTemplatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bay-templates_read", + Method: "GET", + PathPattern: "/dcim/device-bay-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBayTemplatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBayTemplatesReadOK), nil + +} + +/* +DcimDeviceBayTemplatesUpdate dcim device bay templates update API +*/ +func (a *Client) DcimDeviceBayTemplatesUpdate(params *DcimDeviceBayTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBayTemplatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBayTemplatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bay-templates_update", + Method: "PUT", + PathPattern: "/dcim/device-bay-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBayTemplatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBayTemplatesUpdateOK), nil + +} + +/* +DcimDeviceBaysCreate dcim device bays create API +*/ +func (a *Client) DcimDeviceBaysCreate(params *DcimDeviceBaysCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBaysCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBaysCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bays_create", + Method: "POST", + PathPattern: "/dcim/device-bays/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBaysCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBaysCreateCreated), nil + +} + +/* +DcimDeviceBaysDelete dcim device bays delete API +*/ +func (a *Client) DcimDeviceBaysDelete(params *DcimDeviceBaysDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBaysDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBaysDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bays_delete", + Method: "DELETE", + PathPattern: "/dcim/device-bays/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBaysDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBaysDeleteNoContent), nil + +} + +/* +DcimDeviceBaysList dcim device bays list API +*/ +func (a *Client) DcimDeviceBaysList(params *DcimDeviceBaysListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBaysListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBaysListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bays_list", + Method: "GET", + PathPattern: "/dcim/device-bays/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBaysListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBaysListOK), nil + +} + +/* +DcimDeviceBaysPartialUpdate dcim device bays partial update API +*/ +func (a *Client) DcimDeviceBaysPartialUpdate(params *DcimDeviceBaysPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBaysPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBaysPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bays_partial_update", + Method: "PATCH", + PathPattern: "/dcim/device-bays/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBaysPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBaysPartialUpdateOK), nil + +} + +/* +DcimDeviceBaysRead dcim device bays read API +*/ +func (a *Client) DcimDeviceBaysRead(params *DcimDeviceBaysReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBaysReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBaysReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bays_read", + Method: "GET", + PathPattern: "/dcim/device-bays/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBaysReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBaysReadOK), nil + +} + +/* +DcimDeviceBaysUpdate dcim device bays update API +*/ +func (a *Client) DcimDeviceBaysUpdate(params *DcimDeviceBaysUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBaysUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBaysUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bays_update", + Method: "PUT", + PathPattern: "/dcim/device-bays/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBaysUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBaysUpdateOK), nil + +} + +/* +DcimDeviceRolesCreate dcim device roles create API +*/ +func (a *Client) DcimDeviceRolesCreate(params *DcimDeviceRolesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceRolesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceRolesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-roles_create", + Method: "POST", + PathPattern: "/dcim/device-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceRolesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceRolesCreateCreated), nil + +} + +/* +DcimDeviceRolesDelete dcim device roles delete API +*/ +func (a *Client) DcimDeviceRolesDelete(params *DcimDeviceRolesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceRolesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceRolesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-roles_delete", + Method: "DELETE", + PathPattern: "/dcim/device-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceRolesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceRolesDeleteNoContent), nil + +} + +/* +DcimDeviceRolesList dcim device roles list API +*/ +func (a *Client) DcimDeviceRolesList(params *DcimDeviceRolesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceRolesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceRolesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-roles_list", + Method: "GET", + PathPattern: "/dcim/device-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceRolesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceRolesListOK), nil + +} + +/* +DcimDeviceRolesPartialUpdate dcim device roles partial update API +*/ +func (a *Client) DcimDeviceRolesPartialUpdate(params *DcimDeviceRolesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceRolesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceRolesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-roles_partial_update", + Method: "PATCH", + PathPattern: "/dcim/device-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceRolesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceRolesPartialUpdateOK), nil + +} + +/* +DcimDeviceRolesRead dcim device roles read API +*/ +func (a *Client) DcimDeviceRolesRead(params *DcimDeviceRolesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceRolesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceRolesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-roles_read", + Method: "GET", + PathPattern: "/dcim/device-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceRolesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceRolesReadOK), nil + +} + +/* +DcimDeviceRolesUpdate dcim device roles update API +*/ +func (a *Client) DcimDeviceRolesUpdate(params *DcimDeviceRolesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceRolesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceRolesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-roles_update", + Method: "PUT", + PathPattern: "/dcim/device-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceRolesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceRolesUpdateOK), nil + +} + +/* +DcimDeviceTypesCreate dcim device types create API +*/ +func (a *Client) DcimDeviceTypesCreate(params *DcimDeviceTypesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceTypesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceTypesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-types_create", + Method: "POST", + PathPattern: "/dcim/device-types/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceTypesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceTypesCreateCreated), nil + +} + +/* +DcimDeviceTypesDelete dcim device types delete API +*/ +func (a *Client) DcimDeviceTypesDelete(params *DcimDeviceTypesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceTypesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceTypesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-types_delete", + Method: "DELETE", + PathPattern: "/dcim/device-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceTypesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceTypesDeleteNoContent), nil + +} + +/* +DcimDeviceTypesList dcim device types list API +*/ +func (a *Client) DcimDeviceTypesList(params *DcimDeviceTypesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceTypesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceTypesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-types_list", + Method: "GET", + PathPattern: "/dcim/device-types/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceTypesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceTypesListOK), nil + +} + +/* +DcimDeviceTypesPartialUpdate dcim device types partial update API +*/ +func (a *Client) DcimDeviceTypesPartialUpdate(params *DcimDeviceTypesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceTypesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceTypesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-types_partial_update", + Method: "PATCH", + PathPattern: "/dcim/device-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceTypesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceTypesPartialUpdateOK), nil + +} + +/* +DcimDeviceTypesRead dcim device types read API +*/ +func (a *Client) DcimDeviceTypesRead(params *DcimDeviceTypesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceTypesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceTypesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-types_read", + Method: "GET", + PathPattern: "/dcim/device-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceTypesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceTypesReadOK), nil + +} + +/* +DcimDeviceTypesUpdate dcim device types update API +*/ +func (a *Client) DcimDeviceTypesUpdate(params *DcimDeviceTypesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceTypesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceTypesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-types_update", + Method: "PUT", + PathPattern: "/dcim/device-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceTypesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceTypesUpdateOK), nil + +} + +/* +DcimDevicesCreate dcim devices create API +*/ +func (a *Client) DcimDevicesCreate(params *DcimDevicesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDevicesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDevicesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_devices_create", + Method: "POST", + PathPattern: "/dcim/devices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDevicesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDevicesCreateCreated), nil + +} + +/* +DcimDevicesDelete dcim devices delete API +*/ +func (a *Client) DcimDevicesDelete(params *DcimDevicesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDevicesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDevicesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_devices_delete", + Method: "DELETE", + PathPattern: "/dcim/devices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDevicesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDevicesDeleteNoContent), nil + +} + +/* +DcimDevicesList dcim devices list API +*/ +func (a *Client) DcimDevicesList(params *DcimDevicesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDevicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDevicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_devices_list", + Method: "GET", + PathPattern: "/dcim/devices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDevicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDevicesListOK), nil + +} + +/* +DcimDevicesNapalm Execute a NAPALM method on a Device +*/ +func (a *Client) DcimDevicesNapalm(params *DcimDevicesNapalmParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDevicesNapalmOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDevicesNapalmParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_devices_napalm", + Method: "GET", + PathPattern: "/dcim/devices/{id}/napalm/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDevicesNapalmReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDevicesNapalmOK), nil + +} + +/* +DcimDevicesPartialUpdate dcim devices partial update API +*/ +func (a *Client) DcimDevicesPartialUpdate(params *DcimDevicesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDevicesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDevicesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_devices_partial_update", + Method: "PATCH", + PathPattern: "/dcim/devices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDevicesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDevicesPartialUpdateOK), nil + +} + +/* +DcimDevicesRead dcim devices read API +*/ +func (a *Client) DcimDevicesRead(params *DcimDevicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDevicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDevicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_devices_read", + Method: "GET", + PathPattern: "/dcim/devices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDevicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDevicesReadOK), nil + +} + +/* +DcimDevicesUpdate dcim devices update API +*/ +func (a *Client) DcimDevicesUpdate(params *DcimDevicesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDevicesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDevicesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_devices_update", + Method: "PUT", + PathPattern: "/dcim/devices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDevicesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDevicesUpdateOK), nil + +} + +/* +DcimInterfaceConnectionsCreate dcim interface connections create API +*/ +func (a *Client) DcimInterfaceConnectionsCreate(params *DcimInterfaceConnectionsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceConnectionsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-connections_create", + Method: "POST", + PathPattern: "/dcim/interface-connections/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceConnectionsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceConnectionsCreateCreated), nil + +} + +/* +DcimInterfaceConnectionsDelete dcim interface connections delete API +*/ +func (a *Client) DcimInterfaceConnectionsDelete(params *DcimInterfaceConnectionsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceConnectionsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-connections_delete", + Method: "DELETE", + PathPattern: "/dcim/interface-connections/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceConnectionsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceConnectionsDeleteNoContent), nil + +} + +/* +DcimInterfaceConnectionsList dcim interface connections list API +*/ +func (a *Client) DcimInterfaceConnectionsList(params *DcimInterfaceConnectionsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceConnectionsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-connections_list", + Method: "GET", + PathPattern: "/dcim/interface-connections/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceConnectionsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceConnectionsListOK), nil + +} + +/* +DcimInterfaceConnectionsPartialUpdate dcim interface connections partial update API +*/ +func (a *Client) DcimInterfaceConnectionsPartialUpdate(params *DcimInterfaceConnectionsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceConnectionsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-connections_partial_update", + Method: "PATCH", + PathPattern: "/dcim/interface-connections/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceConnectionsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceConnectionsPartialUpdateOK), nil + +} + +/* +DcimInterfaceConnectionsRead dcim interface connections read API +*/ +func (a *Client) DcimInterfaceConnectionsRead(params *DcimInterfaceConnectionsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceConnectionsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-connections_read", + Method: "GET", + PathPattern: "/dcim/interface-connections/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceConnectionsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceConnectionsReadOK), nil + +} + +/* +DcimInterfaceConnectionsUpdate dcim interface connections update API +*/ +func (a *Client) DcimInterfaceConnectionsUpdate(params *DcimInterfaceConnectionsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceConnectionsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-connections_update", + Method: "PUT", + PathPattern: "/dcim/interface-connections/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceConnectionsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceConnectionsUpdateOK), nil + +} + +/* +DcimInterfaceTemplatesCreate dcim interface templates create API +*/ +func (a *Client) DcimInterfaceTemplatesCreate(params *DcimInterfaceTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_create", + Method: "POST", + PathPattern: "/dcim/interface-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesCreateCreated), nil + +} + +/* +DcimInterfaceTemplatesDelete dcim interface templates delete API +*/ +func (a *Client) DcimInterfaceTemplatesDelete(params *DcimInterfaceTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_delete", + Method: "DELETE", + PathPattern: "/dcim/interface-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesDeleteNoContent), nil + +} + +/* +DcimInterfaceTemplatesList dcim interface templates list API +*/ +func (a *Client) DcimInterfaceTemplatesList(params *DcimInterfaceTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_list", + Method: "GET", + PathPattern: "/dcim/interface-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesListOK), nil + +} + +/* +DcimInterfaceTemplatesPartialUpdate dcim interface templates partial update API +*/ +func (a *Client) DcimInterfaceTemplatesPartialUpdate(params *DcimInterfaceTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_partial_update", + Method: "PATCH", + PathPattern: "/dcim/interface-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesPartialUpdateOK), nil + +} + +/* +DcimInterfaceTemplatesRead dcim interface templates read API +*/ +func (a *Client) DcimInterfaceTemplatesRead(params *DcimInterfaceTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_read", + Method: "GET", + PathPattern: "/dcim/interface-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesReadOK), nil + +} + +/* +DcimInterfaceTemplatesUpdate dcim interface templates update API +*/ +func (a *Client) DcimInterfaceTemplatesUpdate(params *DcimInterfaceTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_update", + Method: "PUT", + PathPattern: "/dcim/interface-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesUpdateOK), nil + +} + +/* +DcimInterfacesCreate dcim interfaces create API +*/ +func (a *Client) DcimInterfacesCreate(params *DcimInterfacesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_create", + Method: "POST", + PathPattern: "/dcim/interfaces/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesCreateCreated), nil + +} + +/* +DcimInterfacesDelete dcim interfaces delete API +*/ +func (a *Client) DcimInterfacesDelete(params *DcimInterfacesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_delete", + Method: "DELETE", + PathPattern: "/dcim/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesDeleteNoContent), nil + +} + +/* +DcimInterfacesGraphs A convenience method for rendering graphs for a particular interface. +*/ +func (a *Client) DcimInterfacesGraphs(params *DcimInterfacesGraphsParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesGraphsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesGraphsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_graphs", + Method: "GET", + PathPattern: "/dcim/interfaces/{id}/graphs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesGraphsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesGraphsOK), nil + +} + +/* +DcimInterfacesList dcim interfaces list API +*/ +func (a *Client) DcimInterfacesList(params *DcimInterfacesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_list", + Method: "GET", + PathPattern: "/dcim/interfaces/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesListOK), nil + +} + +/* +DcimInterfacesPartialUpdate dcim interfaces partial update API +*/ +func (a *Client) DcimInterfacesPartialUpdate(params *DcimInterfacesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_partial_update", + Method: "PATCH", + PathPattern: "/dcim/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesPartialUpdateOK), nil + +} + +/* +DcimInterfacesRead dcim interfaces read API +*/ +func (a *Client) DcimInterfacesRead(params *DcimInterfacesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_read", + Method: "GET", + PathPattern: "/dcim/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesReadOK), nil + +} + +/* +DcimInterfacesUpdate dcim interfaces update API +*/ +func (a *Client) DcimInterfacesUpdate(params *DcimInterfacesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_update", + Method: "PUT", + PathPattern: "/dcim/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesUpdateOK), nil + +} + +/* +DcimInventoryItemsCreate dcim inventory items create API +*/ +func (a *Client) DcimInventoryItemsCreate(params *DcimInventoryItemsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInventoryItemsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInventoryItemsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_inventory-items_create", + Method: "POST", + PathPattern: "/dcim/inventory-items/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInventoryItemsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInventoryItemsCreateCreated), nil + +} + +/* +DcimInventoryItemsDelete dcim inventory items delete API +*/ +func (a *Client) DcimInventoryItemsDelete(params *DcimInventoryItemsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInventoryItemsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInventoryItemsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_inventory-items_delete", + Method: "DELETE", + PathPattern: "/dcim/inventory-items/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInventoryItemsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInventoryItemsDeleteNoContent), nil + +} + +/* +DcimInventoryItemsList dcim inventory items list API +*/ +func (a *Client) DcimInventoryItemsList(params *DcimInventoryItemsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInventoryItemsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInventoryItemsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_inventory-items_list", + Method: "GET", + PathPattern: "/dcim/inventory-items/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInventoryItemsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInventoryItemsListOK), nil + +} + +/* +DcimInventoryItemsPartialUpdate dcim inventory items partial update API +*/ +func (a *Client) DcimInventoryItemsPartialUpdate(params *DcimInventoryItemsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInventoryItemsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInventoryItemsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_inventory-items_partial_update", + Method: "PATCH", + PathPattern: "/dcim/inventory-items/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInventoryItemsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInventoryItemsPartialUpdateOK), nil + +} + +/* +DcimInventoryItemsRead dcim inventory items read API +*/ +func (a *Client) DcimInventoryItemsRead(params *DcimInventoryItemsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInventoryItemsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInventoryItemsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_inventory-items_read", + Method: "GET", + PathPattern: "/dcim/inventory-items/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInventoryItemsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInventoryItemsReadOK), nil + +} + +/* +DcimInventoryItemsUpdate dcim inventory items update API +*/ +func (a *Client) DcimInventoryItemsUpdate(params *DcimInventoryItemsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInventoryItemsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInventoryItemsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_inventory-items_update", + Method: "PUT", + PathPattern: "/dcim/inventory-items/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInventoryItemsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInventoryItemsUpdateOK), nil + +} + +/* +DcimManufacturersCreate dcim manufacturers create API +*/ +func (a *Client) DcimManufacturersCreate(params *DcimManufacturersCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimManufacturersCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimManufacturersCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_manufacturers_create", + Method: "POST", + PathPattern: "/dcim/manufacturers/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimManufacturersCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimManufacturersCreateCreated), nil + +} + +/* +DcimManufacturersDelete dcim manufacturers delete API +*/ +func (a *Client) DcimManufacturersDelete(params *DcimManufacturersDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimManufacturersDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimManufacturersDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_manufacturers_delete", + Method: "DELETE", + PathPattern: "/dcim/manufacturers/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimManufacturersDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimManufacturersDeleteNoContent), nil + +} + +/* +DcimManufacturersList dcim manufacturers list API +*/ +func (a *Client) DcimManufacturersList(params *DcimManufacturersListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimManufacturersListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimManufacturersListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_manufacturers_list", + Method: "GET", + PathPattern: "/dcim/manufacturers/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimManufacturersListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimManufacturersListOK), nil + +} + +/* +DcimManufacturersPartialUpdate dcim manufacturers partial update API +*/ +func (a *Client) DcimManufacturersPartialUpdate(params *DcimManufacturersPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimManufacturersPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimManufacturersPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_manufacturers_partial_update", + Method: "PATCH", + PathPattern: "/dcim/manufacturers/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimManufacturersPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimManufacturersPartialUpdateOK), nil + +} + +/* +DcimManufacturersRead dcim manufacturers read API +*/ +func (a *Client) DcimManufacturersRead(params *DcimManufacturersReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimManufacturersReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimManufacturersReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_manufacturers_read", + Method: "GET", + PathPattern: "/dcim/manufacturers/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimManufacturersReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimManufacturersReadOK), nil + +} + +/* +DcimManufacturersUpdate dcim manufacturers update API +*/ +func (a *Client) DcimManufacturersUpdate(params *DcimManufacturersUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimManufacturersUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimManufacturersUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_manufacturers_update", + Method: "PUT", + PathPattern: "/dcim/manufacturers/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimManufacturersUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimManufacturersUpdateOK), nil + +} + +/* +DcimPlatformsCreate dcim platforms create API +*/ +func (a *Client) DcimPlatformsCreate(params *DcimPlatformsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPlatformsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPlatformsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_platforms_create", + Method: "POST", + PathPattern: "/dcim/platforms/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPlatformsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPlatformsCreateCreated), nil + +} + +/* +DcimPlatformsDelete dcim platforms delete API +*/ +func (a *Client) DcimPlatformsDelete(params *DcimPlatformsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPlatformsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPlatformsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_platforms_delete", + Method: "DELETE", + PathPattern: "/dcim/platforms/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPlatformsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPlatformsDeleteNoContent), nil + +} + +/* +DcimPlatformsList dcim platforms list API +*/ +func (a *Client) DcimPlatformsList(params *DcimPlatformsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPlatformsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPlatformsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_platforms_list", + Method: "GET", + PathPattern: "/dcim/platforms/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPlatformsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPlatformsListOK), nil + +} + +/* +DcimPlatformsPartialUpdate dcim platforms partial update API +*/ +func (a *Client) DcimPlatformsPartialUpdate(params *DcimPlatformsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPlatformsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPlatformsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_platforms_partial_update", + Method: "PATCH", + PathPattern: "/dcim/platforms/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPlatformsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPlatformsPartialUpdateOK), nil + +} + +/* +DcimPlatformsRead dcim platforms read API +*/ +func (a *Client) DcimPlatformsRead(params *DcimPlatformsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPlatformsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPlatformsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_platforms_read", + Method: "GET", + PathPattern: "/dcim/platforms/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPlatformsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPlatformsReadOK), nil + +} + +/* +DcimPlatformsUpdate dcim platforms update API +*/ +func (a *Client) DcimPlatformsUpdate(params *DcimPlatformsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPlatformsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPlatformsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_platforms_update", + Method: "PUT", + PathPattern: "/dcim/platforms/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPlatformsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPlatformsUpdateOK), nil + +} + +/* +DcimPowerConnectionsList dcim power connections list API +*/ +func (a *Client) DcimPowerConnectionsList(params *DcimPowerConnectionsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerConnectionsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerConnectionsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-connections_list", + Method: "GET", + PathPattern: "/dcim/power-connections/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerConnectionsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerConnectionsListOK), nil + +} + +/* +DcimPowerOutletTemplatesCreate dcim power outlet templates create API +*/ +func (a *Client) DcimPowerOutletTemplatesCreate(params *DcimPowerOutletTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletTemplatesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlet-templates_create", + Method: "POST", + PathPattern: "/dcim/power-outlet-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletTemplatesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletTemplatesCreateCreated), nil + +} + +/* +DcimPowerOutletTemplatesDelete dcim power outlet templates delete API +*/ +func (a *Client) DcimPowerOutletTemplatesDelete(params *DcimPowerOutletTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletTemplatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlet-templates_delete", + Method: "DELETE", + PathPattern: "/dcim/power-outlet-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletTemplatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletTemplatesDeleteNoContent), nil + +} + +/* +DcimPowerOutletTemplatesList dcim power outlet templates list API +*/ +func (a *Client) DcimPowerOutletTemplatesList(params *DcimPowerOutletTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletTemplatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlet-templates_list", + Method: "GET", + PathPattern: "/dcim/power-outlet-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletTemplatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletTemplatesListOK), nil + +} + +/* +DcimPowerOutletTemplatesPartialUpdate dcim power outlet templates partial update API +*/ +func (a *Client) DcimPowerOutletTemplatesPartialUpdate(params *DcimPowerOutletTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletTemplatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlet-templates_partial_update", + Method: "PATCH", + PathPattern: "/dcim/power-outlet-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletTemplatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletTemplatesPartialUpdateOK), nil + +} + +/* +DcimPowerOutletTemplatesRead dcim power outlet templates read API +*/ +func (a *Client) DcimPowerOutletTemplatesRead(params *DcimPowerOutletTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletTemplatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlet-templates_read", + Method: "GET", + PathPattern: "/dcim/power-outlet-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletTemplatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletTemplatesReadOK), nil + +} + +/* +DcimPowerOutletTemplatesUpdate dcim power outlet templates update API +*/ +func (a *Client) DcimPowerOutletTemplatesUpdate(params *DcimPowerOutletTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletTemplatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlet-templates_update", + Method: "PUT", + PathPattern: "/dcim/power-outlet-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletTemplatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletTemplatesUpdateOK), nil + +} + +/* +DcimPowerOutletsCreate dcim power outlets create API +*/ +func (a *Client) DcimPowerOutletsCreate(params *DcimPowerOutletsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlets_create", + Method: "POST", + PathPattern: "/dcim/power-outlets/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletsCreateCreated), nil + +} + +/* +DcimPowerOutletsDelete dcim power outlets delete API +*/ +func (a *Client) DcimPowerOutletsDelete(params *DcimPowerOutletsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlets_delete", + Method: "DELETE", + PathPattern: "/dcim/power-outlets/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletsDeleteNoContent), nil + +} + +/* +DcimPowerOutletsList dcim power outlets list API +*/ +func (a *Client) DcimPowerOutletsList(params *DcimPowerOutletsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlets_list", + Method: "GET", + PathPattern: "/dcim/power-outlets/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletsListOK), nil + +} + +/* +DcimPowerOutletsPartialUpdate dcim power outlets partial update API +*/ +func (a *Client) DcimPowerOutletsPartialUpdate(params *DcimPowerOutletsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlets_partial_update", + Method: "PATCH", + PathPattern: "/dcim/power-outlets/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletsPartialUpdateOK), nil + +} + +/* +DcimPowerOutletsRead dcim power outlets read API +*/ +func (a *Client) DcimPowerOutletsRead(params *DcimPowerOutletsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlets_read", + Method: "GET", + PathPattern: "/dcim/power-outlets/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletsReadOK), nil + +} + +/* +DcimPowerOutletsUpdate dcim power outlets update API +*/ +func (a *Client) DcimPowerOutletsUpdate(params *DcimPowerOutletsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlets_update", + Method: "PUT", + PathPattern: "/dcim/power-outlets/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletsUpdateOK), nil + +} + +/* +DcimPowerPortTemplatesCreate dcim power port templates create API +*/ +func (a *Client) DcimPowerPortTemplatesCreate(params *DcimPowerPortTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortTemplatesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-port-templates_create", + Method: "POST", + PathPattern: "/dcim/power-port-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesCreateCreated), nil + +} + +/* +DcimPowerPortTemplatesDelete dcim power port templates delete API +*/ +func (a *Client) DcimPowerPortTemplatesDelete(params *DcimPowerPortTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortTemplatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-port-templates_delete", + Method: "DELETE", + PathPattern: "/dcim/power-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesDeleteNoContent), nil + +} + +/* +DcimPowerPortTemplatesList dcim power port templates list API +*/ +func (a *Client) DcimPowerPortTemplatesList(params *DcimPowerPortTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortTemplatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-port-templates_list", + Method: "GET", + PathPattern: "/dcim/power-port-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesListOK), nil + +} + +/* +DcimPowerPortTemplatesPartialUpdate dcim power port templates partial update API +*/ +func (a *Client) DcimPowerPortTemplatesPartialUpdate(params *DcimPowerPortTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortTemplatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-port-templates_partial_update", + Method: "PATCH", + PathPattern: "/dcim/power-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesPartialUpdateOK), nil + +} + +/* +DcimPowerPortTemplatesRead dcim power port templates read API +*/ +func (a *Client) DcimPowerPortTemplatesRead(params *DcimPowerPortTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortTemplatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-port-templates_read", + Method: "GET", + PathPattern: "/dcim/power-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesReadOK), nil + +} + +/* +DcimPowerPortTemplatesUpdate dcim power port templates update API +*/ +func (a *Client) DcimPowerPortTemplatesUpdate(params *DcimPowerPortTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortTemplatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-port-templates_update", + Method: "PUT", + PathPattern: "/dcim/power-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesUpdateOK), nil + +} + +/* +DcimPowerPortsCreate dcim power ports create API +*/ +func (a *Client) DcimPowerPortsCreate(params *DcimPowerPortsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_create", + Method: "POST", + PathPattern: "/dcim/power-ports/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsCreateCreated), nil + +} + +/* +DcimPowerPortsDelete dcim power ports delete API +*/ +func (a *Client) DcimPowerPortsDelete(params *DcimPowerPortsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_delete", + Method: "DELETE", + PathPattern: "/dcim/power-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsDeleteNoContent), nil + +} + +/* +DcimPowerPortsList dcim power ports list API +*/ +func (a *Client) DcimPowerPortsList(params *DcimPowerPortsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_list", + Method: "GET", + PathPattern: "/dcim/power-ports/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsListOK), nil + +} + +/* +DcimPowerPortsPartialUpdate dcim power ports partial update API +*/ +func (a *Client) DcimPowerPortsPartialUpdate(params *DcimPowerPortsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_partial_update", + Method: "PATCH", + PathPattern: "/dcim/power-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsPartialUpdateOK), nil + +} + +/* +DcimPowerPortsRead dcim power ports read API +*/ +func (a *Client) DcimPowerPortsRead(params *DcimPowerPortsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_read", + Method: "GET", + PathPattern: "/dcim/power-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsReadOK), nil + +} + +/* +DcimPowerPortsUpdate dcim power ports update API +*/ +func (a *Client) DcimPowerPortsUpdate(params *DcimPowerPortsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_update", + Method: "PUT", + PathPattern: "/dcim/power-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsUpdateOK), nil + +} + +/* +DcimRackGroupsCreate dcim rack groups create API +*/ +func (a *Client) DcimRackGroupsCreate(params *DcimRackGroupsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_create", + Method: "POST", + PathPattern: "/dcim/rack-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsCreateCreated), nil + +} + +/* +DcimRackGroupsDelete dcim rack groups delete API +*/ +func (a *Client) DcimRackGroupsDelete(params *DcimRackGroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_delete", + Method: "DELETE", + PathPattern: "/dcim/rack-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsDeleteNoContent), nil + +} + +/* +DcimRackGroupsList dcim rack groups list API +*/ +func (a *Client) DcimRackGroupsList(params *DcimRackGroupsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_list", + Method: "GET", + PathPattern: "/dcim/rack-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsListOK), nil + +} + +/* +DcimRackGroupsPartialUpdate dcim rack groups partial update API +*/ +func (a *Client) DcimRackGroupsPartialUpdate(params *DcimRackGroupsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_partial_update", + Method: "PATCH", + PathPattern: "/dcim/rack-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsPartialUpdateOK), nil + +} + +/* +DcimRackGroupsRead dcim rack groups read API +*/ +func (a *Client) DcimRackGroupsRead(params *DcimRackGroupsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_read", + Method: "GET", + PathPattern: "/dcim/rack-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsReadOK), nil + +} + +/* +DcimRackGroupsUpdate dcim rack groups update API +*/ +func (a *Client) DcimRackGroupsUpdate(params *DcimRackGroupsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_update", + Method: "PUT", + PathPattern: "/dcim/rack-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsUpdateOK), nil + +} + +/* +DcimRackReservationsCreate dcim rack reservations create API +*/ +func (a *Client) DcimRackReservationsCreate(params *DcimRackReservationsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_create", + Method: "POST", + PathPattern: "/dcim/rack-reservations/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsCreateCreated), nil + +} + +/* +DcimRackReservationsDelete dcim rack reservations delete API +*/ +func (a *Client) DcimRackReservationsDelete(params *DcimRackReservationsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_delete", + Method: "DELETE", + PathPattern: "/dcim/rack-reservations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsDeleteNoContent), nil + +} + +/* +DcimRackReservationsList dcim rack reservations list API +*/ +func (a *Client) DcimRackReservationsList(params *DcimRackReservationsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_list", + Method: "GET", + PathPattern: "/dcim/rack-reservations/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsListOK), nil + +} + +/* +DcimRackReservationsPartialUpdate dcim rack reservations partial update API +*/ +func (a *Client) DcimRackReservationsPartialUpdate(params *DcimRackReservationsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_partial_update", + Method: "PATCH", + PathPattern: "/dcim/rack-reservations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsPartialUpdateOK), nil + +} + +/* +DcimRackReservationsRead dcim rack reservations read API +*/ +func (a *Client) DcimRackReservationsRead(params *DcimRackReservationsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_read", + Method: "GET", + PathPattern: "/dcim/rack-reservations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsReadOK), nil + +} + +/* +DcimRackReservationsUpdate dcim rack reservations update API +*/ +func (a *Client) DcimRackReservationsUpdate(params *DcimRackReservationsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_update", + Method: "PUT", + PathPattern: "/dcim/rack-reservations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsUpdateOK), nil + +} + +/* +DcimRackRolesCreate dcim rack roles create API +*/ +func (a *Client) DcimRackRolesCreate(params *DcimRackRolesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackRolesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-roles_create", + Method: "POST", + PathPattern: "/dcim/rack-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackRolesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackRolesCreateCreated), nil + +} + +/* +DcimRackRolesDelete dcim rack roles delete API +*/ +func (a *Client) DcimRackRolesDelete(params *DcimRackRolesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackRolesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-roles_delete", + Method: "DELETE", + PathPattern: "/dcim/rack-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackRolesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackRolesDeleteNoContent), nil + +} + +/* +DcimRackRolesList dcim rack roles list API +*/ +func (a *Client) DcimRackRolesList(params *DcimRackRolesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackRolesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-roles_list", + Method: "GET", + PathPattern: "/dcim/rack-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackRolesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackRolesListOK), nil + +} + +/* +DcimRackRolesPartialUpdate dcim rack roles partial update API +*/ +func (a *Client) DcimRackRolesPartialUpdate(params *DcimRackRolesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackRolesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-roles_partial_update", + Method: "PATCH", + PathPattern: "/dcim/rack-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackRolesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackRolesPartialUpdateOK), nil + +} + +/* +DcimRackRolesRead dcim rack roles read API +*/ +func (a *Client) DcimRackRolesRead(params *DcimRackRolesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackRolesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-roles_read", + Method: "GET", + PathPattern: "/dcim/rack-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackRolesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackRolesReadOK), nil + +} + +/* +DcimRackRolesUpdate dcim rack roles update API +*/ +func (a *Client) DcimRackRolesUpdate(params *DcimRackRolesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackRolesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-roles_update", + Method: "PUT", + PathPattern: "/dcim/rack-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackRolesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackRolesUpdateOK), nil + +} + +/* +DcimRacksCreate dcim racks create API +*/ +func (a *Client) DcimRacksCreate(params *DcimRacksCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRacksCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_racks_create", + Method: "POST", + PathPattern: "/dcim/racks/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRacksCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRacksCreateCreated), nil + +} + +/* +DcimRacksDelete dcim racks delete API +*/ +func (a *Client) DcimRacksDelete(params *DcimRacksDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRacksDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_racks_delete", + Method: "DELETE", + PathPattern: "/dcim/racks/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRacksDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRacksDeleteNoContent), nil + +} + +/* +DcimRacksList dcim racks list API +*/ +func (a *Client) DcimRacksList(params *DcimRacksListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRacksListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_racks_list", + Method: "GET", + PathPattern: "/dcim/racks/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRacksListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRacksListOK), nil + +} + +/* +DcimRacksPartialUpdate dcim racks partial update API +*/ +func (a *Client) DcimRacksPartialUpdate(params *DcimRacksPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRacksPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_racks_partial_update", + Method: "PATCH", + PathPattern: "/dcim/racks/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRacksPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRacksPartialUpdateOK), nil + +} + +/* +DcimRacksRead dcim racks read API +*/ +func (a *Client) DcimRacksRead(params *DcimRacksReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRacksReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_racks_read", + Method: "GET", + PathPattern: "/dcim/racks/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRacksReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRacksReadOK), nil + +} + +/* +DcimRacksUnits List rack units (by rack) +*/ +func (a *Client) DcimRacksUnits(params *DcimRacksUnitsParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksUnitsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRacksUnitsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_racks_units", + Method: "GET", + PathPattern: "/dcim/racks/{id}/units/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRacksUnitsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRacksUnitsOK), nil + +} + +/* +DcimRacksUpdate dcim racks update API +*/ +func (a *Client) DcimRacksUpdate(params *DcimRacksUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRacksUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_racks_update", + Method: "PUT", + PathPattern: "/dcim/racks/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRacksUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRacksUpdateOK), nil + +} + +/* +DcimRegionsCreate dcim regions create API +*/ +func (a *Client) DcimRegionsCreate(params *DcimRegionsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRegionsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRegionsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_regions_create", + Method: "POST", + PathPattern: "/dcim/regions/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRegionsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRegionsCreateCreated), nil + +} + +/* +DcimRegionsDelete dcim regions delete API +*/ +func (a *Client) DcimRegionsDelete(params *DcimRegionsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRegionsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRegionsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_regions_delete", + Method: "DELETE", + PathPattern: "/dcim/regions/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRegionsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRegionsDeleteNoContent), nil + +} + +/* +DcimRegionsList dcim regions list API +*/ +func (a *Client) DcimRegionsList(params *DcimRegionsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRegionsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRegionsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_regions_list", + Method: "GET", + PathPattern: "/dcim/regions/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRegionsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRegionsListOK), nil + +} + +/* +DcimRegionsPartialUpdate dcim regions partial update API +*/ +func (a *Client) DcimRegionsPartialUpdate(params *DcimRegionsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRegionsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRegionsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_regions_partial_update", + Method: "PATCH", + PathPattern: "/dcim/regions/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRegionsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRegionsPartialUpdateOK), nil + +} + +/* +DcimRegionsRead dcim regions read API +*/ +func (a *Client) DcimRegionsRead(params *DcimRegionsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRegionsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRegionsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_regions_read", + Method: "GET", + PathPattern: "/dcim/regions/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRegionsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRegionsReadOK), nil + +} + +/* +DcimRegionsUpdate dcim regions update API +*/ +func (a *Client) DcimRegionsUpdate(params *DcimRegionsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRegionsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRegionsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_regions_update", + Method: "PUT", + PathPattern: "/dcim/regions/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRegionsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRegionsUpdateOK), nil + +} + +/* +DcimSitesCreate dcim sites create API +*/ +func (a *Client) DcimSitesCreate(params *DcimSitesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimSitesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimSitesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_sites_create", + Method: "POST", + PathPattern: "/dcim/sites/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimSitesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimSitesCreateCreated), nil + +} + +/* +DcimSitesDelete dcim sites delete API +*/ +func (a *Client) DcimSitesDelete(params *DcimSitesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimSitesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimSitesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_sites_delete", + Method: "DELETE", + PathPattern: "/dcim/sites/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimSitesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimSitesDeleteNoContent), nil + +} + +/* +DcimSitesGraphs A convenience method for rendering graphs for a particular site. +*/ +func (a *Client) DcimSitesGraphs(params *DcimSitesGraphsParams, authInfo runtime.ClientAuthInfoWriter) (*DcimSitesGraphsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimSitesGraphsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_sites_graphs", + Method: "GET", + PathPattern: "/dcim/sites/{id}/graphs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimSitesGraphsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimSitesGraphsOK), nil + +} + +/* +DcimSitesList dcim sites list API +*/ +func (a *Client) DcimSitesList(params *DcimSitesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimSitesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimSitesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_sites_list", + Method: "GET", + PathPattern: "/dcim/sites/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimSitesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimSitesListOK), nil + +} + +/* +DcimSitesPartialUpdate dcim sites partial update API +*/ +func (a *Client) DcimSitesPartialUpdate(params *DcimSitesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimSitesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimSitesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_sites_partial_update", + Method: "PATCH", + PathPattern: "/dcim/sites/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimSitesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimSitesPartialUpdateOK), nil + +} + +/* +DcimSitesRead dcim sites read API +*/ +func (a *Client) DcimSitesRead(params *DcimSitesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimSitesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimSitesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_sites_read", + Method: "GET", + PathPattern: "/dcim/sites/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimSitesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimSitesReadOK), nil + +} + +/* +DcimSitesUpdate dcim sites update API +*/ +func (a *Client) DcimSitesUpdate(params *DcimSitesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimSitesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimSitesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_sites_update", + Method: "PUT", + PathPattern: "/dcim/sites/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimSitesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimSitesUpdateOK), nil + +} + +/* +DcimVirtualChassisCreate dcim virtual chassis create API +*/ +func (a *Client) DcimVirtualChassisCreate(params *DcimVirtualChassisCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimVirtualChassisCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimVirtualChassisCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_virtual-chassis_create", + Method: "POST", + PathPattern: "/dcim/virtual-chassis/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimVirtualChassisCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimVirtualChassisCreateCreated), nil + +} + +/* +DcimVirtualChassisDelete dcim virtual chassis delete API +*/ +func (a *Client) DcimVirtualChassisDelete(params *DcimVirtualChassisDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimVirtualChassisDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimVirtualChassisDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_virtual-chassis_delete", + Method: "DELETE", + PathPattern: "/dcim/virtual-chassis/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimVirtualChassisDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimVirtualChassisDeleteNoContent), nil + +} + +/* +DcimVirtualChassisList dcim virtual chassis list API +*/ +func (a *Client) DcimVirtualChassisList(params *DcimVirtualChassisListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimVirtualChassisListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimVirtualChassisListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_virtual-chassis_list", + Method: "GET", + PathPattern: "/dcim/virtual-chassis/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimVirtualChassisListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimVirtualChassisListOK), nil + +} + +/* +DcimVirtualChassisPartialUpdate dcim virtual chassis partial update API +*/ +func (a *Client) DcimVirtualChassisPartialUpdate(params *DcimVirtualChassisPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimVirtualChassisPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimVirtualChassisPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_virtual-chassis_partial_update", + Method: "PATCH", + PathPattern: "/dcim/virtual-chassis/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimVirtualChassisPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimVirtualChassisPartialUpdateOK), nil + +} + +/* +DcimVirtualChassisRead dcim virtual chassis read API +*/ +func (a *Client) DcimVirtualChassisRead(params *DcimVirtualChassisReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimVirtualChassisReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimVirtualChassisReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_virtual-chassis_read", + Method: "GET", + PathPattern: "/dcim/virtual-chassis/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimVirtualChassisReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimVirtualChassisReadOK), nil + +} + +/* +DcimVirtualChassisUpdate dcim virtual chassis update API +*/ +func (a *Client) DcimVirtualChassisUpdate(params *DcimVirtualChassisUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimVirtualChassisUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimVirtualChassisUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_virtual-chassis_update", + Method: "PUT", + PathPattern: "/dcim/virtual-chassis/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimVirtualChassisUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimVirtualChassisUpdateOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_connected_device_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_connected_device_list_parameters.go new file mode 100644 index 0000000..2524a3b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_connected_device_list_parameters.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimConnectedDeviceListParams creates a new DcimConnectedDeviceListParams object +// with the default values initialized. +func NewDcimConnectedDeviceListParams() *DcimConnectedDeviceListParams { + var () + return &DcimConnectedDeviceListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConnectedDeviceListParamsWithTimeout creates a new DcimConnectedDeviceListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConnectedDeviceListParamsWithTimeout(timeout time.Duration) *DcimConnectedDeviceListParams { + var () + return &DcimConnectedDeviceListParams{ + + timeout: timeout, + } +} + +// NewDcimConnectedDeviceListParamsWithContext creates a new DcimConnectedDeviceListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConnectedDeviceListParamsWithContext(ctx context.Context) *DcimConnectedDeviceListParams { + var () + return &DcimConnectedDeviceListParams{ + + Context: ctx, + } +} + +// NewDcimConnectedDeviceListParamsWithHTTPClient creates a new DcimConnectedDeviceListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConnectedDeviceListParamsWithHTTPClient(client *http.Client) *DcimConnectedDeviceListParams { + var () + return &DcimConnectedDeviceListParams{ + HTTPClient: client, + } +} + +/*DcimConnectedDeviceListParams contains all the parameters to send to the API endpoint +for the dcim connected device list operation typically these are written to a http.Request +*/ +type DcimConnectedDeviceListParams struct { + + /*PeerDevice + The name of the peer device + + */ + PeerDevice string + /*PeerInterface + The name of the peer interface + + */ + PeerInterface string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim connected device list params +func (o *DcimConnectedDeviceListParams) WithTimeout(timeout time.Duration) *DcimConnectedDeviceListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim connected device list params +func (o *DcimConnectedDeviceListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim connected device list params +func (o *DcimConnectedDeviceListParams) WithContext(ctx context.Context) *DcimConnectedDeviceListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim connected device list params +func (o *DcimConnectedDeviceListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim connected device list params +func (o *DcimConnectedDeviceListParams) WithHTTPClient(client *http.Client) *DcimConnectedDeviceListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim connected device list params +func (o *DcimConnectedDeviceListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPeerDevice adds the peerDevice to the dcim connected device list params +func (o *DcimConnectedDeviceListParams) WithPeerDevice(peerDevice string) *DcimConnectedDeviceListParams { + o.SetPeerDevice(peerDevice) + return o +} + +// SetPeerDevice adds the peerDevice to the dcim connected device list params +func (o *DcimConnectedDeviceListParams) SetPeerDevice(peerDevice string) { + o.PeerDevice = peerDevice +} + +// WithPeerInterface adds the peerInterface to the dcim connected device list params +func (o *DcimConnectedDeviceListParams) WithPeerInterface(peerInterface string) *DcimConnectedDeviceListParams { + o.SetPeerInterface(peerInterface) + return o +} + +// SetPeerInterface adds the peerInterface to the dcim connected device list params +func (o *DcimConnectedDeviceListParams) SetPeerInterface(peerInterface string) { + o.PeerInterface = peerInterface +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConnectedDeviceListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param peer-device + qrPeerDevice := o.PeerDevice + qPeerDevice := qrPeerDevice + if qPeerDevice != "" { + if err := r.SetQueryParam("peer-device", qPeerDevice); err != nil { + return err + } + } + + // query param peer-interface + qrPeerInterface := o.PeerInterface + qPeerInterface := qrPeerInterface + if qPeerInterface != "" { + if err := r.SetQueryParam("peer-interface", qPeerInterface); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_connected_device_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_connected_device_list_responses.go new file mode 100644 index 0000000..2aada3c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_connected_device_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConnectedDeviceListReader is a Reader for the DcimConnectedDeviceList structure. +type DcimConnectedDeviceListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConnectedDeviceListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConnectedDeviceListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConnectedDeviceListOK creates a DcimConnectedDeviceListOK with default headers values +func NewDcimConnectedDeviceListOK() *DcimConnectedDeviceListOK { + return &DcimConnectedDeviceListOK{} +} + +/*DcimConnectedDeviceListOK handles this case with default header values. + +DcimConnectedDeviceListOK dcim connected device list o k +*/ +type DcimConnectedDeviceListOK struct { + Payload *models.Device +} + +func (o *DcimConnectedDeviceListOK) Error() string { + return fmt.Sprintf("[GET /dcim/connected-device/][%d] dcimConnectedDeviceListOK %+v", 200, o.Payload) +} + +func (o *DcimConnectedDeviceListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Device) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_connections_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_connections_list_parameters.go new file mode 100644 index 0000000..63185cf --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_connections_list_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimConsoleConnectionsListParams creates a new DcimConsoleConnectionsListParams object +// with the default values initialized. +func NewDcimConsoleConnectionsListParams() *DcimConsoleConnectionsListParams { + var () + return &DcimConsoleConnectionsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleConnectionsListParamsWithTimeout creates a new DcimConsoleConnectionsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleConnectionsListParamsWithTimeout(timeout time.Duration) *DcimConsoleConnectionsListParams { + var () + return &DcimConsoleConnectionsListParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleConnectionsListParamsWithContext creates a new DcimConsoleConnectionsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleConnectionsListParamsWithContext(ctx context.Context) *DcimConsoleConnectionsListParams { + var () + return &DcimConsoleConnectionsListParams{ + + Context: ctx, + } +} + +// NewDcimConsoleConnectionsListParamsWithHTTPClient creates a new DcimConsoleConnectionsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleConnectionsListParamsWithHTTPClient(client *http.Client) *DcimConsoleConnectionsListParams { + var () + return &DcimConsoleConnectionsListParams{ + HTTPClient: client, + } +} + +/*DcimConsoleConnectionsListParams contains all the parameters to send to the API endpoint +for the dcim console connections list operation typically these are written to a http.Request +*/ +type DcimConsoleConnectionsListParams struct { + + /*ConnectionStatus*/ + ConnectionStatus *string + /*Device*/ + Device *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Site*/ + Site *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithTimeout(timeout time.Duration) *DcimConsoleConnectionsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithContext(ctx context.Context) *DcimConsoleConnectionsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithHTTPClient(client *http.Client) *DcimConsoleConnectionsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionStatus adds the connectionStatus to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithConnectionStatus(connectionStatus *string) *DcimConsoleConnectionsListParams { + o.SetConnectionStatus(connectionStatus) + return o +} + +// SetConnectionStatus adds the connectionStatus to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetConnectionStatus(connectionStatus *string) { + o.ConnectionStatus = connectionStatus +} + +// WithDevice adds the device to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithDevice(device *string) *DcimConsoleConnectionsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithLimit adds the limit to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithLimit(limit *int64) *DcimConsoleConnectionsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithName(name *string) *DcimConsoleConnectionsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithOffset(offset *int64) *DcimConsoleConnectionsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSite adds the site to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithSite(site *string) *DcimConsoleConnectionsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetSite(site *string) { + o.Site = site +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleConnectionsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ConnectionStatus != nil { + + // query param connection_status + var qrConnectionStatus string + if o.ConnectionStatus != nil { + qrConnectionStatus = *o.ConnectionStatus + } + qConnectionStatus := qrConnectionStatus + if qConnectionStatus != "" { + if err := r.SetQueryParam("connection_status", qConnectionStatus); err != nil { + return err + } + } + + } + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); 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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_connections_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_connections_list_responses.go new file mode 100644 index 0000000..e909386 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_connections_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsoleConnectionsListReader is a Reader for the DcimConsoleConnectionsList structure. +type DcimConsoleConnectionsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleConnectionsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleConnectionsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsoleConnectionsListOK creates a DcimConsoleConnectionsListOK with default headers values +func NewDcimConsoleConnectionsListOK() *DcimConsoleConnectionsListOK { + return &DcimConsoleConnectionsListOK{} +} + +/*DcimConsoleConnectionsListOK handles this case with default header values. + +DcimConsoleConnectionsListOK dcim console connections list o k +*/ +type DcimConsoleConnectionsListOK struct { + Payload *models.DcimConsoleConnectionsListOKBody +} + +func (o *DcimConsoleConnectionsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-connections/][%d] dcimConsoleConnectionsListOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleConnectionsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimConsoleConnectionsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_create_parameters.go new file mode 100644 index 0000000..e6fd658 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimConsolePortTemplatesCreateParams creates a new DcimConsolePortTemplatesCreateParams object +// with the default values initialized. +func NewDcimConsolePortTemplatesCreateParams() *DcimConsolePortTemplatesCreateParams { + var () + return &DcimConsolePortTemplatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortTemplatesCreateParamsWithTimeout creates a new DcimConsolePortTemplatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortTemplatesCreateParamsWithTimeout(timeout time.Duration) *DcimConsolePortTemplatesCreateParams { + var () + return &DcimConsolePortTemplatesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortTemplatesCreateParamsWithContext creates a new DcimConsolePortTemplatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortTemplatesCreateParamsWithContext(ctx context.Context) *DcimConsolePortTemplatesCreateParams { + var () + return &DcimConsolePortTemplatesCreateParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortTemplatesCreateParamsWithHTTPClient creates a new DcimConsolePortTemplatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortTemplatesCreateParamsWithHTTPClient(client *http.Client) *DcimConsolePortTemplatesCreateParams { + var () + return &DcimConsolePortTemplatesCreateParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortTemplatesCreateParams contains all the parameters to send to the API endpoint +for the dcim console port templates create operation typically these are written to a http.Request +*/ +type DcimConsolePortTemplatesCreateParams struct { + + /*Data*/ + Data *models.WritableConsolePortTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console port templates create params +func (o *DcimConsolePortTemplatesCreateParams) WithTimeout(timeout time.Duration) *DcimConsolePortTemplatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console port templates create params +func (o *DcimConsolePortTemplatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console port templates create params +func (o *DcimConsolePortTemplatesCreateParams) WithContext(ctx context.Context) *DcimConsolePortTemplatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console port templates create params +func (o *DcimConsolePortTemplatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console port templates create params +func (o *DcimConsolePortTemplatesCreateParams) WithHTTPClient(client *http.Client) *DcimConsolePortTemplatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console port templates create params +func (o *DcimConsolePortTemplatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console port templates create params +func (o *DcimConsolePortTemplatesCreateParams) WithData(data *models.WritableConsolePortTemplate) *DcimConsolePortTemplatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console port templates create params +func (o *DcimConsolePortTemplatesCreateParams) SetData(data *models.WritableConsolePortTemplate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortTemplatesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_create_responses.go new file mode 100644 index 0000000..79d2eca --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsolePortTemplatesCreateReader is a Reader for the DcimConsolePortTemplatesCreate structure. +type DcimConsolePortTemplatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortTemplatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimConsolePortTemplatesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsolePortTemplatesCreateCreated creates a DcimConsolePortTemplatesCreateCreated with default headers values +func NewDcimConsolePortTemplatesCreateCreated() *DcimConsolePortTemplatesCreateCreated { + return &DcimConsolePortTemplatesCreateCreated{} +} + +/*DcimConsolePortTemplatesCreateCreated handles this case with default header values. + +DcimConsolePortTemplatesCreateCreated dcim console port templates create created +*/ +type DcimConsolePortTemplatesCreateCreated struct { + Payload *models.WritableConsolePortTemplate +} + +func (o *DcimConsolePortTemplatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/console-port-templates/][%d] dcimConsolePortTemplatesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimConsolePortTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsolePortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_delete_parameters.go new file mode 100644 index 0000000..1b1b898 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimConsolePortTemplatesDeleteParams creates a new DcimConsolePortTemplatesDeleteParams object +// with the default values initialized. +func NewDcimConsolePortTemplatesDeleteParams() *DcimConsolePortTemplatesDeleteParams { + var () + return &DcimConsolePortTemplatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortTemplatesDeleteParamsWithTimeout creates a new DcimConsolePortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortTemplatesDeleteParamsWithTimeout(timeout time.Duration) *DcimConsolePortTemplatesDeleteParams { + var () + return &DcimConsolePortTemplatesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortTemplatesDeleteParamsWithContext creates a new DcimConsolePortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortTemplatesDeleteParamsWithContext(ctx context.Context) *DcimConsolePortTemplatesDeleteParams { + var () + return &DcimConsolePortTemplatesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortTemplatesDeleteParamsWithHTTPClient creates a new DcimConsolePortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortTemplatesDeleteParamsWithHTTPClient(client *http.Client) *DcimConsolePortTemplatesDeleteParams { + var () + return &DcimConsolePortTemplatesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortTemplatesDeleteParams contains all the parameters to send to the API endpoint +for the dcim console port templates delete operation typically these are written to a http.Request +*/ +type DcimConsolePortTemplatesDeleteParams struct { + + /*ID + A unique integer value identifying this console port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console port templates delete params +func (o *DcimConsolePortTemplatesDeleteParams) WithTimeout(timeout time.Duration) *DcimConsolePortTemplatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console port templates delete params +func (o *DcimConsolePortTemplatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console port templates delete params +func (o *DcimConsolePortTemplatesDeleteParams) WithContext(ctx context.Context) *DcimConsolePortTemplatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console port templates delete params +func (o *DcimConsolePortTemplatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console port templates delete params +func (o *DcimConsolePortTemplatesDeleteParams) WithHTTPClient(client *http.Client) *DcimConsolePortTemplatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console port templates delete params +func (o *DcimConsolePortTemplatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console port templates delete params +func (o *DcimConsolePortTemplatesDeleteParams) WithID(id int64) *DcimConsolePortTemplatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console port templates delete params +func (o *DcimConsolePortTemplatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortTemplatesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_delete_responses.go new file mode 100644 index 0000000..60f7f0a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimConsolePortTemplatesDeleteReader is a Reader for the DcimConsolePortTemplatesDelete structure. +type DcimConsolePortTemplatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortTemplatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimConsolePortTemplatesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsolePortTemplatesDeleteNoContent creates a DcimConsolePortTemplatesDeleteNoContent with default headers values +func NewDcimConsolePortTemplatesDeleteNoContent() *DcimConsolePortTemplatesDeleteNoContent { + return &DcimConsolePortTemplatesDeleteNoContent{} +} + +/*DcimConsolePortTemplatesDeleteNoContent handles this case with default header values. + +DcimConsolePortTemplatesDeleteNoContent dcim console port templates delete no content +*/ +type DcimConsolePortTemplatesDeleteNoContent struct { +} + +func (o *DcimConsolePortTemplatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/console-port-templates/{id}/][%d] dcimConsolePortTemplatesDeleteNoContent ", 204) +} + +func (o *DcimConsolePortTemplatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_list_parameters.go new file mode 100644 index 0000000..3ed60c0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_list_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimConsolePortTemplatesListParams creates a new DcimConsolePortTemplatesListParams object +// with the default values initialized. +func NewDcimConsolePortTemplatesListParams() *DcimConsolePortTemplatesListParams { + var () + return &DcimConsolePortTemplatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortTemplatesListParamsWithTimeout creates a new DcimConsolePortTemplatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortTemplatesListParamsWithTimeout(timeout time.Duration) *DcimConsolePortTemplatesListParams { + var () + return &DcimConsolePortTemplatesListParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortTemplatesListParamsWithContext creates a new DcimConsolePortTemplatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortTemplatesListParamsWithContext(ctx context.Context) *DcimConsolePortTemplatesListParams { + var () + return &DcimConsolePortTemplatesListParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortTemplatesListParamsWithHTTPClient creates a new DcimConsolePortTemplatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortTemplatesListParamsWithHTTPClient(client *http.Client) *DcimConsolePortTemplatesListParams { + var () + return &DcimConsolePortTemplatesListParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortTemplatesListParams contains all the parameters to send to the API endpoint +for the dcim console port templates list operation typically these are written to a http.Request +*/ +type DcimConsolePortTemplatesListParams struct { + + /*DevicetypeID*/ + DevicetypeID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) WithTimeout(timeout time.Duration) *DcimConsolePortTemplatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) WithContext(ctx context.Context) *DcimConsolePortTemplatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) WithHTTPClient(client *http.Client) *DcimConsolePortTemplatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevicetypeID adds the devicetypeID to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) WithDevicetypeID(devicetypeID *string) *DcimConsolePortTemplatesListParams { + o.SetDevicetypeID(devicetypeID) + return o +} + +// SetDevicetypeID adds the devicetypeId to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) SetDevicetypeID(devicetypeID *string) { + o.DevicetypeID = devicetypeID +} + +// WithLimit adds the limit to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) WithLimit(limit *int64) *DcimConsolePortTemplatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) WithName(name *string) *DcimConsolePortTemplatesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) WithOffset(offset *int64) *DcimConsolePortTemplatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DevicetypeID != nil { + + // query param devicetype_id + var qrDevicetypeID string + if o.DevicetypeID != nil { + qrDevicetypeID = *o.DevicetypeID + } + qDevicetypeID := qrDevicetypeID + if qDevicetypeID != "" { + if err := r.SetQueryParam("devicetype_id", qDevicetypeID); 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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_list_responses.go new file mode 100644 index 0000000..84e206b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsolePortTemplatesListReader is a Reader for the DcimConsolePortTemplatesList structure. +type DcimConsolePortTemplatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortTemplatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortTemplatesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsolePortTemplatesListOK creates a DcimConsolePortTemplatesListOK with default headers values +func NewDcimConsolePortTemplatesListOK() *DcimConsolePortTemplatesListOK { + return &DcimConsolePortTemplatesListOK{} +} + +/*DcimConsolePortTemplatesListOK handles this case with default header values. + +DcimConsolePortTemplatesListOK dcim console port templates list o k +*/ +type DcimConsolePortTemplatesListOK struct { + Payload *models.DcimConsolePortTemplatesListOKBody +} + +func (o *DcimConsolePortTemplatesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-port-templates/][%d] dcimConsolePortTemplatesListOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimConsolePortTemplatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_partial_update_parameters.go new file mode 100644 index 0000000..652250e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimConsolePortTemplatesPartialUpdateParams creates a new DcimConsolePortTemplatesPartialUpdateParams object +// with the default values initialized. +func NewDcimConsolePortTemplatesPartialUpdateParams() *DcimConsolePortTemplatesPartialUpdateParams { + var () + return &DcimConsolePortTemplatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortTemplatesPartialUpdateParamsWithTimeout creates a new DcimConsolePortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimConsolePortTemplatesPartialUpdateParams { + var () + return &DcimConsolePortTemplatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortTemplatesPartialUpdateParamsWithContext creates a new DcimConsolePortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortTemplatesPartialUpdateParamsWithContext(ctx context.Context) *DcimConsolePortTemplatesPartialUpdateParams { + var () + return &DcimConsolePortTemplatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortTemplatesPartialUpdateParamsWithHTTPClient creates a new DcimConsolePortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimConsolePortTemplatesPartialUpdateParams { + var () + return &DcimConsolePortTemplatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim console port templates partial update operation typically these are written to a http.Request +*/ +type DcimConsolePortTemplatesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableConsolePortTemplate + /*ID + A unique integer value identifying this console port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimConsolePortTemplatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) WithContext(ctx context.Context) *DcimConsolePortTemplatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimConsolePortTemplatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) WithData(data *models.WritableConsolePortTemplate) *DcimConsolePortTemplatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) SetData(data *models.WritableConsolePortTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) WithID(id int64) *DcimConsolePortTemplatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortTemplatesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_partial_update_responses.go new file mode 100644 index 0000000..1f49cc3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsolePortTemplatesPartialUpdateReader is a Reader for the DcimConsolePortTemplatesPartialUpdate structure. +type DcimConsolePortTemplatesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortTemplatesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsolePortTemplatesPartialUpdateOK creates a DcimConsolePortTemplatesPartialUpdateOK with default headers values +func NewDcimConsolePortTemplatesPartialUpdateOK() *DcimConsolePortTemplatesPartialUpdateOK { + return &DcimConsolePortTemplatesPartialUpdateOK{} +} + +/*DcimConsolePortTemplatesPartialUpdateOK handles this case with default header values. + +DcimConsolePortTemplatesPartialUpdateOK dcim console port templates partial update o k +*/ +type DcimConsolePortTemplatesPartialUpdateOK struct { + Payload *models.WritableConsolePortTemplate +} + +func (o *DcimConsolePortTemplatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/console-port-templates/{id}/][%d] dcimConsolePortTemplatesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsolePortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_read_parameters.go new file mode 100644 index 0000000..491c4b3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimConsolePortTemplatesReadParams creates a new DcimConsolePortTemplatesReadParams object +// with the default values initialized. +func NewDcimConsolePortTemplatesReadParams() *DcimConsolePortTemplatesReadParams { + var () + return &DcimConsolePortTemplatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortTemplatesReadParamsWithTimeout creates a new DcimConsolePortTemplatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortTemplatesReadParamsWithTimeout(timeout time.Duration) *DcimConsolePortTemplatesReadParams { + var () + return &DcimConsolePortTemplatesReadParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortTemplatesReadParamsWithContext creates a new DcimConsolePortTemplatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortTemplatesReadParamsWithContext(ctx context.Context) *DcimConsolePortTemplatesReadParams { + var () + return &DcimConsolePortTemplatesReadParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortTemplatesReadParamsWithHTTPClient creates a new DcimConsolePortTemplatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortTemplatesReadParamsWithHTTPClient(client *http.Client) *DcimConsolePortTemplatesReadParams { + var () + return &DcimConsolePortTemplatesReadParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortTemplatesReadParams contains all the parameters to send to the API endpoint +for the dcim console port templates read operation typically these are written to a http.Request +*/ +type DcimConsolePortTemplatesReadParams struct { + + /*ID + A unique integer value identifying this console port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console port templates read params +func (o *DcimConsolePortTemplatesReadParams) WithTimeout(timeout time.Duration) *DcimConsolePortTemplatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console port templates read params +func (o *DcimConsolePortTemplatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console port templates read params +func (o *DcimConsolePortTemplatesReadParams) WithContext(ctx context.Context) *DcimConsolePortTemplatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console port templates read params +func (o *DcimConsolePortTemplatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console port templates read params +func (o *DcimConsolePortTemplatesReadParams) WithHTTPClient(client *http.Client) *DcimConsolePortTemplatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console port templates read params +func (o *DcimConsolePortTemplatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console port templates read params +func (o *DcimConsolePortTemplatesReadParams) WithID(id int64) *DcimConsolePortTemplatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console port templates read params +func (o *DcimConsolePortTemplatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortTemplatesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_read_responses.go new file mode 100644 index 0000000..1ccc3d0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsolePortTemplatesReadReader is a Reader for the DcimConsolePortTemplatesRead structure. +type DcimConsolePortTemplatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortTemplatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortTemplatesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsolePortTemplatesReadOK creates a DcimConsolePortTemplatesReadOK with default headers values +func NewDcimConsolePortTemplatesReadOK() *DcimConsolePortTemplatesReadOK { + return &DcimConsolePortTemplatesReadOK{} +} + +/*DcimConsolePortTemplatesReadOK handles this case with default header values. + +DcimConsolePortTemplatesReadOK dcim console port templates read o k +*/ +type DcimConsolePortTemplatesReadOK struct { + Payload *models.ConsolePortTemplate +} + +func (o *DcimConsolePortTemplatesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-port-templates/{id}/][%d] dcimConsolePortTemplatesReadOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortTemplatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConsolePortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_update_parameters.go new file mode 100644 index 0000000..db9a5bd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimConsolePortTemplatesUpdateParams creates a new DcimConsolePortTemplatesUpdateParams object +// with the default values initialized. +func NewDcimConsolePortTemplatesUpdateParams() *DcimConsolePortTemplatesUpdateParams { + var () + return &DcimConsolePortTemplatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortTemplatesUpdateParamsWithTimeout creates a new DcimConsolePortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortTemplatesUpdateParamsWithTimeout(timeout time.Duration) *DcimConsolePortTemplatesUpdateParams { + var () + return &DcimConsolePortTemplatesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortTemplatesUpdateParamsWithContext creates a new DcimConsolePortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortTemplatesUpdateParamsWithContext(ctx context.Context) *DcimConsolePortTemplatesUpdateParams { + var () + return &DcimConsolePortTemplatesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortTemplatesUpdateParamsWithHTTPClient creates a new DcimConsolePortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortTemplatesUpdateParamsWithHTTPClient(client *http.Client) *DcimConsolePortTemplatesUpdateParams { + var () + return &DcimConsolePortTemplatesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortTemplatesUpdateParams contains all the parameters to send to the API endpoint +for the dcim console port templates update operation typically these are written to a http.Request +*/ +type DcimConsolePortTemplatesUpdateParams struct { + + /*Data*/ + Data *models.WritableConsolePortTemplate + /*ID + A unique integer value identifying this console port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) WithTimeout(timeout time.Duration) *DcimConsolePortTemplatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) WithContext(ctx context.Context) *DcimConsolePortTemplatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) WithHTTPClient(client *http.Client) *DcimConsolePortTemplatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) WithData(data *models.WritableConsolePortTemplate) *DcimConsolePortTemplatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) SetData(data *models.WritableConsolePortTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) WithID(id int64) *DcimConsolePortTemplatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortTemplatesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_update_responses.go new file mode 100644 index 0000000..ffc6eee --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_port_templates_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsolePortTemplatesUpdateReader is a Reader for the DcimConsolePortTemplatesUpdate structure. +type DcimConsolePortTemplatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortTemplatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortTemplatesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsolePortTemplatesUpdateOK creates a DcimConsolePortTemplatesUpdateOK with default headers values +func NewDcimConsolePortTemplatesUpdateOK() *DcimConsolePortTemplatesUpdateOK { + return &DcimConsolePortTemplatesUpdateOK{} +} + +/*DcimConsolePortTemplatesUpdateOK handles this case with default header values. + +DcimConsolePortTemplatesUpdateOK dcim console port templates update o k +*/ +type DcimConsolePortTemplatesUpdateOK struct { + Payload *models.WritableConsolePortTemplate +} + +func (o *DcimConsolePortTemplatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/console-port-templates/{id}/][%d] dcimConsolePortTemplatesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsolePortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_create_parameters.go new file mode 100644 index 0000000..bc29311 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimConsolePortsCreateParams creates a new DcimConsolePortsCreateParams object +// with the default values initialized. +func NewDcimConsolePortsCreateParams() *DcimConsolePortsCreateParams { + var () + return &DcimConsolePortsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortsCreateParamsWithTimeout creates a new DcimConsolePortsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortsCreateParamsWithTimeout(timeout time.Duration) *DcimConsolePortsCreateParams { + var () + return &DcimConsolePortsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortsCreateParamsWithContext creates a new DcimConsolePortsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortsCreateParamsWithContext(ctx context.Context) *DcimConsolePortsCreateParams { + var () + return &DcimConsolePortsCreateParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortsCreateParamsWithHTTPClient creates a new DcimConsolePortsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortsCreateParamsWithHTTPClient(client *http.Client) *DcimConsolePortsCreateParams { + var () + return &DcimConsolePortsCreateParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortsCreateParams contains all the parameters to send to the API endpoint +for the dcim console ports create operation typically these are written to a http.Request +*/ +type DcimConsolePortsCreateParams struct { + + /*Data*/ + Data *models.WritableConsolePort + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console ports create params +func (o *DcimConsolePortsCreateParams) WithTimeout(timeout time.Duration) *DcimConsolePortsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console ports create params +func (o *DcimConsolePortsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console ports create params +func (o *DcimConsolePortsCreateParams) WithContext(ctx context.Context) *DcimConsolePortsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console ports create params +func (o *DcimConsolePortsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console ports create params +func (o *DcimConsolePortsCreateParams) WithHTTPClient(client *http.Client) *DcimConsolePortsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console ports create params +func (o *DcimConsolePortsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console ports create params +func (o *DcimConsolePortsCreateParams) WithData(data *models.WritableConsolePort) *DcimConsolePortsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console ports create params +func (o *DcimConsolePortsCreateParams) SetData(data *models.WritableConsolePort) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_create_responses.go new file mode 100644 index 0000000..f90a275 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsolePortsCreateReader is a Reader for the DcimConsolePortsCreate structure. +type DcimConsolePortsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimConsolePortsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsolePortsCreateCreated creates a DcimConsolePortsCreateCreated with default headers values +func NewDcimConsolePortsCreateCreated() *DcimConsolePortsCreateCreated { + return &DcimConsolePortsCreateCreated{} +} + +/*DcimConsolePortsCreateCreated handles this case with default header values. + +DcimConsolePortsCreateCreated dcim console ports create created +*/ +type DcimConsolePortsCreateCreated struct { + Payload *models.WritableConsolePort +} + +func (o *DcimConsolePortsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/console-ports/][%d] dcimConsolePortsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimConsolePortsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsolePort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_delete_parameters.go new file mode 100644 index 0000000..333fded --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimConsolePortsDeleteParams creates a new DcimConsolePortsDeleteParams object +// with the default values initialized. +func NewDcimConsolePortsDeleteParams() *DcimConsolePortsDeleteParams { + var () + return &DcimConsolePortsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortsDeleteParamsWithTimeout creates a new DcimConsolePortsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortsDeleteParamsWithTimeout(timeout time.Duration) *DcimConsolePortsDeleteParams { + var () + return &DcimConsolePortsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortsDeleteParamsWithContext creates a new DcimConsolePortsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortsDeleteParamsWithContext(ctx context.Context) *DcimConsolePortsDeleteParams { + var () + return &DcimConsolePortsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortsDeleteParamsWithHTTPClient creates a new DcimConsolePortsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortsDeleteParamsWithHTTPClient(client *http.Client) *DcimConsolePortsDeleteParams { + var () + return &DcimConsolePortsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortsDeleteParams contains all the parameters to send to the API endpoint +for the dcim console ports delete operation typically these are written to a http.Request +*/ +type DcimConsolePortsDeleteParams struct { + + /*ID + A unique integer value identifying this console port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console ports delete params +func (o *DcimConsolePortsDeleteParams) WithTimeout(timeout time.Duration) *DcimConsolePortsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console ports delete params +func (o *DcimConsolePortsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console ports delete params +func (o *DcimConsolePortsDeleteParams) WithContext(ctx context.Context) *DcimConsolePortsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console ports delete params +func (o *DcimConsolePortsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console ports delete params +func (o *DcimConsolePortsDeleteParams) WithHTTPClient(client *http.Client) *DcimConsolePortsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console ports delete params +func (o *DcimConsolePortsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console ports delete params +func (o *DcimConsolePortsDeleteParams) WithID(id int64) *DcimConsolePortsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console ports delete params +func (o *DcimConsolePortsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_delete_responses.go new file mode 100644 index 0000000..1d41ab5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimConsolePortsDeleteReader is a Reader for the DcimConsolePortsDelete structure. +type DcimConsolePortsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimConsolePortsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsolePortsDeleteNoContent creates a DcimConsolePortsDeleteNoContent with default headers values +func NewDcimConsolePortsDeleteNoContent() *DcimConsolePortsDeleteNoContent { + return &DcimConsolePortsDeleteNoContent{} +} + +/*DcimConsolePortsDeleteNoContent handles this case with default header values. + +DcimConsolePortsDeleteNoContent dcim console ports delete no content +*/ +type DcimConsolePortsDeleteNoContent struct { +} + +func (o *DcimConsolePortsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/console-ports/{id}/][%d] dcimConsolePortsDeleteNoContent ", 204) +} + +func (o *DcimConsolePortsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_list_parameters.go new file mode 100644 index 0000000..cfe1841 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_list_parameters.go @@ -0,0 +1,282 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimConsolePortsListParams creates a new DcimConsolePortsListParams object +// with the default values initialized. +func NewDcimConsolePortsListParams() *DcimConsolePortsListParams { + var () + return &DcimConsolePortsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortsListParamsWithTimeout creates a new DcimConsolePortsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortsListParamsWithTimeout(timeout time.Duration) *DcimConsolePortsListParams { + var () + return &DcimConsolePortsListParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortsListParamsWithContext creates a new DcimConsolePortsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortsListParamsWithContext(ctx context.Context) *DcimConsolePortsListParams { + var () + return &DcimConsolePortsListParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortsListParamsWithHTTPClient creates a new DcimConsolePortsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortsListParamsWithHTTPClient(client *http.Client) *DcimConsolePortsListParams { + var () + return &DcimConsolePortsListParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortsListParams contains all the parameters to send to the API endpoint +for the dcim console ports list operation typically these are written to a http.Request +*/ +type DcimConsolePortsListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithTimeout(timeout time.Duration) *DcimConsolePortsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithContext(ctx context.Context) *DcimConsolePortsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithHTTPClient(client *http.Client) *DcimConsolePortsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithDevice(device *string) *DcimConsolePortsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithDeviceID(deviceID *string) *DcimConsolePortsListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithLimit adds the limit to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithLimit(limit *int64) *DcimConsolePortsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithName(name *string) *DcimConsolePortsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithOffset(offset *int64) *DcimConsolePortsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); 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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_list_responses.go new file mode 100644 index 0000000..0143560 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsolePortsListReader is a Reader for the DcimConsolePortsList structure. +type DcimConsolePortsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsolePortsListOK creates a DcimConsolePortsListOK with default headers values +func NewDcimConsolePortsListOK() *DcimConsolePortsListOK { + return &DcimConsolePortsListOK{} +} + +/*DcimConsolePortsListOK handles this case with default header values. + +DcimConsolePortsListOK dcim console ports list o k +*/ +type DcimConsolePortsListOK struct { + Payload *models.DcimConsolePortsListOKBody +} + +func (o *DcimConsolePortsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-ports/][%d] dcimConsolePortsListOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimConsolePortsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_partial_update_parameters.go new file mode 100644 index 0000000..87084f6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimConsolePortsPartialUpdateParams creates a new DcimConsolePortsPartialUpdateParams object +// with the default values initialized. +func NewDcimConsolePortsPartialUpdateParams() *DcimConsolePortsPartialUpdateParams { + var () + return &DcimConsolePortsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortsPartialUpdateParamsWithTimeout creates a new DcimConsolePortsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimConsolePortsPartialUpdateParams { + var () + return &DcimConsolePortsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortsPartialUpdateParamsWithContext creates a new DcimConsolePortsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortsPartialUpdateParamsWithContext(ctx context.Context) *DcimConsolePortsPartialUpdateParams { + var () + return &DcimConsolePortsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortsPartialUpdateParamsWithHTTPClient creates a new DcimConsolePortsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimConsolePortsPartialUpdateParams { + var () + return &DcimConsolePortsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim console ports partial update operation typically these are written to a http.Request +*/ +type DcimConsolePortsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableConsolePort + /*ID + A unique integer value identifying this console port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimConsolePortsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) WithContext(ctx context.Context) *DcimConsolePortsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimConsolePortsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) WithData(data *models.WritableConsolePort) *DcimConsolePortsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) SetData(data *models.WritableConsolePort) { + o.Data = data +} + +// WithID adds the id to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) WithID(id int64) *DcimConsolePortsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_partial_update_responses.go new file mode 100644 index 0000000..9fb4bfc --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsolePortsPartialUpdateReader is a Reader for the DcimConsolePortsPartialUpdate structure. +type DcimConsolePortsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsolePortsPartialUpdateOK creates a DcimConsolePortsPartialUpdateOK with default headers values +func NewDcimConsolePortsPartialUpdateOK() *DcimConsolePortsPartialUpdateOK { + return &DcimConsolePortsPartialUpdateOK{} +} + +/*DcimConsolePortsPartialUpdateOK handles this case with default header values. + +DcimConsolePortsPartialUpdateOK dcim console ports partial update o k +*/ +type DcimConsolePortsPartialUpdateOK struct { + Payload *models.WritableConsolePort +} + +func (o *DcimConsolePortsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/console-ports/{id}/][%d] dcimConsolePortsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsolePort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_read_parameters.go new file mode 100644 index 0000000..0687617 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimConsolePortsReadParams creates a new DcimConsolePortsReadParams object +// with the default values initialized. +func NewDcimConsolePortsReadParams() *DcimConsolePortsReadParams { + var () + return &DcimConsolePortsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortsReadParamsWithTimeout creates a new DcimConsolePortsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortsReadParamsWithTimeout(timeout time.Duration) *DcimConsolePortsReadParams { + var () + return &DcimConsolePortsReadParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortsReadParamsWithContext creates a new DcimConsolePortsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortsReadParamsWithContext(ctx context.Context) *DcimConsolePortsReadParams { + var () + return &DcimConsolePortsReadParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortsReadParamsWithHTTPClient creates a new DcimConsolePortsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortsReadParamsWithHTTPClient(client *http.Client) *DcimConsolePortsReadParams { + var () + return &DcimConsolePortsReadParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortsReadParams contains all the parameters to send to the API endpoint +for the dcim console ports read operation typically these are written to a http.Request +*/ +type DcimConsolePortsReadParams struct { + + /*ID + A unique integer value identifying this console port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console ports read params +func (o *DcimConsolePortsReadParams) WithTimeout(timeout time.Duration) *DcimConsolePortsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console ports read params +func (o *DcimConsolePortsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console ports read params +func (o *DcimConsolePortsReadParams) WithContext(ctx context.Context) *DcimConsolePortsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console ports read params +func (o *DcimConsolePortsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console ports read params +func (o *DcimConsolePortsReadParams) WithHTTPClient(client *http.Client) *DcimConsolePortsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console ports read params +func (o *DcimConsolePortsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console ports read params +func (o *DcimConsolePortsReadParams) WithID(id int64) *DcimConsolePortsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console ports read params +func (o *DcimConsolePortsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_read_responses.go new file mode 100644 index 0000000..e25a09f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsolePortsReadReader is a Reader for the DcimConsolePortsRead structure. +type DcimConsolePortsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsolePortsReadOK creates a DcimConsolePortsReadOK with default headers values +func NewDcimConsolePortsReadOK() *DcimConsolePortsReadOK { + return &DcimConsolePortsReadOK{} +} + +/*DcimConsolePortsReadOK handles this case with default header values. + +DcimConsolePortsReadOK dcim console ports read o k +*/ +type DcimConsolePortsReadOK struct { + Payload *models.ConsolePort +} + +func (o *DcimConsolePortsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-ports/{id}/][%d] dcimConsolePortsReadOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConsolePort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_update_parameters.go new file mode 100644 index 0000000..fd01fdd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimConsolePortsUpdateParams creates a new DcimConsolePortsUpdateParams object +// with the default values initialized. +func NewDcimConsolePortsUpdateParams() *DcimConsolePortsUpdateParams { + var () + return &DcimConsolePortsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortsUpdateParamsWithTimeout creates a new DcimConsolePortsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortsUpdateParamsWithTimeout(timeout time.Duration) *DcimConsolePortsUpdateParams { + var () + return &DcimConsolePortsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortsUpdateParamsWithContext creates a new DcimConsolePortsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortsUpdateParamsWithContext(ctx context.Context) *DcimConsolePortsUpdateParams { + var () + return &DcimConsolePortsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortsUpdateParamsWithHTTPClient creates a new DcimConsolePortsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortsUpdateParamsWithHTTPClient(client *http.Client) *DcimConsolePortsUpdateParams { + var () + return &DcimConsolePortsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortsUpdateParams contains all the parameters to send to the API endpoint +for the dcim console ports update operation typically these are written to a http.Request +*/ +type DcimConsolePortsUpdateParams struct { + + /*Data*/ + Data *models.WritableConsolePort + /*ID + A unique integer value identifying this console port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) WithTimeout(timeout time.Duration) *DcimConsolePortsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) WithContext(ctx context.Context) *DcimConsolePortsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) WithHTTPClient(client *http.Client) *DcimConsolePortsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) WithData(data *models.WritableConsolePort) *DcimConsolePortsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) SetData(data *models.WritableConsolePort) { + o.Data = data +} + +// WithID adds the id to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) WithID(id int64) *DcimConsolePortsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_update_responses.go new file mode 100644 index 0000000..4c6332b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_ports_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsolePortsUpdateReader is a Reader for the DcimConsolePortsUpdate structure. +type DcimConsolePortsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsolePortsUpdateOK creates a DcimConsolePortsUpdateOK with default headers values +func NewDcimConsolePortsUpdateOK() *DcimConsolePortsUpdateOK { + return &DcimConsolePortsUpdateOK{} +} + +/*DcimConsolePortsUpdateOK handles this case with default header values. + +DcimConsolePortsUpdateOK dcim console ports update o k +*/ +type DcimConsolePortsUpdateOK struct { + Payload *models.WritableConsolePort +} + +func (o *DcimConsolePortsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/console-ports/{id}/][%d] dcimConsolePortsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsolePort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_create_parameters.go new file mode 100644 index 0000000..9547dd3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimConsoleServerPortTemplatesCreateParams creates a new DcimConsoleServerPortTemplatesCreateParams object +// with the default values initialized. +func NewDcimConsoleServerPortTemplatesCreateParams() *DcimConsoleServerPortTemplatesCreateParams { + var () + return &DcimConsoleServerPortTemplatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortTemplatesCreateParamsWithTimeout creates a new DcimConsoleServerPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortTemplatesCreateParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesCreateParams { + var () + return &DcimConsoleServerPortTemplatesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortTemplatesCreateParamsWithContext creates a new DcimConsoleServerPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortTemplatesCreateParamsWithContext(ctx context.Context) *DcimConsoleServerPortTemplatesCreateParams { + var () + return &DcimConsoleServerPortTemplatesCreateParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortTemplatesCreateParamsWithHTTPClient creates a new DcimConsoleServerPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortTemplatesCreateParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesCreateParams { + var () + return &DcimConsoleServerPortTemplatesCreateParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortTemplatesCreateParams contains all the parameters to send to the API endpoint +for the dcim console server port templates create operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortTemplatesCreateParams struct { + + /*Data*/ + Data *models.WritableConsoleServerPortTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server port templates create params +func (o *DcimConsoleServerPortTemplatesCreateParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server port templates create params +func (o *DcimConsoleServerPortTemplatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server port templates create params +func (o *DcimConsoleServerPortTemplatesCreateParams) WithContext(ctx context.Context) *DcimConsoleServerPortTemplatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server port templates create params +func (o *DcimConsoleServerPortTemplatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server port templates create params +func (o *DcimConsoleServerPortTemplatesCreateParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server port templates create params +func (o *DcimConsoleServerPortTemplatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console server port templates create params +func (o *DcimConsoleServerPortTemplatesCreateParams) WithData(data *models.WritableConsoleServerPortTemplate) *DcimConsoleServerPortTemplatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console server port templates create params +func (o *DcimConsoleServerPortTemplatesCreateParams) SetData(data *models.WritableConsoleServerPortTemplate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortTemplatesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_create_responses.go new file mode 100644 index 0000000..55bb25d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsoleServerPortTemplatesCreateReader is a Reader for the DcimConsoleServerPortTemplatesCreate structure. +type DcimConsoleServerPortTemplatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortTemplatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimConsoleServerPortTemplatesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsoleServerPortTemplatesCreateCreated creates a DcimConsoleServerPortTemplatesCreateCreated with default headers values +func NewDcimConsoleServerPortTemplatesCreateCreated() *DcimConsoleServerPortTemplatesCreateCreated { + return &DcimConsoleServerPortTemplatesCreateCreated{} +} + +/*DcimConsoleServerPortTemplatesCreateCreated handles this case with default header values. + +DcimConsoleServerPortTemplatesCreateCreated dcim console server port templates create created +*/ +type DcimConsoleServerPortTemplatesCreateCreated struct { + Payload *models.WritableConsoleServerPortTemplate +} + +func (o *DcimConsoleServerPortTemplatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/console-server-port-templates/][%d] dcimConsoleServerPortTemplatesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimConsoleServerPortTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsoleServerPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_delete_parameters.go new file mode 100644 index 0000000..2d7623c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimConsoleServerPortTemplatesDeleteParams creates a new DcimConsoleServerPortTemplatesDeleteParams object +// with the default values initialized. +func NewDcimConsoleServerPortTemplatesDeleteParams() *DcimConsoleServerPortTemplatesDeleteParams { + var () + return &DcimConsoleServerPortTemplatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortTemplatesDeleteParamsWithTimeout creates a new DcimConsoleServerPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortTemplatesDeleteParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesDeleteParams { + var () + return &DcimConsoleServerPortTemplatesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortTemplatesDeleteParamsWithContext creates a new DcimConsoleServerPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortTemplatesDeleteParamsWithContext(ctx context.Context) *DcimConsoleServerPortTemplatesDeleteParams { + var () + return &DcimConsoleServerPortTemplatesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortTemplatesDeleteParamsWithHTTPClient creates a new DcimConsoleServerPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortTemplatesDeleteParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesDeleteParams { + var () + return &DcimConsoleServerPortTemplatesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortTemplatesDeleteParams contains all the parameters to send to the API endpoint +for the dcim console server port templates delete operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortTemplatesDeleteParams struct { + + /*ID + A unique integer value identifying this console server port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server port templates delete params +func (o *DcimConsoleServerPortTemplatesDeleteParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server port templates delete params +func (o *DcimConsoleServerPortTemplatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server port templates delete params +func (o *DcimConsoleServerPortTemplatesDeleteParams) WithContext(ctx context.Context) *DcimConsoleServerPortTemplatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server port templates delete params +func (o *DcimConsoleServerPortTemplatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server port templates delete params +func (o *DcimConsoleServerPortTemplatesDeleteParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server port templates delete params +func (o *DcimConsoleServerPortTemplatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console server port templates delete params +func (o *DcimConsoleServerPortTemplatesDeleteParams) WithID(id int64) *DcimConsoleServerPortTemplatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server port templates delete params +func (o *DcimConsoleServerPortTemplatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortTemplatesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_delete_responses.go new file mode 100644 index 0000000..42c7d41 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimConsoleServerPortTemplatesDeleteReader is a Reader for the DcimConsoleServerPortTemplatesDelete structure. +type DcimConsoleServerPortTemplatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortTemplatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimConsoleServerPortTemplatesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsoleServerPortTemplatesDeleteNoContent creates a DcimConsoleServerPortTemplatesDeleteNoContent with default headers values +func NewDcimConsoleServerPortTemplatesDeleteNoContent() *DcimConsoleServerPortTemplatesDeleteNoContent { + return &DcimConsoleServerPortTemplatesDeleteNoContent{} +} + +/*DcimConsoleServerPortTemplatesDeleteNoContent handles this case with default header values. + +DcimConsoleServerPortTemplatesDeleteNoContent dcim console server port templates delete no content +*/ +type DcimConsoleServerPortTemplatesDeleteNoContent struct { +} + +func (o *DcimConsoleServerPortTemplatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/console-server-port-templates/{id}/][%d] dcimConsoleServerPortTemplatesDeleteNoContent ", 204) +} + +func (o *DcimConsoleServerPortTemplatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_list_parameters.go new file mode 100644 index 0000000..90779d9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_list_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimConsoleServerPortTemplatesListParams creates a new DcimConsoleServerPortTemplatesListParams object +// with the default values initialized. +func NewDcimConsoleServerPortTemplatesListParams() *DcimConsoleServerPortTemplatesListParams { + var () + return &DcimConsoleServerPortTemplatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortTemplatesListParamsWithTimeout creates a new DcimConsoleServerPortTemplatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortTemplatesListParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesListParams { + var () + return &DcimConsoleServerPortTemplatesListParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortTemplatesListParamsWithContext creates a new DcimConsoleServerPortTemplatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortTemplatesListParamsWithContext(ctx context.Context) *DcimConsoleServerPortTemplatesListParams { + var () + return &DcimConsoleServerPortTemplatesListParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortTemplatesListParamsWithHTTPClient creates a new DcimConsoleServerPortTemplatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortTemplatesListParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesListParams { + var () + return &DcimConsoleServerPortTemplatesListParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortTemplatesListParams contains all the parameters to send to the API endpoint +for the dcim console server port templates list operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortTemplatesListParams struct { + + /*DevicetypeID*/ + DevicetypeID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) WithContext(ctx context.Context) *DcimConsoleServerPortTemplatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevicetypeID adds the devicetypeID to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) WithDevicetypeID(devicetypeID *string) *DcimConsoleServerPortTemplatesListParams { + o.SetDevicetypeID(devicetypeID) + return o +} + +// SetDevicetypeID adds the devicetypeId to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) SetDevicetypeID(devicetypeID *string) { + o.DevicetypeID = devicetypeID +} + +// WithLimit adds the limit to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) WithLimit(limit *int64) *DcimConsoleServerPortTemplatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) WithName(name *string) *DcimConsoleServerPortTemplatesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) WithOffset(offset *int64) *DcimConsoleServerPortTemplatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DevicetypeID != nil { + + // query param devicetype_id + var qrDevicetypeID string + if o.DevicetypeID != nil { + qrDevicetypeID = *o.DevicetypeID + } + qDevicetypeID := qrDevicetypeID + if qDevicetypeID != "" { + if err := r.SetQueryParam("devicetype_id", qDevicetypeID); 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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_list_responses.go new file mode 100644 index 0000000..a0e1a97 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsoleServerPortTemplatesListReader is a Reader for the DcimConsoleServerPortTemplatesList structure. +type DcimConsoleServerPortTemplatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortTemplatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortTemplatesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsoleServerPortTemplatesListOK creates a DcimConsoleServerPortTemplatesListOK with default headers values +func NewDcimConsoleServerPortTemplatesListOK() *DcimConsoleServerPortTemplatesListOK { + return &DcimConsoleServerPortTemplatesListOK{} +} + +/*DcimConsoleServerPortTemplatesListOK handles this case with default header values. + +DcimConsoleServerPortTemplatesListOK dcim console server port templates list o k +*/ +type DcimConsoleServerPortTemplatesListOK struct { + Payload *models.DcimConsoleServerPortTemplatesListOKBody +} + +func (o *DcimConsoleServerPortTemplatesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-server-port-templates/][%d] dcimConsoleServerPortTemplatesListOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimConsoleServerPortTemplatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_partial_update_parameters.go new file mode 100644 index 0000000..5a6f3e0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimConsoleServerPortTemplatesPartialUpdateParams creates a new DcimConsoleServerPortTemplatesPartialUpdateParams object +// with the default values initialized. +func NewDcimConsoleServerPortTemplatesPartialUpdateParams() *DcimConsoleServerPortTemplatesPartialUpdateParams { + var () + return &DcimConsoleServerPortTemplatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortTemplatesPartialUpdateParamsWithTimeout creates a new DcimConsoleServerPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesPartialUpdateParams { + var () + return &DcimConsoleServerPortTemplatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortTemplatesPartialUpdateParamsWithContext creates a new DcimConsoleServerPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortTemplatesPartialUpdateParamsWithContext(ctx context.Context) *DcimConsoleServerPortTemplatesPartialUpdateParams { + var () + return &DcimConsoleServerPortTemplatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortTemplatesPartialUpdateParamsWithHTTPClient creates a new DcimConsoleServerPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesPartialUpdateParams { + var () + return &DcimConsoleServerPortTemplatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim console server port templates partial update operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortTemplatesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableConsoleServerPortTemplate + /*ID + A unique integer value identifying this console server port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) WithContext(ctx context.Context) *DcimConsoleServerPortTemplatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) WithData(data *models.WritableConsoleServerPortTemplate) *DcimConsoleServerPortTemplatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) SetData(data *models.WritableConsoleServerPortTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) WithID(id int64) *DcimConsoleServerPortTemplatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_partial_update_responses.go new file mode 100644 index 0000000..48d940d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsoleServerPortTemplatesPartialUpdateReader is a Reader for the DcimConsoleServerPortTemplatesPartialUpdate structure. +type DcimConsoleServerPortTemplatesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortTemplatesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsoleServerPortTemplatesPartialUpdateOK creates a DcimConsoleServerPortTemplatesPartialUpdateOK with default headers values +func NewDcimConsoleServerPortTemplatesPartialUpdateOK() *DcimConsoleServerPortTemplatesPartialUpdateOK { + return &DcimConsoleServerPortTemplatesPartialUpdateOK{} +} + +/*DcimConsoleServerPortTemplatesPartialUpdateOK handles this case with default header values. + +DcimConsoleServerPortTemplatesPartialUpdateOK dcim console server port templates partial update o k +*/ +type DcimConsoleServerPortTemplatesPartialUpdateOK struct { + Payload *models.WritableConsoleServerPortTemplate +} + +func (o *DcimConsoleServerPortTemplatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/console-server-port-templates/{id}/][%d] dcimConsoleServerPortTemplatesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsoleServerPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_read_parameters.go new file mode 100644 index 0000000..498d73c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimConsoleServerPortTemplatesReadParams creates a new DcimConsoleServerPortTemplatesReadParams object +// with the default values initialized. +func NewDcimConsoleServerPortTemplatesReadParams() *DcimConsoleServerPortTemplatesReadParams { + var () + return &DcimConsoleServerPortTemplatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortTemplatesReadParamsWithTimeout creates a new DcimConsoleServerPortTemplatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortTemplatesReadParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesReadParams { + var () + return &DcimConsoleServerPortTemplatesReadParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortTemplatesReadParamsWithContext creates a new DcimConsoleServerPortTemplatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortTemplatesReadParamsWithContext(ctx context.Context) *DcimConsoleServerPortTemplatesReadParams { + var () + return &DcimConsoleServerPortTemplatesReadParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortTemplatesReadParamsWithHTTPClient creates a new DcimConsoleServerPortTemplatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortTemplatesReadParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesReadParams { + var () + return &DcimConsoleServerPortTemplatesReadParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortTemplatesReadParams contains all the parameters to send to the API endpoint +for the dcim console server port templates read operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortTemplatesReadParams struct { + + /*ID + A unique integer value identifying this console server port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server port templates read params +func (o *DcimConsoleServerPortTemplatesReadParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server port templates read params +func (o *DcimConsoleServerPortTemplatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server port templates read params +func (o *DcimConsoleServerPortTemplatesReadParams) WithContext(ctx context.Context) *DcimConsoleServerPortTemplatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server port templates read params +func (o *DcimConsoleServerPortTemplatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server port templates read params +func (o *DcimConsoleServerPortTemplatesReadParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server port templates read params +func (o *DcimConsoleServerPortTemplatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console server port templates read params +func (o *DcimConsoleServerPortTemplatesReadParams) WithID(id int64) *DcimConsoleServerPortTemplatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server port templates read params +func (o *DcimConsoleServerPortTemplatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortTemplatesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_read_responses.go new file mode 100644 index 0000000..9d2b9f6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsoleServerPortTemplatesReadReader is a Reader for the DcimConsoleServerPortTemplatesRead structure. +type DcimConsoleServerPortTemplatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortTemplatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortTemplatesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsoleServerPortTemplatesReadOK creates a DcimConsoleServerPortTemplatesReadOK with default headers values +func NewDcimConsoleServerPortTemplatesReadOK() *DcimConsoleServerPortTemplatesReadOK { + return &DcimConsoleServerPortTemplatesReadOK{} +} + +/*DcimConsoleServerPortTemplatesReadOK handles this case with default header values. + +DcimConsoleServerPortTemplatesReadOK dcim console server port templates read o k +*/ +type DcimConsoleServerPortTemplatesReadOK struct { + Payload *models.ConsoleServerPortTemplate +} + +func (o *DcimConsoleServerPortTemplatesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-server-port-templates/{id}/][%d] dcimConsoleServerPortTemplatesReadOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortTemplatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConsoleServerPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_update_parameters.go new file mode 100644 index 0000000..26bfe38 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimConsoleServerPortTemplatesUpdateParams creates a new DcimConsoleServerPortTemplatesUpdateParams object +// with the default values initialized. +func NewDcimConsoleServerPortTemplatesUpdateParams() *DcimConsoleServerPortTemplatesUpdateParams { + var () + return &DcimConsoleServerPortTemplatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortTemplatesUpdateParamsWithTimeout creates a new DcimConsoleServerPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortTemplatesUpdateParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesUpdateParams { + var () + return &DcimConsoleServerPortTemplatesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortTemplatesUpdateParamsWithContext creates a new DcimConsoleServerPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortTemplatesUpdateParamsWithContext(ctx context.Context) *DcimConsoleServerPortTemplatesUpdateParams { + var () + return &DcimConsoleServerPortTemplatesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortTemplatesUpdateParamsWithHTTPClient creates a new DcimConsoleServerPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortTemplatesUpdateParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesUpdateParams { + var () + return &DcimConsoleServerPortTemplatesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortTemplatesUpdateParams contains all the parameters to send to the API endpoint +for the dcim console server port templates update operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortTemplatesUpdateParams struct { + + /*Data*/ + Data *models.WritableConsoleServerPortTemplate + /*ID + A unique integer value identifying this console server port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) WithContext(ctx context.Context) *DcimConsoleServerPortTemplatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) WithData(data *models.WritableConsoleServerPortTemplate) *DcimConsoleServerPortTemplatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) SetData(data *models.WritableConsoleServerPortTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) WithID(id int64) *DcimConsoleServerPortTemplatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortTemplatesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_update_responses.go new file mode 100644 index 0000000..633057d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_port_templates_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsoleServerPortTemplatesUpdateReader is a Reader for the DcimConsoleServerPortTemplatesUpdate structure. +type DcimConsoleServerPortTemplatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortTemplatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortTemplatesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsoleServerPortTemplatesUpdateOK creates a DcimConsoleServerPortTemplatesUpdateOK with default headers values +func NewDcimConsoleServerPortTemplatesUpdateOK() *DcimConsoleServerPortTemplatesUpdateOK { + return &DcimConsoleServerPortTemplatesUpdateOK{} +} + +/*DcimConsoleServerPortTemplatesUpdateOK handles this case with default header values. + +DcimConsoleServerPortTemplatesUpdateOK dcim console server port templates update o k +*/ +type DcimConsoleServerPortTemplatesUpdateOK struct { + Payload *models.WritableConsoleServerPortTemplate +} + +func (o *DcimConsoleServerPortTemplatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/console-server-port-templates/{id}/][%d] dcimConsoleServerPortTemplatesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsoleServerPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_create_parameters.go new file mode 100644 index 0000000..7b6cbba --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimConsoleServerPortsCreateParams creates a new DcimConsoleServerPortsCreateParams object +// with the default values initialized. +func NewDcimConsoleServerPortsCreateParams() *DcimConsoleServerPortsCreateParams { + var () + return &DcimConsoleServerPortsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortsCreateParamsWithTimeout creates a new DcimConsoleServerPortsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortsCreateParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortsCreateParams { + var () + return &DcimConsoleServerPortsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortsCreateParamsWithContext creates a new DcimConsoleServerPortsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortsCreateParamsWithContext(ctx context.Context) *DcimConsoleServerPortsCreateParams { + var () + return &DcimConsoleServerPortsCreateParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortsCreateParamsWithHTTPClient creates a new DcimConsoleServerPortsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortsCreateParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortsCreateParams { + var () + return &DcimConsoleServerPortsCreateParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortsCreateParams contains all the parameters to send to the API endpoint +for the dcim console server ports create operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortsCreateParams struct { + + /*Data*/ + Data *models.WritableConsoleServerPort + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server ports create params +func (o *DcimConsoleServerPortsCreateParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server ports create params +func (o *DcimConsoleServerPortsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server ports create params +func (o *DcimConsoleServerPortsCreateParams) WithContext(ctx context.Context) *DcimConsoleServerPortsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server ports create params +func (o *DcimConsoleServerPortsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server ports create params +func (o *DcimConsoleServerPortsCreateParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server ports create params +func (o *DcimConsoleServerPortsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console server ports create params +func (o *DcimConsoleServerPortsCreateParams) WithData(data *models.WritableConsoleServerPort) *DcimConsoleServerPortsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console server ports create params +func (o *DcimConsoleServerPortsCreateParams) SetData(data *models.WritableConsoleServerPort) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_create_responses.go new file mode 100644 index 0000000..ea311ac --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsoleServerPortsCreateReader is a Reader for the DcimConsoleServerPortsCreate structure. +type DcimConsoleServerPortsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimConsoleServerPortsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsoleServerPortsCreateCreated creates a DcimConsoleServerPortsCreateCreated with default headers values +func NewDcimConsoleServerPortsCreateCreated() *DcimConsoleServerPortsCreateCreated { + return &DcimConsoleServerPortsCreateCreated{} +} + +/*DcimConsoleServerPortsCreateCreated handles this case with default header values. + +DcimConsoleServerPortsCreateCreated dcim console server ports create created +*/ +type DcimConsoleServerPortsCreateCreated struct { + Payload *models.WritableConsoleServerPort +} + +func (o *DcimConsoleServerPortsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/console-server-ports/][%d] dcimConsoleServerPortsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimConsoleServerPortsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsoleServerPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_delete_parameters.go new file mode 100644 index 0000000..78592be --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimConsoleServerPortsDeleteParams creates a new DcimConsoleServerPortsDeleteParams object +// with the default values initialized. +func NewDcimConsoleServerPortsDeleteParams() *DcimConsoleServerPortsDeleteParams { + var () + return &DcimConsoleServerPortsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortsDeleteParamsWithTimeout creates a new DcimConsoleServerPortsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortsDeleteParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortsDeleteParams { + var () + return &DcimConsoleServerPortsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortsDeleteParamsWithContext creates a new DcimConsoleServerPortsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortsDeleteParamsWithContext(ctx context.Context) *DcimConsoleServerPortsDeleteParams { + var () + return &DcimConsoleServerPortsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortsDeleteParamsWithHTTPClient creates a new DcimConsoleServerPortsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortsDeleteParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortsDeleteParams { + var () + return &DcimConsoleServerPortsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortsDeleteParams contains all the parameters to send to the API endpoint +for the dcim console server ports delete operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortsDeleteParams struct { + + /*ID + A unique integer value identifying this console server port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server ports delete params +func (o *DcimConsoleServerPortsDeleteParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server ports delete params +func (o *DcimConsoleServerPortsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server ports delete params +func (o *DcimConsoleServerPortsDeleteParams) WithContext(ctx context.Context) *DcimConsoleServerPortsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server ports delete params +func (o *DcimConsoleServerPortsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server ports delete params +func (o *DcimConsoleServerPortsDeleteParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server ports delete params +func (o *DcimConsoleServerPortsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console server ports delete params +func (o *DcimConsoleServerPortsDeleteParams) WithID(id int64) *DcimConsoleServerPortsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server ports delete params +func (o *DcimConsoleServerPortsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_delete_responses.go new file mode 100644 index 0000000..6332fe0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimConsoleServerPortsDeleteReader is a Reader for the DcimConsoleServerPortsDelete structure. +type DcimConsoleServerPortsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimConsoleServerPortsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsoleServerPortsDeleteNoContent creates a DcimConsoleServerPortsDeleteNoContent with default headers values +func NewDcimConsoleServerPortsDeleteNoContent() *DcimConsoleServerPortsDeleteNoContent { + return &DcimConsoleServerPortsDeleteNoContent{} +} + +/*DcimConsoleServerPortsDeleteNoContent handles this case with default header values. + +DcimConsoleServerPortsDeleteNoContent dcim console server ports delete no content +*/ +type DcimConsoleServerPortsDeleteNoContent struct { +} + +func (o *DcimConsoleServerPortsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/console-server-ports/{id}/][%d] dcimConsoleServerPortsDeleteNoContent ", 204) +} + +func (o *DcimConsoleServerPortsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_list_parameters.go new file mode 100644 index 0000000..df14161 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_list_parameters.go @@ -0,0 +1,282 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimConsoleServerPortsListParams creates a new DcimConsoleServerPortsListParams object +// with the default values initialized. +func NewDcimConsoleServerPortsListParams() *DcimConsoleServerPortsListParams { + var () + return &DcimConsoleServerPortsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortsListParamsWithTimeout creates a new DcimConsoleServerPortsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortsListParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortsListParams { + var () + return &DcimConsoleServerPortsListParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortsListParamsWithContext creates a new DcimConsoleServerPortsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortsListParamsWithContext(ctx context.Context) *DcimConsoleServerPortsListParams { + var () + return &DcimConsoleServerPortsListParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortsListParamsWithHTTPClient creates a new DcimConsoleServerPortsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortsListParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortsListParams { + var () + return &DcimConsoleServerPortsListParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortsListParams contains all the parameters to send to the API endpoint +for the dcim console server ports list operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortsListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithContext(ctx context.Context) *DcimConsoleServerPortsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithDevice(device *string) *DcimConsoleServerPortsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithDeviceID(deviceID *string) *DcimConsoleServerPortsListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithLimit adds the limit to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithLimit(limit *int64) *DcimConsoleServerPortsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithName(name *string) *DcimConsoleServerPortsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithOffset(offset *int64) *DcimConsoleServerPortsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); 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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_list_responses.go new file mode 100644 index 0000000..fd9ac09 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsoleServerPortsListReader is a Reader for the DcimConsoleServerPortsList structure. +type DcimConsoleServerPortsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsoleServerPortsListOK creates a DcimConsoleServerPortsListOK with default headers values +func NewDcimConsoleServerPortsListOK() *DcimConsoleServerPortsListOK { + return &DcimConsoleServerPortsListOK{} +} + +/*DcimConsoleServerPortsListOK handles this case with default header values. + +DcimConsoleServerPortsListOK dcim console server ports list o k +*/ +type DcimConsoleServerPortsListOK struct { + Payload *models.DcimConsoleServerPortsListOKBody +} + +func (o *DcimConsoleServerPortsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-server-ports/][%d] dcimConsoleServerPortsListOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimConsoleServerPortsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_partial_update_parameters.go new file mode 100644 index 0000000..90d0dea --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimConsoleServerPortsPartialUpdateParams creates a new DcimConsoleServerPortsPartialUpdateParams object +// with the default values initialized. +func NewDcimConsoleServerPortsPartialUpdateParams() *DcimConsoleServerPortsPartialUpdateParams { + var () + return &DcimConsoleServerPortsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortsPartialUpdateParamsWithTimeout creates a new DcimConsoleServerPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortsPartialUpdateParams { + var () + return &DcimConsoleServerPortsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortsPartialUpdateParamsWithContext creates a new DcimConsoleServerPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortsPartialUpdateParamsWithContext(ctx context.Context) *DcimConsoleServerPortsPartialUpdateParams { + var () + return &DcimConsoleServerPortsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortsPartialUpdateParamsWithHTTPClient creates a new DcimConsoleServerPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortsPartialUpdateParams { + var () + return &DcimConsoleServerPortsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim console server ports partial update operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableConsoleServerPort + /*ID + A unique integer value identifying this console server port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) WithContext(ctx context.Context) *DcimConsoleServerPortsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) WithData(data *models.WritableConsoleServerPort) *DcimConsoleServerPortsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) SetData(data *models.WritableConsoleServerPort) { + o.Data = data +} + +// WithID adds the id to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) WithID(id int64) *DcimConsoleServerPortsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_partial_update_responses.go new file mode 100644 index 0000000..bcbac0a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsoleServerPortsPartialUpdateReader is a Reader for the DcimConsoleServerPortsPartialUpdate structure. +type DcimConsoleServerPortsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsoleServerPortsPartialUpdateOK creates a DcimConsoleServerPortsPartialUpdateOK with default headers values +func NewDcimConsoleServerPortsPartialUpdateOK() *DcimConsoleServerPortsPartialUpdateOK { + return &DcimConsoleServerPortsPartialUpdateOK{} +} + +/*DcimConsoleServerPortsPartialUpdateOK handles this case with default header values. + +DcimConsoleServerPortsPartialUpdateOK dcim console server ports partial update o k +*/ +type DcimConsoleServerPortsPartialUpdateOK struct { + Payload *models.WritableConsoleServerPort +} + +func (o *DcimConsoleServerPortsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/console-server-ports/{id}/][%d] dcimConsoleServerPortsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsoleServerPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_read_parameters.go new file mode 100644 index 0000000..5dd2d73 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimConsoleServerPortsReadParams creates a new DcimConsoleServerPortsReadParams object +// with the default values initialized. +func NewDcimConsoleServerPortsReadParams() *DcimConsoleServerPortsReadParams { + var () + return &DcimConsoleServerPortsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortsReadParamsWithTimeout creates a new DcimConsoleServerPortsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortsReadParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortsReadParams { + var () + return &DcimConsoleServerPortsReadParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortsReadParamsWithContext creates a new DcimConsoleServerPortsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortsReadParamsWithContext(ctx context.Context) *DcimConsoleServerPortsReadParams { + var () + return &DcimConsoleServerPortsReadParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortsReadParamsWithHTTPClient creates a new DcimConsoleServerPortsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortsReadParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortsReadParams { + var () + return &DcimConsoleServerPortsReadParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortsReadParams contains all the parameters to send to the API endpoint +for the dcim console server ports read operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortsReadParams struct { + + /*ID + A unique integer value identifying this console server port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server ports read params +func (o *DcimConsoleServerPortsReadParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server ports read params +func (o *DcimConsoleServerPortsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server ports read params +func (o *DcimConsoleServerPortsReadParams) WithContext(ctx context.Context) *DcimConsoleServerPortsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server ports read params +func (o *DcimConsoleServerPortsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server ports read params +func (o *DcimConsoleServerPortsReadParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server ports read params +func (o *DcimConsoleServerPortsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console server ports read params +func (o *DcimConsoleServerPortsReadParams) WithID(id int64) *DcimConsoleServerPortsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server ports read params +func (o *DcimConsoleServerPortsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_read_responses.go new file mode 100644 index 0000000..a1790ee --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsoleServerPortsReadReader is a Reader for the DcimConsoleServerPortsRead structure. +type DcimConsoleServerPortsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsoleServerPortsReadOK creates a DcimConsoleServerPortsReadOK with default headers values +func NewDcimConsoleServerPortsReadOK() *DcimConsoleServerPortsReadOK { + return &DcimConsoleServerPortsReadOK{} +} + +/*DcimConsoleServerPortsReadOK handles this case with default header values. + +DcimConsoleServerPortsReadOK dcim console server ports read o k +*/ +type DcimConsoleServerPortsReadOK struct { + Payload *models.ConsoleServerPort +} + +func (o *DcimConsoleServerPortsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-server-ports/{id}/][%d] dcimConsoleServerPortsReadOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConsoleServerPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_update_parameters.go new file mode 100644 index 0000000..06832cd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimConsoleServerPortsUpdateParams creates a new DcimConsoleServerPortsUpdateParams object +// with the default values initialized. +func NewDcimConsoleServerPortsUpdateParams() *DcimConsoleServerPortsUpdateParams { + var () + return &DcimConsoleServerPortsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortsUpdateParamsWithTimeout creates a new DcimConsoleServerPortsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortsUpdateParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortsUpdateParams { + var () + return &DcimConsoleServerPortsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortsUpdateParamsWithContext creates a new DcimConsoleServerPortsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortsUpdateParamsWithContext(ctx context.Context) *DcimConsoleServerPortsUpdateParams { + var () + return &DcimConsoleServerPortsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortsUpdateParamsWithHTTPClient creates a new DcimConsoleServerPortsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortsUpdateParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortsUpdateParams { + var () + return &DcimConsoleServerPortsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortsUpdateParams contains all the parameters to send to the API endpoint +for the dcim console server ports update operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortsUpdateParams struct { + + /*Data*/ + Data *models.WritableConsoleServerPort + /*ID + A unique integer value identifying this console server port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) WithContext(ctx context.Context) *DcimConsoleServerPortsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) WithData(data *models.WritableConsoleServerPort) *DcimConsoleServerPortsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) SetData(data *models.WritableConsoleServerPort) { + o.Data = data +} + +// WithID adds the id to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) WithID(id int64) *DcimConsoleServerPortsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_update_responses.go new file mode 100644 index 0000000..f90c9c5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_console_server_ports_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsoleServerPortsUpdateReader is a Reader for the DcimConsoleServerPortsUpdate structure. +type DcimConsoleServerPortsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsoleServerPortsUpdateOK creates a DcimConsoleServerPortsUpdateOK with default headers values +func NewDcimConsoleServerPortsUpdateOK() *DcimConsoleServerPortsUpdateOK { + return &DcimConsoleServerPortsUpdateOK{} +} + +/*DcimConsoleServerPortsUpdateOK handles this case with default header values. + +DcimConsoleServerPortsUpdateOK dcim console server ports update o k +*/ +type DcimConsoleServerPortsUpdateOK struct { + Payload *models.WritableConsoleServerPort +} + +func (o *DcimConsoleServerPortsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/console-server-ports/{id}/][%d] dcimConsoleServerPortsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsoleServerPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_create_parameters.go new file mode 100644 index 0000000..b0fdaf2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimDeviceBayTemplatesCreateParams creates a new DcimDeviceBayTemplatesCreateParams object +// with the default values initialized. +func NewDcimDeviceBayTemplatesCreateParams() *DcimDeviceBayTemplatesCreateParams { + var () + return &DcimDeviceBayTemplatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBayTemplatesCreateParamsWithTimeout creates a new DcimDeviceBayTemplatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBayTemplatesCreateParamsWithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesCreateParams { + var () + return &DcimDeviceBayTemplatesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBayTemplatesCreateParamsWithContext creates a new DcimDeviceBayTemplatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBayTemplatesCreateParamsWithContext(ctx context.Context) *DcimDeviceBayTemplatesCreateParams { + var () + return &DcimDeviceBayTemplatesCreateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBayTemplatesCreateParamsWithHTTPClient creates a new DcimDeviceBayTemplatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBayTemplatesCreateParamsWithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesCreateParams { + var () + return &DcimDeviceBayTemplatesCreateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBayTemplatesCreateParams contains all the parameters to send to the API endpoint +for the dcim device bay templates create operation typically these are written to a http.Request +*/ +type DcimDeviceBayTemplatesCreateParams struct { + + /*Data*/ + Data *models.WritableDeviceBayTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bay templates create params +func (o *DcimDeviceBayTemplatesCreateParams) WithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bay templates create params +func (o *DcimDeviceBayTemplatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bay templates create params +func (o *DcimDeviceBayTemplatesCreateParams) WithContext(ctx context.Context) *DcimDeviceBayTemplatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bay templates create params +func (o *DcimDeviceBayTemplatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bay templates create params +func (o *DcimDeviceBayTemplatesCreateParams) WithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bay templates create params +func (o *DcimDeviceBayTemplatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device bay templates create params +func (o *DcimDeviceBayTemplatesCreateParams) WithData(data *models.WritableDeviceBayTemplate) *DcimDeviceBayTemplatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device bay templates create params +func (o *DcimDeviceBayTemplatesCreateParams) SetData(data *models.WritableDeviceBayTemplate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBayTemplatesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_create_responses.go new file mode 100644 index 0000000..e947354 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceBayTemplatesCreateReader is a Reader for the DcimDeviceBayTemplatesCreate structure. +type DcimDeviceBayTemplatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBayTemplatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimDeviceBayTemplatesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceBayTemplatesCreateCreated creates a DcimDeviceBayTemplatesCreateCreated with default headers values +func NewDcimDeviceBayTemplatesCreateCreated() *DcimDeviceBayTemplatesCreateCreated { + return &DcimDeviceBayTemplatesCreateCreated{} +} + +/*DcimDeviceBayTemplatesCreateCreated handles this case with default header values. + +DcimDeviceBayTemplatesCreateCreated dcim device bay templates create created +*/ +type DcimDeviceBayTemplatesCreateCreated struct { + Payload *models.WritableDeviceBayTemplate +} + +func (o *DcimDeviceBayTemplatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/device-bay-templates/][%d] dcimDeviceBayTemplatesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimDeviceBayTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceBayTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_delete_parameters.go new file mode 100644 index 0000000..43928cc --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimDeviceBayTemplatesDeleteParams creates a new DcimDeviceBayTemplatesDeleteParams object +// with the default values initialized. +func NewDcimDeviceBayTemplatesDeleteParams() *DcimDeviceBayTemplatesDeleteParams { + var () + return &DcimDeviceBayTemplatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBayTemplatesDeleteParamsWithTimeout creates a new DcimDeviceBayTemplatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBayTemplatesDeleteParamsWithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesDeleteParams { + var () + return &DcimDeviceBayTemplatesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBayTemplatesDeleteParamsWithContext creates a new DcimDeviceBayTemplatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBayTemplatesDeleteParamsWithContext(ctx context.Context) *DcimDeviceBayTemplatesDeleteParams { + var () + return &DcimDeviceBayTemplatesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBayTemplatesDeleteParamsWithHTTPClient creates a new DcimDeviceBayTemplatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBayTemplatesDeleteParamsWithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesDeleteParams { + var () + return &DcimDeviceBayTemplatesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBayTemplatesDeleteParams contains all the parameters to send to the API endpoint +for the dcim device bay templates delete operation typically these are written to a http.Request +*/ +type DcimDeviceBayTemplatesDeleteParams struct { + + /*ID + A unique integer value identifying this device bay template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bay templates delete params +func (o *DcimDeviceBayTemplatesDeleteParams) WithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bay templates delete params +func (o *DcimDeviceBayTemplatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bay templates delete params +func (o *DcimDeviceBayTemplatesDeleteParams) WithContext(ctx context.Context) *DcimDeviceBayTemplatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bay templates delete params +func (o *DcimDeviceBayTemplatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bay templates delete params +func (o *DcimDeviceBayTemplatesDeleteParams) WithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bay templates delete params +func (o *DcimDeviceBayTemplatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim device bay templates delete params +func (o *DcimDeviceBayTemplatesDeleteParams) WithID(id int64) *DcimDeviceBayTemplatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bay templates delete params +func (o *DcimDeviceBayTemplatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBayTemplatesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_delete_responses.go new file mode 100644 index 0000000..a3800d0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimDeviceBayTemplatesDeleteReader is a Reader for the DcimDeviceBayTemplatesDelete structure. +type DcimDeviceBayTemplatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBayTemplatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimDeviceBayTemplatesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceBayTemplatesDeleteNoContent creates a DcimDeviceBayTemplatesDeleteNoContent with default headers values +func NewDcimDeviceBayTemplatesDeleteNoContent() *DcimDeviceBayTemplatesDeleteNoContent { + return &DcimDeviceBayTemplatesDeleteNoContent{} +} + +/*DcimDeviceBayTemplatesDeleteNoContent handles this case with default header values. + +DcimDeviceBayTemplatesDeleteNoContent dcim device bay templates delete no content +*/ +type DcimDeviceBayTemplatesDeleteNoContent struct { +} + +func (o *DcimDeviceBayTemplatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/device-bay-templates/{id}/][%d] dcimDeviceBayTemplatesDeleteNoContent ", 204) +} + +func (o *DcimDeviceBayTemplatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_list_parameters.go new file mode 100644 index 0000000..b967bcf --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_list_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimDeviceBayTemplatesListParams creates a new DcimDeviceBayTemplatesListParams object +// with the default values initialized. +func NewDcimDeviceBayTemplatesListParams() *DcimDeviceBayTemplatesListParams { + var () + return &DcimDeviceBayTemplatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBayTemplatesListParamsWithTimeout creates a new DcimDeviceBayTemplatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBayTemplatesListParamsWithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesListParams { + var () + return &DcimDeviceBayTemplatesListParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBayTemplatesListParamsWithContext creates a new DcimDeviceBayTemplatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBayTemplatesListParamsWithContext(ctx context.Context) *DcimDeviceBayTemplatesListParams { + var () + return &DcimDeviceBayTemplatesListParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBayTemplatesListParamsWithHTTPClient creates a new DcimDeviceBayTemplatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBayTemplatesListParamsWithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesListParams { + var () + return &DcimDeviceBayTemplatesListParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBayTemplatesListParams contains all the parameters to send to the API endpoint +for the dcim device bay templates list operation typically these are written to a http.Request +*/ +type DcimDeviceBayTemplatesListParams struct { + + /*DevicetypeID*/ + DevicetypeID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) WithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) WithContext(ctx context.Context) *DcimDeviceBayTemplatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) WithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevicetypeID adds the devicetypeID to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) WithDevicetypeID(devicetypeID *string) *DcimDeviceBayTemplatesListParams { + o.SetDevicetypeID(devicetypeID) + return o +} + +// SetDevicetypeID adds the devicetypeId to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) SetDevicetypeID(devicetypeID *string) { + o.DevicetypeID = devicetypeID +} + +// WithLimit adds the limit to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) WithLimit(limit *int64) *DcimDeviceBayTemplatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) WithName(name *string) *DcimDeviceBayTemplatesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) WithOffset(offset *int64) *DcimDeviceBayTemplatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBayTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DevicetypeID != nil { + + // query param devicetype_id + var qrDevicetypeID string + if o.DevicetypeID != nil { + qrDevicetypeID = *o.DevicetypeID + } + qDevicetypeID := qrDevicetypeID + if qDevicetypeID != "" { + if err := r.SetQueryParam("devicetype_id", qDevicetypeID); 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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_list_responses.go new file mode 100644 index 0000000..1e83bc7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceBayTemplatesListReader is a Reader for the DcimDeviceBayTemplatesList structure. +type DcimDeviceBayTemplatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBayTemplatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceBayTemplatesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceBayTemplatesListOK creates a DcimDeviceBayTemplatesListOK with default headers values +func NewDcimDeviceBayTemplatesListOK() *DcimDeviceBayTemplatesListOK { + return &DcimDeviceBayTemplatesListOK{} +} + +/*DcimDeviceBayTemplatesListOK handles this case with default header values. + +DcimDeviceBayTemplatesListOK dcim device bay templates list o k +*/ +type DcimDeviceBayTemplatesListOK struct { + Payload *models.DcimDeviceBayTemplatesListOKBody +} + +func (o *DcimDeviceBayTemplatesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/device-bay-templates/][%d] dcimDeviceBayTemplatesListOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceBayTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimDeviceBayTemplatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_partial_update_parameters.go new file mode 100644 index 0000000..7fd8556 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimDeviceBayTemplatesPartialUpdateParams creates a new DcimDeviceBayTemplatesPartialUpdateParams object +// with the default values initialized. +func NewDcimDeviceBayTemplatesPartialUpdateParams() *DcimDeviceBayTemplatesPartialUpdateParams { + var () + return &DcimDeviceBayTemplatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBayTemplatesPartialUpdateParamsWithTimeout creates a new DcimDeviceBayTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBayTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesPartialUpdateParams { + var () + return &DcimDeviceBayTemplatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBayTemplatesPartialUpdateParamsWithContext creates a new DcimDeviceBayTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBayTemplatesPartialUpdateParamsWithContext(ctx context.Context) *DcimDeviceBayTemplatesPartialUpdateParams { + var () + return &DcimDeviceBayTemplatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBayTemplatesPartialUpdateParamsWithHTTPClient creates a new DcimDeviceBayTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBayTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesPartialUpdateParams { + var () + return &DcimDeviceBayTemplatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBayTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim device bay templates partial update operation typically these are written to a http.Request +*/ +type DcimDeviceBayTemplatesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableDeviceBayTemplate + /*ID + A unique integer value identifying this device bay template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) WithContext(ctx context.Context) *DcimDeviceBayTemplatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) WithData(data *models.WritableDeviceBayTemplate) *DcimDeviceBayTemplatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) SetData(data *models.WritableDeviceBayTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) WithID(id int64) *DcimDeviceBayTemplatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBayTemplatesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_partial_update_responses.go new file mode 100644 index 0000000..be2b1e0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceBayTemplatesPartialUpdateReader is a Reader for the DcimDeviceBayTemplatesPartialUpdate structure. +type DcimDeviceBayTemplatesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBayTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceBayTemplatesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceBayTemplatesPartialUpdateOK creates a DcimDeviceBayTemplatesPartialUpdateOK with default headers values +func NewDcimDeviceBayTemplatesPartialUpdateOK() *DcimDeviceBayTemplatesPartialUpdateOK { + return &DcimDeviceBayTemplatesPartialUpdateOK{} +} + +/*DcimDeviceBayTemplatesPartialUpdateOK handles this case with default header values. + +DcimDeviceBayTemplatesPartialUpdateOK dcim device bay templates partial update o k +*/ +type DcimDeviceBayTemplatesPartialUpdateOK struct { + Payload *models.WritableDeviceBayTemplate +} + +func (o *DcimDeviceBayTemplatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/device-bay-templates/{id}/][%d] dcimDeviceBayTemplatesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceBayTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceBayTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_read_parameters.go new file mode 100644 index 0000000..3e450ea --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimDeviceBayTemplatesReadParams creates a new DcimDeviceBayTemplatesReadParams object +// with the default values initialized. +func NewDcimDeviceBayTemplatesReadParams() *DcimDeviceBayTemplatesReadParams { + var () + return &DcimDeviceBayTemplatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBayTemplatesReadParamsWithTimeout creates a new DcimDeviceBayTemplatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBayTemplatesReadParamsWithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesReadParams { + var () + return &DcimDeviceBayTemplatesReadParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBayTemplatesReadParamsWithContext creates a new DcimDeviceBayTemplatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBayTemplatesReadParamsWithContext(ctx context.Context) *DcimDeviceBayTemplatesReadParams { + var () + return &DcimDeviceBayTemplatesReadParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBayTemplatesReadParamsWithHTTPClient creates a new DcimDeviceBayTemplatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBayTemplatesReadParamsWithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesReadParams { + var () + return &DcimDeviceBayTemplatesReadParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBayTemplatesReadParams contains all the parameters to send to the API endpoint +for the dcim device bay templates read operation typically these are written to a http.Request +*/ +type DcimDeviceBayTemplatesReadParams struct { + + /*ID + A unique integer value identifying this device bay template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bay templates read params +func (o *DcimDeviceBayTemplatesReadParams) WithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bay templates read params +func (o *DcimDeviceBayTemplatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bay templates read params +func (o *DcimDeviceBayTemplatesReadParams) WithContext(ctx context.Context) *DcimDeviceBayTemplatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bay templates read params +func (o *DcimDeviceBayTemplatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bay templates read params +func (o *DcimDeviceBayTemplatesReadParams) WithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bay templates read params +func (o *DcimDeviceBayTemplatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim device bay templates read params +func (o *DcimDeviceBayTemplatesReadParams) WithID(id int64) *DcimDeviceBayTemplatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bay templates read params +func (o *DcimDeviceBayTemplatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBayTemplatesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_read_responses.go new file mode 100644 index 0000000..81e2dea --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceBayTemplatesReadReader is a Reader for the DcimDeviceBayTemplatesRead structure. +type DcimDeviceBayTemplatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBayTemplatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceBayTemplatesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceBayTemplatesReadOK creates a DcimDeviceBayTemplatesReadOK with default headers values +func NewDcimDeviceBayTemplatesReadOK() *DcimDeviceBayTemplatesReadOK { + return &DcimDeviceBayTemplatesReadOK{} +} + +/*DcimDeviceBayTemplatesReadOK handles this case with default header values. + +DcimDeviceBayTemplatesReadOK dcim device bay templates read o k +*/ +type DcimDeviceBayTemplatesReadOK struct { + Payload *models.DeviceBayTemplate +} + +func (o *DcimDeviceBayTemplatesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/device-bay-templates/{id}/][%d] dcimDeviceBayTemplatesReadOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceBayTemplatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeviceBayTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_update_parameters.go new file mode 100644 index 0000000..1a8c926 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimDeviceBayTemplatesUpdateParams creates a new DcimDeviceBayTemplatesUpdateParams object +// with the default values initialized. +func NewDcimDeviceBayTemplatesUpdateParams() *DcimDeviceBayTemplatesUpdateParams { + var () + return &DcimDeviceBayTemplatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBayTemplatesUpdateParamsWithTimeout creates a new DcimDeviceBayTemplatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBayTemplatesUpdateParamsWithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesUpdateParams { + var () + return &DcimDeviceBayTemplatesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBayTemplatesUpdateParamsWithContext creates a new DcimDeviceBayTemplatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBayTemplatesUpdateParamsWithContext(ctx context.Context) *DcimDeviceBayTemplatesUpdateParams { + var () + return &DcimDeviceBayTemplatesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBayTemplatesUpdateParamsWithHTTPClient creates a new DcimDeviceBayTemplatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBayTemplatesUpdateParamsWithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesUpdateParams { + var () + return &DcimDeviceBayTemplatesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBayTemplatesUpdateParams contains all the parameters to send to the API endpoint +for the dcim device bay templates update operation typically these are written to a http.Request +*/ +type DcimDeviceBayTemplatesUpdateParams struct { + + /*Data*/ + Data *models.WritableDeviceBayTemplate + /*ID + A unique integer value identifying this device bay template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) WithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) WithContext(ctx context.Context) *DcimDeviceBayTemplatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) WithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) WithData(data *models.WritableDeviceBayTemplate) *DcimDeviceBayTemplatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) SetData(data *models.WritableDeviceBayTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) WithID(id int64) *DcimDeviceBayTemplatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBayTemplatesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_update_responses.go new file mode 100644 index 0000000..8f67bd9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bay_templates_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceBayTemplatesUpdateReader is a Reader for the DcimDeviceBayTemplatesUpdate structure. +type DcimDeviceBayTemplatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBayTemplatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceBayTemplatesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceBayTemplatesUpdateOK creates a DcimDeviceBayTemplatesUpdateOK with default headers values +func NewDcimDeviceBayTemplatesUpdateOK() *DcimDeviceBayTemplatesUpdateOK { + return &DcimDeviceBayTemplatesUpdateOK{} +} + +/*DcimDeviceBayTemplatesUpdateOK handles this case with default header values. + +DcimDeviceBayTemplatesUpdateOK dcim device bay templates update o k +*/ +type DcimDeviceBayTemplatesUpdateOK struct { + Payload *models.WritableDeviceBayTemplate +} + +func (o *DcimDeviceBayTemplatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/device-bay-templates/{id}/][%d] dcimDeviceBayTemplatesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceBayTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceBayTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_create_parameters.go new file mode 100644 index 0000000..d4f8b0d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimDeviceBaysCreateParams creates a new DcimDeviceBaysCreateParams object +// with the default values initialized. +func NewDcimDeviceBaysCreateParams() *DcimDeviceBaysCreateParams { + var () + return &DcimDeviceBaysCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBaysCreateParamsWithTimeout creates a new DcimDeviceBaysCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBaysCreateParamsWithTimeout(timeout time.Duration) *DcimDeviceBaysCreateParams { + var () + return &DcimDeviceBaysCreateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBaysCreateParamsWithContext creates a new DcimDeviceBaysCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBaysCreateParamsWithContext(ctx context.Context) *DcimDeviceBaysCreateParams { + var () + return &DcimDeviceBaysCreateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBaysCreateParamsWithHTTPClient creates a new DcimDeviceBaysCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBaysCreateParamsWithHTTPClient(client *http.Client) *DcimDeviceBaysCreateParams { + var () + return &DcimDeviceBaysCreateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBaysCreateParams contains all the parameters to send to the API endpoint +for the dcim device bays create operation typically these are written to a http.Request +*/ +type DcimDeviceBaysCreateParams struct { + + /*Data*/ + Data *models.WritableDeviceBay + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bays create params +func (o *DcimDeviceBaysCreateParams) WithTimeout(timeout time.Duration) *DcimDeviceBaysCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bays create params +func (o *DcimDeviceBaysCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bays create params +func (o *DcimDeviceBaysCreateParams) WithContext(ctx context.Context) *DcimDeviceBaysCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bays create params +func (o *DcimDeviceBaysCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bays create params +func (o *DcimDeviceBaysCreateParams) WithHTTPClient(client *http.Client) *DcimDeviceBaysCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bays create params +func (o *DcimDeviceBaysCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device bays create params +func (o *DcimDeviceBaysCreateParams) WithData(data *models.WritableDeviceBay) *DcimDeviceBaysCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device bays create params +func (o *DcimDeviceBaysCreateParams) SetData(data *models.WritableDeviceBay) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBaysCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_create_responses.go new file mode 100644 index 0000000..17a31cd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceBaysCreateReader is a Reader for the DcimDeviceBaysCreate structure. +type DcimDeviceBaysCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBaysCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimDeviceBaysCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceBaysCreateCreated creates a DcimDeviceBaysCreateCreated with default headers values +func NewDcimDeviceBaysCreateCreated() *DcimDeviceBaysCreateCreated { + return &DcimDeviceBaysCreateCreated{} +} + +/*DcimDeviceBaysCreateCreated handles this case with default header values. + +DcimDeviceBaysCreateCreated dcim device bays create created +*/ +type DcimDeviceBaysCreateCreated struct { + Payload *models.WritableDeviceBay +} + +func (o *DcimDeviceBaysCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/device-bays/][%d] dcimDeviceBaysCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimDeviceBaysCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceBay) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_delete_parameters.go new file mode 100644 index 0000000..834eab8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimDeviceBaysDeleteParams creates a new DcimDeviceBaysDeleteParams object +// with the default values initialized. +func NewDcimDeviceBaysDeleteParams() *DcimDeviceBaysDeleteParams { + var () + return &DcimDeviceBaysDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBaysDeleteParamsWithTimeout creates a new DcimDeviceBaysDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBaysDeleteParamsWithTimeout(timeout time.Duration) *DcimDeviceBaysDeleteParams { + var () + return &DcimDeviceBaysDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBaysDeleteParamsWithContext creates a new DcimDeviceBaysDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBaysDeleteParamsWithContext(ctx context.Context) *DcimDeviceBaysDeleteParams { + var () + return &DcimDeviceBaysDeleteParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBaysDeleteParamsWithHTTPClient creates a new DcimDeviceBaysDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBaysDeleteParamsWithHTTPClient(client *http.Client) *DcimDeviceBaysDeleteParams { + var () + return &DcimDeviceBaysDeleteParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBaysDeleteParams contains all the parameters to send to the API endpoint +for the dcim device bays delete operation typically these are written to a http.Request +*/ +type DcimDeviceBaysDeleteParams struct { + + /*ID + A unique integer value identifying this device bay. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bays delete params +func (o *DcimDeviceBaysDeleteParams) WithTimeout(timeout time.Duration) *DcimDeviceBaysDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bays delete params +func (o *DcimDeviceBaysDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bays delete params +func (o *DcimDeviceBaysDeleteParams) WithContext(ctx context.Context) *DcimDeviceBaysDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bays delete params +func (o *DcimDeviceBaysDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bays delete params +func (o *DcimDeviceBaysDeleteParams) WithHTTPClient(client *http.Client) *DcimDeviceBaysDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bays delete params +func (o *DcimDeviceBaysDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim device bays delete params +func (o *DcimDeviceBaysDeleteParams) WithID(id int64) *DcimDeviceBaysDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bays delete params +func (o *DcimDeviceBaysDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBaysDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_delete_responses.go new file mode 100644 index 0000000..cdfb3c7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimDeviceBaysDeleteReader is a Reader for the DcimDeviceBaysDelete structure. +type DcimDeviceBaysDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBaysDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimDeviceBaysDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceBaysDeleteNoContent creates a DcimDeviceBaysDeleteNoContent with default headers values +func NewDcimDeviceBaysDeleteNoContent() *DcimDeviceBaysDeleteNoContent { + return &DcimDeviceBaysDeleteNoContent{} +} + +/*DcimDeviceBaysDeleteNoContent handles this case with default header values. + +DcimDeviceBaysDeleteNoContent dcim device bays delete no content +*/ +type DcimDeviceBaysDeleteNoContent struct { +} + +func (o *DcimDeviceBaysDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/device-bays/{id}/][%d] dcimDeviceBaysDeleteNoContent ", 204) +} + +func (o *DcimDeviceBaysDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_list_parameters.go new file mode 100644 index 0000000..1c8fe53 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_list_parameters.go @@ -0,0 +1,282 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimDeviceBaysListParams creates a new DcimDeviceBaysListParams object +// with the default values initialized. +func NewDcimDeviceBaysListParams() *DcimDeviceBaysListParams { + var () + return &DcimDeviceBaysListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBaysListParamsWithTimeout creates a new DcimDeviceBaysListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBaysListParamsWithTimeout(timeout time.Duration) *DcimDeviceBaysListParams { + var () + return &DcimDeviceBaysListParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBaysListParamsWithContext creates a new DcimDeviceBaysListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBaysListParamsWithContext(ctx context.Context) *DcimDeviceBaysListParams { + var () + return &DcimDeviceBaysListParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBaysListParamsWithHTTPClient creates a new DcimDeviceBaysListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBaysListParamsWithHTTPClient(client *http.Client) *DcimDeviceBaysListParams { + var () + return &DcimDeviceBaysListParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBaysListParams contains all the parameters to send to the API endpoint +for the dcim device bays list operation typically these are written to a http.Request +*/ +type DcimDeviceBaysListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithTimeout(timeout time.Duration) *DcimDeviceBaysListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithContext(ctx context.Context) *DcimDeviceBaysListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithHTTPClient(client *http.Client) *DcimDeviceBaysListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithDevice(device *string) *DcimDeviceBaysListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithDeviceID(deviceID *string) *DcimDeviceBaysListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithLimit adds the limit to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithLimit(limit *int64) *DcimDeviceBaysListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithName(name *string) *DcimDeviceBaysListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithOffset(offset *int64) *DcimDeviceBaysListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBaysListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); 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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_list_responses.go new file mode 100644 index 0000000..5ed482c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceBaysListReader is a Reader for the DcimDeviceBaysList structure. +type DcimDeviceBaysListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBaysListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceBaysListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceBaysListOK creates a DcimDeviceBaysListOK with default headers values +func NewDcimDeviceBaysListOK() *DcimDeviceBaysListOK { + return &DcimDeviceBaysListOK{} +} + +/*DcimDeviceBaysListOK handles this case with default header values. + +DcimDeviceBaysListOK dcim device bays list o k +*/ +type DcimDeviceBaysListOK struct { + Payload *models.DcimDeviceBaysListOKBody +} + +func (o *DcimDeviceBaysListOK) Error() string { + return fmt.Sprintf("[GET /dcim/device-bays/][%d] dcimDeviceBaysListOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceBaysListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimDeviceBaysListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_partial_update_parameters.go new file mode 100644 index 0000000..5271419 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimDeviceBaysPartialUpdateParams creates a new DcimDeviceBaysPartialUpdateParams object +// with the default values initialized. +func NewDcimDeviceBaysPartialUpdateParams() *DcimDeviceBaysPartialUpdateParams { + var () + return &DcimDeviceBaysPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBaysPartialUpdateParamsWithTimeout creates a new DcimDeviceBaysPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBaysPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimDeviceBaysPartialUpdateParams { + var () + return &DcimDeviceBaysPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBaysPartialUpdateParamsWithContext creates a new DcimDeviceBaysPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBaysPartialUpdateParamsWithContext(ctx context.Context) *DcimDeviceBaysPartialUpdateParams { + var () + return &DcimDeviceBaysPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBaysPartialUpdateParamsWithHTTPClient creates a new DcimDeviceBaysPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBaysPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimDeviceBaysPartialUpdateParams { + var () + return &DcimDeviceBaysPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBaysPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim device bays partial update operation typically these are written to a http.Request +*/ +type DcimDeviceBaysPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableDeviceBay + /*ID + A unique integer value identifying this device bay. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimDeviceBaysPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) WithContext(ctx context.Context) *DcimDeviceBaysPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimDeviceBaysPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) WithData(data *models.WritableDeviceBay) *DcimDeviceBaysPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) SetData(data *models.WritableDeviceBay) { + o.Data = data +} + +// WithID adds the id to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) WithID(id int64) *DcimDeviceBaysPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBaysPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_partial_update_responses.go new file mode 100644 index 0000000..cc824fe --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceBaysPartialUpdateReader is a Reader for the DcimDeviceBaysPartialUpdate structure. +type DcimDeviceBaysPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBaysPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceBaysPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceBaysPartialUpdateOK creates a DcimDeviceBaysPartialUpdateOK with default headers values +func NewDcimDeviceBaysPartialUpdateOK() *DcimDeviceBaysPartialUpdateOK { + return &DcimDeviceBaysPartialUpdateOK{} +} + +/*DcimDeviceBaysPartialUpdateOK handles this case with default header values. + +DcimDeviceBaysPartialUpdateOK dcim device bays partial update o k +*/ +type DcimDeviceBaysPartialUpdateOK struct { + Payload *models.WritableDeviceBay +} + +func (o *DcimDeviceBaysPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/device-bays/{id}/][%d] dcimDeviceBaysPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceBaysPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceBay) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_read_parameters.go new file mode 100644 index 0000000..f2812f5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimDeviceBaysReadParams creates a new DcimDeviceBaysReadParams object +// with the default values initialized. +func NewDcimDeviceBaysReadParams() *DcimDeviceBaysReadParams { + var () + return &DcimDeviceBaysReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBaysReadParamsWithTimeout creates a new DcimDeviceBaysReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBaysReadParamsWithTimeout(timeout time.Duration) *DcimDeviceBaysReadParams { + var () + return &DcimDeviceBaysReadParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBaysReadParamsWithContext creates a new DcimDeviceBaysReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBaysReadParamsWithContext(ctx context.Context) *DcimDeviceBaysReadParams { + var () + return &DcimDeviceBaysReadParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBaysReadParamsWithHTTPClient creates a new DcimDeviceBaysReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBaysReadParamsWithHTTPClient(client *http.Client) *DcimDeviceBaysReadParams { + var () + return &DcimDeviceBaysReadParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBaysReadParams contains all the parameters to send to the API endpoint +for the dcim device bays read operation typically these are written to a http.Request +*/ +type DcimDeviceBaysReadParams struct { + + /*ID + A unique integer value identifying this device bay. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bays read params +func (o *DcimDeviceBaysReadParams) WithTimeout(timeout time.Duration) *DcimDeviceBaysReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bays read params +func (o *DcimDeviceBaysReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bays read params +func (o *DcimDeviceBaysReadParams) WithContext(ctx context.Context) *DcimDeviceBaysReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bays read params +func (o *DcimDeviceBaysReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bays read params +func (o *DcimDeviceBaysReadParams) WithHTTPClient(client *http.Client) *DcimDeviceBaysReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bays read params +func (o *DcimDeviceBaysReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim device bays read params +func (o *DcimDeviceBaysReadParams) WithID(id int64) *DcimDeviceBaysReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bays read params +func (o *DcimDeviceBaysReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBaysReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_read_responses.go new file mode 100644 index 0000000..31ed1cf --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceBaysReadReader is a Reader for the DcimDeviceBaysRead structure. +type DcimDeviceBaysReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBaysReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceBaysReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceBaysReadOK creates a DcimDeviceBaysReadOK with default headers values +func NewDcimDeviceBaysReadOK() *DcimDeviceBaysReadOK { + return &DcimDeviceBaysReadOK{} +} + +/*DcimDeviceBaysReadOK handles this case with default header values. + +DcimDeviceBaysReadOK dcim device bays read o k +*/ +type DcimDeviceBaysReadOK struct { + Payload *models.DeviceBay +} + +func (o *DcimDeviceBaysReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/device-bays/{id}/][%d] dcimDeviceBaysReadOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceBaysReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeviceBay) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_update_parameters.go new file mode 100644 index 0000000..57ddad0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimDeviceBaysUpdateParams creates a new DcimDeviceBaysUpdateParams object +// with the default values initialized. +func NewDcimDeviceBaysUpdateParams() *DcimDeviceBaysUpdateParams { + var () + return &DcimDeviceBaysUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBaysUpdateParamsWithTimeout creates a new DcimDeviceBaysUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBaysUpdateParamsWithTimeout(timeout time.Duration) *DcimDeviceBaysUpdateParams { + var () + return &DcimDeviceBaysUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBaysUpdateParamsWithContext creates a new DcimDeviceBaysUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBaysUpdateParamsWithContext(ctx context.Context) *DcimDeviceBaysUpdateParams { + var () + return &DcimDeviceBaysUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBaysUpdateParamsWithHTTPClient creates a new DcimDeviceBaysUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBaysUpdateParamsWithHTTPClient(client *http.Client) *DcimDeviceBaysUpdateParams { + var () + return &DcimDeviceBaysUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBaysUpdateParams contains all the parameters to send to the API endpoint +for the dcim device bays update operation typically these are written to a http.Request +*/ +type DcimDeviceBaysUpdateParams struct { + + /*Data*/ + Data *models.WritableDeviceBay + /*ID + A unique integer value identifying this device bay. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) WithTimeout(timeout time.Duration) *DcimDeviceBaysUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) WithContext(ctx context.Context) *DcimDeviceBaysUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) WithHTTPClient(client *http.Client) *DcimDeviceBaysUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) WithData(data *models.WritableDeviceBay) *DcimDeviceBaysUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) SetData(data *models.WritableDeviceBay) { + o.Data = data +} + +// WithID adds the id to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) WithID(id int64) *DcimDeviceBaysUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBaysUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_update_responses.go new file mode 100644 index 0000000..13b1951 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_bays_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceBaysUpdateReader is a Reader for the DcimDeviceBaysUpdate structure. +type DcimDeviceBaysUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBaysUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceBaysUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceBaysUpdateOK creates a DcimDeviceBaysUpdateOK with default headers values +func NewDcimDeviceBaysUpdateOK() *DcimDeviceBaysUpdateOK { + return &DcimDeviceBaysUpdateOK{} +} + +/*DcimDeviceBaysUpdateOK handles this case with default header values. + +DcimDeviceBaysUpdateOK dcim device bays update o k +*/ +type DcimDeviceBaysUpdateOK struct { + Payload *models.WritableDeviceBay +} + +func (o *DcimDeviceBaysUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/device-bays/{id}/][%d] dcimDeviceBaysUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceBaysUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceBay) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_create_parameters.go new file mode 100644 index 0000000..2fe6af2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimDeviceRolesCreateParams creates a new DcimDeviceRolesCreateParams object +// with the default values initialized. +func NewDcimDeviceRolesCreateParams() *DcimDeviceRolesCreateParams { + var () + return &DcimDeviceRolesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceRolesCreateParamsWithTimeout creates a new DcimDeviceRolesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceRolesCreateParamsWithTimeout(timeout time.Duration) *DcimDeviceRolesCreateParams { + var () + return &DcimDeviceRolesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceRolesCreateParamsWithContext creates a new DcimDeviceRolesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceRolesCreateParamsWithContext(ctx context.Context) *DcimDeviceRolesCreateParams { + var () + return &DcimDeviceRolesCreateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceRolesCreateParamsWithHTTPClient creates a new DcimDeviceRolesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceRolesCreateParamsWithHTTPClient(client *http.Client) *DcimDeviceRolesCreateParams { + var () + return &DcimDeviceRolesCreateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceRolesCreateParams contains all the parameters to send to the API endpoint +for the dcim device roles create operation typically these are written to a http.Request +*/ +type DcimDeviceRolesCreateParams struct { + + /*Data*/ + Data *models.DeviceRole + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device roles create params +func (o *DcimDeviceRolesCreateParams) WithTimeout(timeout time.Duration) *DcimDeviceRolesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device roles create params +func (o *DcimDeviceRolesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device roles create params +func (o *DcimDeviceRolesCreateParams) WithContext(ctx context.Context) *DcimDeviceRolesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device roles create params +func (o *DcimDeviceRolesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device roles create params +func (o *DcimDeviceRolesCreateParams) WithHTTPClient(client *http.Client) *DcimDeviceRolesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device roles create params +func (o *DcimDeviceRolesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device roles create params +func (o *DcimDeviceRolesCreateParams) WithData(data *models.DeviceRole) *DcimDeviceRolesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device roles create params +func (o *DcimDeviceRolesCreateParams) SetData(data *models.DeviceRole) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceRolesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_create_responses.go new file mode 100644 index 0000000..193ac10 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceRolesCreateReader is a Reader for the DcimDeviceRolesCreate structure. +type DcimDeviceRolesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceRolesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimDeviceRolesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceRolesCreateCreated creates a DcimDeviceRolesCreateCreated with default headers values +func NewDcimDeviceRolesCreateCreated() *DcimDeviceRolesCreateCreated { + return &DcimDeviceRolesCreateCreated{} +} + +/*DcimDeviceRolesCreateCreated handles this case with default header values. + +DcimDeviceRolesCreateCreated dcim device roles create created +*/ +type DcimDeviceRolesCreateCreated struct { + Payload *models.DeviceRole +} + +func (o *DcimDeviceRolesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/device-roles/][%d] dcimDeviceRolesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimDeviceRolesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeviceRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_delete_parameters.go new file mode 100644 index 0000000..689c2da --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimDeviceRolesDeleteParams creates a new DcimDeviceRolesDeleteParams object +// with the default values initialized. +func NewDcimDeviceRolesDeleteParams() *DcimDeviceRolesDeleteParams { + var () + return &DcimDeviceRolesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceRolesDeleteParamsWithTimeout creates a new DcimDeviceRolesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceRolesDeleteParamsWithTimeout(timeout time.Duration) *DcimDeviceRolesDeleteParams { + var () + return &DcimDeviceRolesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceRolesDeleteParamsWithContext creates a new DcimDeviceRolesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceRolesDeleteParamsWithContext(ctx context.Context) *DcimDeviceRolesDeleteParams { + var () + return &DcimDeviceRolesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimDeviceRolesDeleteParamsWithHTTPClient creates a new DcimDeviceRolesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceRolesDeleteParamsWithHTTPClient(client *http.Client) *DcimDeviceRolesDeleteParams { + var () + return &DcimDeviceRolesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimDeviceRolesDeleteParams contains all the parameters to send to the API endpoint +for the dcim device roles delete operation typically these are written to a http.Request +*/ +type DcimDeviceRolesDeleteParams struct { + + /*ID + A unique integer value identifying this device role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device roles delete params +func (o *DcimDeviceRolesDeleteParams) WithTimeout(timeout time.Duration) *DcimDeviceRolesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device roles delete params +func (o *DcimDeviceRolesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device roles delete params +func (o *DcimDeviceRolesDeleteParams) WithContext(ctx context.Context) *DcimDeviceRolesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device roles delete params +func (o *DcimDeviceRolesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device roles delete params +func (o *DcimDeviceRolesDeleteParams) WithHTTPClient(client *http.Client) *DcimDeviceRolesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device roles delete params +func (o *DcimDeviceRolesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim device roles delete params +func (o *DcimDeviceRolesDeleteParams) WithID(id int64) *DcimDeviceRolesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device roles delete params +func (o *DcimDeviceRolesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceRolesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_delete_responses.go new file mode 100644 index 0000000..39a6838 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimDeviceRolesDeleteReader is a Reader for the DcimDeviceRolesDelete structure. +type DcimDeviceRolesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceRolesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimDeviceRolesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceRolesDeleteNoContent creates a DcimDeviceRolesDeleteNoContent with default headers values +func NewDcimDeviceRolesDeleteNoContent() *DcimDeviceRolesDeleteNoContent { + return &DcimDeviceRolesDeleteNoContent{} +} + +/*DcimDeviceRolesDeleteNoContent handles this case with default header values. + +DcimDeviceRolesDeleteNoContent dcim device roles delete no content +*/ +type DcimDeviceRolesDeleteNoContent struct { +} + +func (o *DcimDeviceRolesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/device-roles/{id}/][%d] dcimDeviceRolesDeleteNoContent ", 204) +} + +func (o *DcimDeviceRolesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_list_parameters.go new file mode 100644 index 0000000..116a9f2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_list_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimDeviceRolesListParams creates a new DcimDeviceRolesListParams object +// with the default values initialized. +func NewDcimDeviceRolesListParams() *DcimDeviceRolesListParams { + var () + return &DcimDeviceRolesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceRolesListParamsWithTimeout creates a new DcimDeviceRolesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceRolesListParamsWithTimeout(timeout time.Duration) *DcimDeviceRolesListParams { + var () + return &DcimDeviceRolesListParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceRolesListParamsWithContext creates a new DcimDeviceRolesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceRolesListParamsWithContext(ctx context.Context) *DcimDeviceRolesListParams { + var () + return &DcimDeviceRolesListParams{ + + Context: ctx, + } +} + +// NewDcimDeviceRolesListParamsWithHTTPClient creates a new DcimDeviceRolesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceRolesListParamsWithHTTPClient(client *http.Client) *DcimDeviceRolesListParams { + var () + return &DcimDeviceRolesListParams{ + HTTPClient: client, + } +} + +/*DcimDeviceRolesListParams contains all the parameters to send to the API endpoint +for the dcim device roles list operation typically these are written to a http.Request +*/ +type DcimDeviceRolesListParams struct { + + /*Color*/ + Color *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + /*VMRole*/ + VMRole *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithTimeout(timeout time.Duration) *DcimDeviceRolesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithContext(ctx context.Context) *DcimDeviceRolesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithHTTPClient(client *http.Client) *DcimDeviceRolesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithColor adds the color to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithColor(color *string) *DcimDeviceRolesListParams { + o.SetColor(color) + return o +} + +// SetColor adds the color to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetColor(color *string) { + o.Color = color +} + +// WithLimit adds the limit to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithLimit(limit *int64) *DcimDeviceRolesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithName(name *string) *DcimDeviceRolesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithOffset(offset *int64) *DcimDeviceRolesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithSlug(slug *string) *DcimDeviceRolesListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WithVMRole adds the vMRole to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithVMRole(vMRole *string) *DcimDeviceRolesListParams { + o.SetVMRole(vMRole) + return o +} + +// SetVMRole adds the vmRole to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetVMRole(vMRole *string) { + o.VMRole = vMRole +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceRolesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Color != nil { + + // query param color + var qrColor string + if o.Color != nil { + qrColor = *o.Color + } + qColor := qrColor + if qColor != "" { + if err := r.SetQueryParam("color", qColor); 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.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.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.VMRole != nil { + + // query param vm_role + var qrVMRole string + if o.VMRole != nil { + qrVMRole = *o.VMRole + } + qVMRole := qrVMRole + if qVMRole != "" { + if err := r.SetQueryParam("vm_role", qVMRole); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_list_responses.go new file mode 100644 index 0000000..d2708a0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceRolesListReader is a Reader for the DcimDeviceRolesList structure. +type DcimDeviceRolesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceRolesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceRolesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceRolesListOK creates a DcimDeviceRolesListOK with default headers values +func NewDcimDeviceRolesListOK() *DcimDeviceRolesListOK { + return &DcimDeviceRolesListOK{} +} + +/*DcimDeviceRolesListOK handles this case with default header values. + +DcimDeviceRolesListOK dcim device roles list o k +*/ +type DcimDeviceRolesListOK struct { + Payload *models.DcimDeviceRolesListOKBody +} + +func (o *DcimDeviceRolesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/device-roles/][%d] dcimDeviceRolesListOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceRolesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimDeviceRolesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_partial_update_parameters.go new file mode 100644 index 0000000..10a3593 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimDeviceRolesPartialUpdateParams creates a new DcimDeviceRolesPartialUpdateParams object +// with the default values initialized. +func NewDcimDeviceRolesPartialUpdateParams() *DcimDeviceRolesPartialUpdateParams { + var () + return &DcimDeviceRolesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceRolesPartialUpdateParamsWithTimeout creates a new DcimDeviceRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceRolesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimDeviceRolesPartialUpdateParams { + var () + return &DcimDeviceRolesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceRolesPartialUpdateParamsWithContext creates a new DcimDeviceRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceRolesPartialUpdateParamsWithContext(ctx context.Context) *DcimDeviceRolesPartialUpdateParams { + var () + return &DcimDeviceRolesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceRolesPartialUpdateParamsWithHTTPClient creates a new DcimDeviceRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceRolesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimDeviceRolesPartialUpdateParams { + var () + return &DcimDeviceRolesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceRolesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim device roles partial update operation typically these are written to a http.Request +*/ +type DcimDeviceRolesPartialUpdateParams struct { + + /*Data*/ + Data *models.DeviceRole + /*ID + A unique integer value identifying this device role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimDeviceRolesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) WithContext(ctx context.Context) *DcimDeviceRolesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimDeviceRolesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) WithData(data *models.DeviceRole) *DcimDeviceRolesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) SetData(data *models.DeviceRole) { + o.Data = data +} + +// WithID adds the id to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) WithID(id int64) *DcimDeviceRolesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceRolesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_partial_update_responses.go new file mode 100644 index 0000000..87bcf68 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceRolesPartialUpdateReader is a Reader for the DcimDeviceRolesPartialUpdate structure. +type DcimDeviceRolesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceRolesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceRolesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceRolesPartialUpdateOK creates a DcimDeviceRolesPartialUpdateOK with default headers values +func NewDcimDeviceRolesPartialUpdateOK() *DcimDeviceRolesPartialUpdateOK { + return &DcimDeviceRolesPartialUpdateOK{} +} + +/*DcimDeviceRolesPartialUpdateOK handles this case with default header values. + +DcimDeviceRolesPartialUpdateOK dcim device roles partial update o k +*/ +type DcimDeviceRolesPartialUpdateOK struct { + Payload *models.DeviceRole +} + +func (o *DcimDeviceRolesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/device-roles/{id}/][%d] dcimDeviceRolesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceRolesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeviceRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_read_parameters.go new file mode 100644 index 0000000..979b3d6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimDeviceRolesReadParams creates a new DcimDeviceRolesReadParams object +// with the default values initialized. +func NewDcimDeviceRolesReadParams() *DcimDeviceRolesReadParams { + var () + return &DcimDeviceRolesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceRolesReadParamsWithTimeout creates a new DcimDeviceRolesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceRolesReadParamsWithTimeout(timeout time.Duration) *DcimDeviceRolesReadParams { + var () + return &DcimDeviceRolesReadParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceRolesReadParamsWithContext creates a new DcimDeviceRolesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceRolesReadParamsWithContext(ctx context.Context) *DcimDeviceRolesReadParams { + var () + return &DcimDeviceRolesReadParams{ + + Context: ctx, + } +} + +// NewDcimDeviceRolesReadParamsWithHTTPClient creates a new DcimDeviceRolesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceRolesReadParamsWithHTTPClient(client *http.Client) *DcimDeviceRolesReadParams { + var () + return &DcimDeviceRolesReadParams{ + HTTPClient: client, + } +} + +/*DcimDeviceRolesReadParams contains all the parameters to send to the API endpoint +for the dcim device roles read operation typically these are written to a http.Request +*/ +type DcimDeviceRolesReadParams struct { + + /*ID + A unique integer value identifying this device role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device roles read params +func (o *DcimDeviceRolesReadParams) WithTimeout(timeout time.Duration) *DcimDeviceRolesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device roles read params +func (o *DcimDeviceRolesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device roles read params +func (o *DcimDeviceRolesReadParams) WithContext(ctx context.Context) *DcimDeviceRolesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device roles read params +func (o *DcimDeviceRolesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device roles read params +func (o *DcimDeviceRolesReadParams) WithHTTPClient(client *http.Client) *DcimDeviceRolesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device roles read params +func (o *DcimDeviceRolesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim device roles read params +func (o *DcimDeviceRolesReadParams) WithID(id int64) *DcimDeviceRolesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device roles read params +func (o *DcimDeviceRolesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceRolesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_read_responses.go new file mode 100644 index 0000000..93b241f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceRolesReadReader is a Reader for the DcimDeviceRolesRead structure. +type DcimDeviceRolesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceRolesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceRolesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceRolesReadOK creates a DcimDeviceRolesReadOK with default headers values +func NewDcimDeviceRolesReadOK() *DcimDeviceRolesReadOK { + return &DcimDeviceRolesReadOK{} +} + +/*DcimDeviceRolesReadOK handles this case with default header values. + +DcimDeviceRolesReadOK dcim device roles read o k +*/ +type DcimDeviceRolesReadOK struct { + Payload *models.DeviceRole +} + +func (o *DcimDeviceRolesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/device-roles/{id}/][%d] dcimDeviceRolesReadOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceRolesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeviceRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_update_parameters.go new file mode 100644 index 0000000..5f04604 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimDeviceRolesUpdateParams creates a new DcimDeviceRolesUpdateParams object +// with the default values initialized. +func NewDcimDeviceRolesUpdateParams() *DcimDeviceRolesUpdateParams { + var () + return &DcimDeviceRolesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceRolesUpdateParamsWithTimeout creates a new DcimDeviceRolesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceRolesUpdateParamsWithTimeout(timeout time.Duration) *DcimDeviceRolesUpdateParams { + var () + return &DcimDeviceRolesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceRolesUpdateParamsWithContext creates a new DcimDeviceRolesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceRolesUpdateParamsWithContext(ctx context.Context) *DcimDeviceRolesUpdateParams { + var () + return &DcimDeviceRolesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceRolesUpdateParamsWithHTTPClient creates a new DcimDeviceRolesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceRolesUpdateParamsWithHTTPClient(client *http.Client) *DcimDeviceRolesUpdateParams { + var () + return &DcimDeviceRolesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceRolesUpdateParams contains all the parameters to send to the API endpoint +for the dcim device roles update operation typically these are written to a http.Request +*/ +type DcimDeviceRolesUpdateParams struct { + + /*Data*/ + Data *models.DeviceRole + /*ID + A unique integer value identifying this device role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) WithTimeout(timeout time.Duration) *DcimDeviceRolesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) WithContext(ctx context.Context) *DcimDeviceRolesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) WithHTTPClient(client *http.Client) *DcimDeviceRolesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) WithData(data *models.DeviceRole) *DcimDeviceRolesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) SetData(data *models.DeviceRole) { + o.Data = data +} + +// WithID adds the id to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) WithID(id int64) *DcimDeviceRolesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceRolesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_update_responses.go new file mode 100644 index 0000000..5b1940f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_roles_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceRolesUpdateReader is a Reader for the DcimDeviceRolesUpdate structure. +type DcimDeviceRolesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceRolesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceRolesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceRolesUpdateOK creates a DcimDeviceRolesUpdateOK with default headers values +func NewDcimDeviceRolesUpdateOK() *DcimDeviceRolesUpdateOK { + return &DcimDeviceRolesUpdateOK{} +} + +/*DcimDeviceRolesUpdateOK handles this case with default header values. + +DcimDeviceRolesUpdateOK dcim device roles update o k +*/ +type DcimDeviceRolesUpdateOK struct { + Payload *models.DeviceRole +} + +func (o *DcimDeviceRolesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/device-roles/{id}/][%d] dcimDeviceRolesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceRolesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeviceRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_create_parameters.go new file mode 100644 index 0000000..731ca3f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimDeviceTypesCreateParams creates a new DcimDeviceTypesCreateParams object +// with the default values initialized. +func NewDcimDeviceTypesCreateParams() *DcimDeviceTypesCreateParams { + var () + return &DcimDeviceTypesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceTypesCreateParamsWithTimeout creates a new DcimDeviceTypesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceTypesCreateParamsWithTimeout(timeout time.Duration) *DcimDeviceTypesCreateParams { + var () + return &DcimDeviceTypesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceTypesCreateParamsWithContext creates a new DcimDeviceTypesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceTypesCreateParamsWithContext(ctx context.Context) *DcimDeviceTypesCreateParams { + var () + return &DcimDeviceTypesCreateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceTypesCreateParamsWithHTTPClient creates a new DcimDeviceTypesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceTypesCreateParamsWithHTTPClient(client *http.Client) *DcimDeviceTypesCreateParams { + var () + return &DcimDeviceTypesCreateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceTypesCreateParams contains all the parameters to send to the API endpoint +for the dcim device types create operation typically these are written to a http.Request +*/ +type DcimDeviceTypesCreateParams struct { + + /*Data*/ + Data *models.WritableDeviceType + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device types create params +func (o *DcimDeviceTypesCreateParams) WithTimeout(timeout time.Duration) *DcimDeviceTypesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device types create params +func (o *DcimDeviceTypesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device types create params +func (o *DcimDeviceTypesCreateParams) WithContext(ctx context.Context) *DcimDeviceTypesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device types create params +func (o *DcimDeviceTypesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device types create params +func (o *DcimDeviceTypesCreateParams) WithHTTPClient(client *http.Client) *DcimDeviceTypesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device types create params +func (o *DcimDeviceTypesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device types create params +func (o *DcimDeviceTypesCreateParams) WithData(data *models.WritableDeviceType) *DcimDeviceTypesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device types create params +func (o *DcimDeviceTypesCreateParams) SetData(data *models.WritableDeviceType) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceTypesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_create_responses.go new file mode 100644 index 0000000..6d99a6e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceTypesCreateReader is a Reader for the DcimDeviceTypesCreate structure. +type DcimDeviceTypesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceTypesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimDeviceTypesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceTypesCreateCreated creates a DcimDeviceTypesCreateCreated with default headers values +func NewDcimDeviceTypesCreateCreated() *DcimDeviceTypesCreateCreated { + return &DcimDeviceTypesCreateCreated{} +} + +/*DcimDeviceTypesCreateCreated handles this case with default header values. + +DcimDeviceTypesCreateCreated dcim device types create created +*/ +type DcimDeviceTypesCreateCreated struct { + Payload *models.WritableDeviceType +} + +func (o *DcimDeviceTypesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/device-types/][%d] dcimDeviceTypesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimDeviceTypesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_delete_parameters.go new file mode 100644 index 0000000..94e1e7e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimDeviceTypesDeleteParams creates a new DcimDeviceTypesDeleteParams object +// with the default values initialized. +func NewDcimDeviceTypesDeleteParams() *DcimDeviceTypesDeleteParams { + var () + return &DcimDeviceTypesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceTypesDeleteParamsWithTimeout creates a new DcimDeviceTypesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceTypesDeleteParamsWithTimeout(timeout time.Duration) *DcimDeviceTypesDeleteParams { + var () + return &DcimDeviceTypesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceTypesDeleteParamsWithContext creates a new DcimDeviceTypesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceTypesDeleteParamsWithContext(ctx context.Context) *DcimDeviceTypesDeleteParams { + var () + return &DcimDeviceTypesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimDeviceTypesDeleteParamsWithHTTPClient creates a new DcimDeviceTypesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceTypesDeleteParamsWithHTTPClient(client *http.Client) *DcimDeviceTypesDeleteParams { + var () + return &DcimDeviceTypesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimDeviceTypesDeleteParams contains all the parameters to send to the API endpoint +for the dcim device types delete operation typically these are written to a http.Request +*/ +type DcimDeviceTypesDeleteParams struct { + + /*ID + A unique integer value identifying this device type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device types delete params +func (o *DcimDeviceTypesDeleteParams) WithTimeout(timeout time.Duration) *DcimDeviceTypesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device types delete params +func (o *DcimDeviceTypesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device types delete params +func (o *DcimDeviceTypesDeleteParams) WithContext(ctx context.Context) *DcimDeviceTypesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device types delete params +func (o *DcimDeviceTypesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device types delete params +func (o *DcimDeviceTypesDeleteParams) WithHTTPClient(client *http.Client) *DcimDeviceTypesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device types delete params +func (o *DcimDeviceTypesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim device types delete params +func (o *DcimDeviceTypesDeleteParams) WithID(id int64) *DcimDeviceTypesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device types delete params +func (o *DcimDeviceTypesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceTypesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_delete_responses.go new file mode 100644 index 0000000..f102108 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimDeviceTypesDeleteReader is a Reader for the DcimDeviceTypesDelete structure. +type DcimDeviceTypesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceTypesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimDeviceTypesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceTypesDeleteNoContent creates a DcimDeviceTypesDeleteNoContent with default headers values +func NewDcimDeviceTypesDeleteNoContent() *DcimDeviceTypesDeleteNoContent { + return &DcimDeviceTypesDeleteNoContent{} +} + +/*DcimDeviceTypesDeleteNoContent handles this case with default header values. + +DcimDeviceTypesDeleteNoContent dcim device types delete no content +*/ +type DcimDeviceTypesDeleteNoContent struct { +} + +func (o *DcimDeviceTypesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/device-types/{id}/][%d] dcimDeviceTypesDeleteNoContent ", 204) +} + +func (o *DcimDeviceTypesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_list_parameters.go new file mode 100644 index 0000000..fe8a877 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_list_parameters.go @@ -0,0 +1,575 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimDeviceTypesListParams creates a new DcimDeviceTypesListParams object +// with the default values initialized. +func NewDcimDeviceTypesListParams() *DcimDeviceTypesListParams { + var () + return &DcimDeviceTypesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceTypesListParamsWithTimeout creates a new DcimDeviceTypesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceTypesListParamsWithTimeout(timeout time.Duration) *DcimDeviceTypesListParams { + var () + return &DcimDeviceTypesListParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceTypesListParamsWithContext creates a new DcimDeviceTypesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceTypesListParamsWithContext(ctx context.Context) *DcimDeviceTypesListParams { + var () + return &DcimDeviceTypesListParams{ + + Context: ctx, + } +} + +// NewDcimDeviceTypesListParamsWithHTTPClient creates a new DcimDeviceTypesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceTypesListParamsWithHTTPClient(client *http.Client) *DcimDeviceTypesListParams { + var () + return &DcimDeviceTypesListParams{ + HTTPClient: client, + } +} + +/*DcimDeviceTypesListParams contains all the parameters to send to the API endpoint +for the dcim device types list operation typically these are written to a http.Request +*/ +type DcimDeviceTypesListParams struct { + + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*IsConsoleServer*/ + IsConsoleServer *string + /*IsFullDepth*/ + IsFullDepth *string + /*IsNetworkDevice*/ + IsNetworkDevice *string + /*IsPdu*/ + IsPdu *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Manufacturer*/ + Manufacturer *string + /*ManufacturerID*/ + ManufacturerID *string + /*Model*/ + Model *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*PartNumber*/ + PartNumber *string + /*Q*/ + Q *string + /*Slug*/ + Slug *string + /*SubdeviceRole*/ + SubdeviceRole *string + /*UHeight*/ + UHeight *float64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithTimeout(timeout time.Duration) *DcimDeviceTypesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithContext(ctx context.Context) *DcimDeviceTypesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithHTTPClient(client *http.Client) *DcimDeviceTypesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIDIn adds the iDIn to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithIDIn(iDIn *string) *DcimDeviceTypesListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithIsConsoleServer adds the isConsoleServer to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithIsConsoleServer(isConsoleServer *string) *DcimDeviceTypesListParams { + o.SetIsConsoleServer(isConsoleServer) + return o +} + +// SetIsConsoleServer adds the isConsoleServer to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetIsConsoleServer(isConsoleServer *string) { + o.IsConsoleServer = isConsoleServer +} + +// WithIsFullDepth adds the isFullDepth to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithIsFullDepth(isFullDepth *string) *DcimDeviceTypesListParams { + o.SetIsFullDepth(isFullDepth) + return o +} + +// SetIsFullDepth adds the isFullDepth to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetIsFullDepth(isFullDepth *string) { + o.IsFullDepth = isFullDepth +} + +// WithIsNetworkDevice adds the isNetworkDevice to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithIsNetworkDevice(isNetworkDevice *string) *DcimDeviceTypesListParams { + o.SetIsNetworkDevice(isNetworkDevice) + return o +} + +// SetIsNetworkDevice adds the isNetworkDevice to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetIsNetworkDevice(isNetworkDevice *string) { + o.IsNetworkDevice = isNetworkDevice +} + +// WithIsPdu adds the isPdu to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithIsPdu(isPdu *string) *DcimDeviceTypesListParams { + o.SetIsPdu(isPdu) + return o +} + +// SetIsPdu adds the isPdu to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetIsPdu(isPdu *string) { + o.IsPdu = isPdu +} + +// WithLimit adds the limit to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithLimit(limit *int64) *DcimDeviceTypesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithManufacturer adds the manufacturer to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithManufacturer(manufacturer *string) *DcimDeviceTypesListParams { + o.SetManufacturer(manufacturer) + return o +} + +// SetManufacturer adds the manufacturer to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetManufacturer(manufacturer *string) { + o.Manufacturer = manufacturer +} + +// WithManufacturerID adds the manufacturerID to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithManufacturerID(manufacturerID *string) *DcimDeviceTypesListParams { + o.SetManufacturerID(manufacturerID) + return o +} + +// SetManufacturerID adds the manufacturerId to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetManufacturerID(manufacturerID *string) { + o.ManufacturerID = manufacturerID +} + +// WithModel adds the model to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithModel(model *string) *DcimDeviceTypesListParams { + o.SetModel(model) + return o +} + +// SetModel adds the model to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetModel(model *string) { + o.Model = model +} + +// WithOffset adds the offset to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithOffset(offset *int64) *DcimDeviceTypesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPartNumber adds the partNumber to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithPartNumber(partNumber *string) *DcimDeviceTypesListParams { + o.SetPartNumber(partNumber) + return o +} + +// SetPartNumber adds the partNumber to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetPartNumber(partNumber *string) { + o.PartNumber = partNumber +} + +// WithQ adds the q to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithQ(q *string) *DcimDeviceTypesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetQ(q *string) { + o.Q = q +} + +// WithSlug adds the slug to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithSlug(slug *string) *DcimDeviceTypesListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WithSubdeviceRole adds the subdeviceRole to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithSubdeviceRole(subdeviceRole *string) *DcimDeviceTypesListParams { + o.SetSubdeviceRole(subdeviceRole) + return o +} + +// SetSubdeviceRole adds the subdeviceRole to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetSubdeviceRole(subdeviceRole *string) { + o.SubdeviceRole = subdeviceRole +} + +// WithUHeight adds the uHeight to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithUHeight(uHeight *float64) *DcimDeviceTypesListParams { + o.SetUHeight(uHeight) + return o +} + +// SetUHeight adds the uHeight to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetUHeight(uHeight *float64) { + o.UHeight = uHeight +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceTypesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.IsConsoleServer != nil { + + // query param is_console_server + var qrIsConsoleServer string + if o.IsConsoleServer != nil { + qrIsConsoleServer = *o.IsConsoleServer + } + qIsConsoleServer := qrIsConsoleServer + if qIsConsoleServer != "" { + if err := r.SetQueryParam("is_console_server", qIsConsoleServer); err != nil { + return err + } + } + + } + + if o.IsFullDepth != nil { + + // query param is_full_depth + var qrIsFullDepth string + if o.IsFullDepth != nil { + qrIsFullDepth = *o.IsFullDepth + } + qIsFullDepth := qrIsFullDepth + if qIsFullDepth != "" { + if err := r.SetQueryParam("is_full_depth", qIsFullDepth); err != nil { + return err + } + } + + } + + if o.IsNetworkDevice != nil { + + // query param is_network_device + var qrIsNetworkDevice string + if o.IsNetworkDevice != nil { + qrIsNetworkDevice = *o.IsNetworkDevice + } + qIsNetworkDevice := qrIsNetworkDevice + if qIsNetworkDevice != "" { + if err := r.SetQueryParam("is_network_device", qIsNetworkDevice); err != nil { + return err + } + } + + } + + if o.IsPdu != nil { + + // query param is_pdu + var qrIsPdu string + if o.IsPdu != nil { + qrIsPdu = *o.IsPdu + } + qIsPdu := qrIsPdu + if qIsPdu != "" { + if err := r.SetQueryParam("is_pdu", qIsPdu); 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.Manufacturer != nil { + + // query param manufacturer + var qrManufacturer string + if o.Manufacturer != nil { + qrManufacturer = *o.Manufacturer + } + qManufacturer := qrManufacturer + if qManufacturer != "" { + if err := r.SetQueryParam("manufacturer", qManufacturer); err != nil { + return err + } + } + + } + + if o.ManufacturerID != nil { + + // query param manufacturer_id + var qrManufacturerID string + if o.ManufacturerID != nil { + qrManufacturerID = *o.ManufacturerID + } + qManufacturerID := qrManufacturerID + if qManufacturerID != "" { + if err := r.SetQueryParam("manufacturer_id", qManufacturerID); err != nil { + return err + } + } + + } + + if o.Model != nil { + + // query param model + var qrModel string + if o.Model != nil { + qrModel = *o.Model + } + qModel := qrModel + if qModel != "" { + if err := r.SetQueryParam("model", qModel); 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.PartNumber != nil { + + // query param part_number + var qrPartNumber string + if o.PartNumber != nil { + qrPartNumber = *o.PartNumber + } + qPartNumber := qrPartNumber + if qPartNumber != "" { + if err := r.SetQueryParam("part_number", qPartNumber); 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.SubdeviceRole != nil { + + // query param subdevice_role + var qrSubdeviceRole string + if o.SubdeviceRole != nil { + qrSubdeviceRole = *o.SubdeviceRole + } + qSubdeviceRole := qrSubdeviceRole + if qSubdeviceRole != "" { + if err := r.SetQueryParam("subdevice_role", qSubdeviceRole); err != nil { + return err + } + } + + } + + if o.UHeight != nil { + + // query param u_height + var qrUHeight float64 + if o.UHeight != nil { + qrUHeight = *o.UHeight + } + qUHeight := swag.FormatFloat64(qrUHeight) + if qUHeight != "" { + if err := r.SetQueryParam("u_height", qUHeight); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_list_responses.go new file mode 100644 index 0000000..29254ff --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceTypesListReader is a Reader for the DcimDeviceTypesList structure. +type DcimDeviceTypesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceTypesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceTypesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceTypesListOK creates a DcimDeviceTypesListOK with default headers values +func NewDcimDeviceTypesListOK() *DcimDeviceTypesListOK { + return &DcimDeviceTypesListOK{} +} + +/*DcimDeviceTypesListOK handles this case with default header values. + +DcimDeviceTypesListOK dcim device types list o k +*/ +type DcimDeviceTypesListOK struct { + Payload *models.DcimDeviceTypesListOKBody +} + +func (o *DcimDeviceTypesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/device-types/][%d] dcimDeviceTypesListOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceTypesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimDeviceTypesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_partial_update_parameters.go new file mode 100644 index 0000000..bec757c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimDeviceTypesPartialUpdateParams creates a new DcimDeviceTypesPartialUpdateParams object +// with the default values initialized. +func NewDcimDeviceTypesPartialUpdateParams() *DcimDeviceTypesPartialUpdateParams { + var () + return &DcimDeviceTypesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceTypesPartialUpdateParamsWithTimeout creates a new DcimDeviceTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceTypesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimDeviceTypesPartialUpdateParams { + var () + return &DcimDeviceTypesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceTypesPartialUpdateParamsWithContext creates a new DcimDeviceTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceTypesPartialUpdateParamsWithContext(ctx context.Context) *DcimDeviceTypesPartialUpdateParams { + var () + return &DcimDeviceTypesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceTypesPartialUpdateParamsWithHTTPClient creates a new DcimDeviceTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceTypesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimDeviceTypesPartialUpdateParams { + var () + return &DcimDeviceTypesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceTypesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim device types partial update operation typically these are written to a http.Request +*/ +type DcimDeviceTypesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableDeviceType + /*ID + A unique integer value identifying this device type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimDeviceTypesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) WithContext(ctx context.Context) *DcimDeviceTypesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimDeviceTypesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) WithData(data *models.WritableDeviceType) *DcimDeviceTypesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) SetData(data *models.WritableDeviceType) { + o.Data = data +} + +// WithID adds the id to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) WithID(id int64) *DcimDeviceTypesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceTypesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_partial_update_responses.go new file mode 100644 index 0000000..ac54b2a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceTypesPartialUpdateReader is a Reader for the DcimDeviceTypesPartialUpdate structure. +type DcimDeviceTypesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceTypesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceTypesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceTypesPartialUpdateOK creates a DcimDeviceTypesPartialUpdateOK with default headers values +func NewDcimDeviceTypesPartialUpdateOK() *DcimDeviceTypesPartialUpdateOK { + return &DcimDeviceTypesPartialUpdateOK{} +} + +/*DcimDeviceTypesPartialUpdateOK handles this case with default header values. + +DcimDeviceTypesPartialUpdateOK dcim device types partial update o k +*/ +type DcimDeviceTypesPartialUpdateOK struct { + Payload *models.WritableDeviceType +} + +func (o *DcimDeviceTypesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/device-types/{id}/][%d] dcimDeviceTypesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceTypesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_read_parameters.go new file mode 100644 index 0000000..e96e83f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimDeviceTypesReadParams creates a new DcimDeviceTypesReadParams object +// with the default values initialized. +func NewDcimDeviceTypesReadParams() *DcimDeviceTypesReadParams { + var () + return &DcimDeviceTypesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceTypesReadParamsWithTimeout creates a new DcimDeviceTypesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceTypesReadParamsWithTimeout(timeout time.Duration) *DcimDeviceTypesReadParams { + var () + return &DcimDeviceTypesReadParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceTypesReadParamsWithContext creates a new DcimDeviceTypesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceTypesReadParamsWithContext(ctx context.Context) *DcimDeviceTypesReadParams { + var () + return &DcimDeviceTypesReadParams{ + + Context: ctx, + } +} + +// NewDcimDeviceTypesReadParamsWithHTTPClient creates a new DcimDeviceTypesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceTypesReadParamsWithHTTPClient(client *http.Client) *DcimDeviceTypesReadParams { + var () + return &DcimDeviceTypesReadParams{ + HTTPClient: client, + } +} + +/*DcimDeviceTypesReadParams contains all the parameters to send to the API endpoint +for the dcim device types read operation typically these are written to a http.Request +*/ +type DcimDeviceTypesReadParams struct { + + /*ID + A unique integer value identifying this device type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device types read params +func (o *DcimDeviceTypesReadParams) WithTimeout(timeout time.Duration) *DcimDeviceTypesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device types read params +func (o *DcimDeviceTypesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device types read params +func (o *DcimDeviceTypesReadParams) WithContext(ctx context.Context) *DcimDeviceTypesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device types read params +func (o *DcimDeviceTypesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device types read params +func (o *DcimDeviceTypesReadParams) WithHTTPClient(client *http.Client) *DcimDeviceTypesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device types read params +func (o *DcimDeviceTypesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim device types read params +func (o *DcimDeviceTypesReadParams) WithID(id int64) *DcimDeviceTypesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device types read params +func (o *DcimDeviceTypesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceTypesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_read_responses.go new file mode 100644 index 0000000..0269f0b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceTypesReadReader is a Reader for the DcimDeviceTypesRead structure. +type DcimDeviceTypesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceTypesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceTypesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceTypesReadOK creates a DcimDeviceTypesReadOK with default headers values +func NewDcimDeviceTypesReadOK() *DcimDeviceTypesReadOK { + return &DcimDeviceTypesReadOK{} +} + +/*DcimDeviceTypesReadOK handles this case with default header values. + +DcimDeviceTypesReadOK dcim device types read o k +*/ +type DcimDeviceTypesReadOK struct { + Payload *models.DeviceType +} + +func (o *DcimDeviceTypesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/device-types/{id}/][%d] dcimDeviceTypesReadOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceTypesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeviceType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_update_parameters.go new file mode 100644 index 0000000..f6d8d64 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimDeviceTypesUpdateParams creates a new DcimDeviceTypesUpdateParams object +// with the default values initialized. +func NewDcimDeviceTypesUpdateParams() *DcimDeviceTypesUpdateParams { + var () + return &DcimDeviceTypesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceTypesUpdateParamsWithTimeout creates a new DcimDeviceTypesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceTypesUpdateParamsWithTimeout(timeout time.Duration) *DcimDeviceTypesUpdateParams { + var () + return &DcimDeviceTypesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceTypesUpdateParamsWithContext creates a new DcimDeviceTypesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceTypesUpdateParamsWithContext(ctx context.Context) *DcimDeviceTypesUpdateParams { + var () + return &DcimDeviceTypesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceTypesUpdateParamsWithHTTPClient creates a new DcimDeviceTypesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceTypesUpdateParamsWithHTTPClient(client *http.Client) *DcimDeviceTypesUpdateParams { + var () + return &DcimDeviceTypesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceTypesUpdateParams contains all the parameters to send to the API endpoint +for the dcim device types update operation typically these are written to a http.Request +*/ +type DcimDeviceTypesUpdateParams struct { + + /*Data*/ + Data *models.WritableDeviceType + /*ID + A unique integer value identifying this device type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) WithTimeout(timeout time.Duration) *DcimDeviceTypesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) WithContext(ctx context.Context) *DcimDeviceTypesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) WithHTTPClient(client *http.Client) *DcimDeviceTypesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) WithData(data *models.WritableDeviceType) *DcimDeviceTypesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) SetData(data *models.WritableDeviceType) { + o.Data = data +} + +// WithID adds the id to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) WithID(id int64) *DcimDeviceTypesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceTypesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_update_responses.go new file mode 100644 index 0000000..00df505 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_device_types_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDeviceTypesUpdateReader is a Reader for the DcimDeviceTypesUpdate structure. +type DcimDeviceTypesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceTypesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceTypesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDeviceTypesUpdateOK creates a DcimDeviceTypesUpdateOK with default headers values +func NewDcimDeviceTypesUpdateOK() *DcimDeviceTypesUpdateOK { + return &DcimDeviceTypesUpdateOK{} +} + +/*DcimDeviceTypesUpdateOK handles this case with default header values. + +DcimDeviceTypesUpdateOK dcim device types update o k +*/ +type DcimDeviceTypesUpdateOK struct { + Payload *models.WritableDeviceType +} + +func (o *DcimDeviceTypesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/device-types/{id}/][%d] dcimDeviceTypesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceTypesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_create_parameters.go new file mode 100644 index 0000000..6385b3b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimDevicesCreateParams creates a new DcimDevicesCreateParams object +// with the default values initialized. +func NewDcimDevicesCreateParams() *DcimDevicesCreateParams { + var () + return &DcimDevicesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDevicesCreateParamsWithTimeout creates a new DcimDevicesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDevicesCreateParamsWithTimeout(timeout time.Duration) *DcimDevicesCreateParams { + var () + return &DcimDevicesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimDevicesCreateParamsWithContext creates a new DcimDevicesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDevicesCreateParamsWithContext(ctx context.Context) *DcimDevicesCreateParams { + var () + return &DcimDevicesCreateParams{ + + Context: ctx, + } +} + +// NewDcimDevicesCreateParamsWithHTTPClient creates a new DcimDevicesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDevicesCreateParamsWithHTTPClient(client *http.Client) *DcimDevicesCreateParams { + var () + return &DcimDevicesCreateParams{ + HTTPClient: client, + } +} + +/*DcimDevicesCreateParams contains all the parameters to send to the API endpoint +for the dcim devices create operation typically these are written to a http.Request +*/ +type DcimDevicesCreateParams struct { + + /*Data*/ + Data *models.WritableDevice + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim devices create params +func (o *DcimDevicesCreateParams) WithTimeout(timeout time.Duration) *DcimDevicesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim devices create params +func (o *DcimDevicesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim devices create params +func (o *DcimDevicesCreateParams) WithContext(ctx context.Context) *DcimDevicesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim devices create params +func (o *DcimDevicesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim devices create params +func (o *DcimDevicesCreateParams) WithHTTPClient(client *http.Client) *DcimDevicesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim devices create params +func (o *DcimDevicesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim devices create params +func (o *DcimDevicesCreateParams) WithData(data *models.WritableDevice) *DcimDevicesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim devices create params +func (o *DcimDevicesCreateParams) SetData(data *models.WritableDevice) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDevicesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_create_responses.go new file mode 100644 index 0000000..5af4938 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDevicesCreateReader is a Reader for the DcimDevicesCreate structure. +type DcimDevicesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDevicesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimDevicesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDevicesCreateCreated creates a DcimDevicesCreateCreated with default headers values +func NewDcimDevicesCreateCreated() *DcimDevicesCreateCreated { + return &DcimDevicesCreateCreated{} +} + +/*DcimDevicesCreateCreated handles this case with default header values. + +DcimDevicesCreateCreated dcim devices create created +*/ +type DcimDevicesCreateCreated struct { + Payload *models.WritableDevice +} + +func (o *DcimDevicesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/devices/][%d] dcimDevicesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimDevicesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDevice) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_delete_parameters.go new file mode 100644 index 0000000..0ad70d7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimDevicesDeleteParams creates a new DcimDevicesDeleteParams object +// with the default values initialized. +func NewDcimDevicesDeleteParams() *DcimDevicesDeleteParams { + var () + return &DcimDevicesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDevicesDeleteParamsWithTimeout creates a new DcimDevicesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDevicesDeleteParamsWithTimeout(timeout time.Duration) *DcimDevicesDeleteParams { + var () + return &DcimDevicesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimDevicesDeleteParamsWithContext creates a new DcimDevicesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDevicesDeleteParamsWithContext(ctx context.Context) *DcimDevicesDeleteParams { + var () + return &DcimDevicesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimDevicesDeleteParamsWithHTTPClient creates a new DcimDevicesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDevicesDeleteParamsWithHTTPClient(client *http.Client) *DcimDevicesDeleteParams { + var () + return &DcimDevicesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimDevicesDeleteParams contains all the parameters to send to the API endpoint +for the dcim devices delete operation typically these are written to a http.Request +*/ +type DcimDevicesDeleteParams struct { + + /*ID + A unique integer value identifying this device. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim devices delete params +func (o *DcimDevicesDeleteParams) WithTimeout(timeout time.Duration) *DcimDevicesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim devices delete params +func (o *DcimDevicesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim devices delete params +func (o *DcimDevicesDeleteParams) WithContext(ctx context.Context) *DcimDevicesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim devices delete params +func (o *DcimDevicesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim devices delete params +func (o *DcimDevicesDeleteParams) WithHTTPClient(client *http.Client) *DcimDevicesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim devices delete params +func (o *DcimDevicesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim devices delete params +func (o *DcimDevicesDeleteParams) WithID(id int64) *DcimDevicesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim devices delete params +func (o *DcimDevicesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDevicesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_delete_responses.go new file mode 100644 index 0000000..1f2727f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimDevicesDeleteReader is a Reader for the DcimDevicesDelete structure. +type DcimDevicesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDevicesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimDevicesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDevicesDeleteNoContent creates a DcimDevicesDeleteNoContent with default headers values +func NewDcimDevicesDeleteNoContent() *DcimDevicesDeleteNoContent { + return &DcimDevicesDeleteNoContent{} +} + +/*DcimDevicesDeleteNoContent handles this case with default header values. + +DcimDevicesDeleteNoContent dcim devices delete no content +*/ +type DcimDevicesDeleteNoContent struct { +} + +func (o *DcimDevicesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/devices/{id}/][%d] dcimDevicesDeleteNoContent ", 204) +} + +func (o *DcimDevicesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_list_parameters.go new file mode 100644 index 0000000..7e18af8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_list_parameters.go @@ -0,0 +1,1039 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimDevicesListParams creates a new DcimDevicesListParams object +// with the default values initialized. +func NewDcimDevicesListParams() *DcimDevicesListParams { + var () + return &DcimDevicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDevicesListParamsWithTimeout creates a new DcimDevicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDevicesListParamsWithTimeout(timeout time.Duration) *DcimDevicesListParams { + var () + return &DcimDevicesListParams{ + + timeout: timeout, + } +} + +// NewDcimDevicesListParamsWithContext creates a new DcimDevicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDevicesListParamsWithContext(ctx context.Context) *DcimDevicesListParams { + var () + return &DcimDevicesListParams{ + + Context: ctx, + } +} + +// NewDcimDevicesListParamsWithHTTPClient creates a new DcimDevicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDevicesListParamsWithHTTPClient(client *http.Client) *DcimDevicesListParams { + var () + return &DcimDevicesListParams{ + HTTPClient: client, + } +} + +/*DcimDevicesListParams contains all the parameters to send to the API endpoint +for the dcim devices list operation typically these are written to a http.Request +*/ +type DcimDevicesListParams struct { + + /*AssetTag*/ + AssetTag *string + /*ClusterID*/ + ClusterID *string + /*DeviceTypeID*/ + DeviceTypeID *string + /*HasPrimaryIP*/ + HasPrimaryIP *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*IsConsoleServer*/ + IsConsoleServer *string + /*IsFullDepth*/ + IsFullDepth *string + /*IsNetworkDevice*/ + IsNetworkDevice *string + /*IsPdu*/ + IsPdu *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*MacAddress*/ + MacAddress *string + /*Manufacturer*/ + Manufacturer *string + /*ManufacturerID*/ + ManufacturerID *string + /*Model*/ + Model *string + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Platform*/ + Platform *string + /*PlatformID*/ + PlatformID *string + /*Position*/ + Position *float64 + /*Q*/ + Q *string + /*RackGroupID*/ + RackGroupID *string + /*RackID*/ + RackID *string + /*Role*/ + Role *string + /*RoleID*/ + RoleID *string + /*Serial*/ + Serial *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Status*/ + Status *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + /*VirtualChassisID*/ + VirtualChassisID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim devices list params +func (o *DcimDevicesListParams) WithTimeout(timeout time.Duration) *DcimDevicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim devices list params +func (o *DcimDevicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim devices list params +func (o *DcimDevicesListParams) WithContext(ctx context.Context) *DcimDevicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim devices list params +func (o *DcimDevicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim devices list params +func (o *DcimDevicesListParams) WithHTTPClient(client *http.Client) *DcimDevicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim devices list params +func (o *DcimDevicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAssetTag adds the assetTag to the dcim devices list params +func (o *DcimDevicesListParams) WithAssetTag(assetTag *string) *DcimDevicesListParams { + o.SetAssetTag(assetTag) + return o +} + +// SetAssetTag adds the assetTag to the dcim devices list params +func (o *DcimDevicesListParams) SetAssetTag(assetTag *string) { + o.AssetTag = assetTag +} + +// WithClusterID adds the clusterID to the dcim devices list params +func (o *DcimDevicesListParams) WithClusterID(clusterID *string) *DcimDevicesListParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the dcim devices list params +func (o *DcimDevicesListParams) SetClusterID(clusterID *string) { + o.ClusterID = clusterID +} + +// WithDeviceTypeID adds the deviceTypeID to the dcim devices list params +func (o *DcimDevicesListParams) WithDeviceTypeID(deviceTypeID *string) *DcimDevicesListParams { + o.SetDeviceTypeID(deviceTypeID) + return o +} + +// SetDeviceTypeID adds the deviceTypeId to the dcim devices list params +func (o *DcimDevicesListParams) SetDeviceTypeID(deviceTypeID *string) { + o.DeviceTypeID = deviceTypeID +} + +// WithHasPrimaryIP adds the hasPrimaryIP to the dcim devices list params +func (o *DcimDevicesListParams) WithHasPrimaryIP(hasPrimaryIP *string) *DcimDevicesListParams { + o.SetHasPrimaryIP(hasPrimaryIP) + return o +} + +// SetHasPrimaryIP adds the hasPrimaryIp to the dcim devices list params +func (o *DcimDevicesListParams) SetHasPrimaryIP(hasPrimaryIP *string) { + o.HasPrimaryIP = hasPrimaryIP +} + +// WithIDIn adds the iDIn to the dcim devices list params +func (o *DcimDevicesListParams) WithIDIn(iDIn *string) *DcimDevicesListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the dcim devices list params +func (o *DcimDevicesListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithIsConsoleServer adds the isConsoleServer to the dcim devices list params +func (o *DcimDevicesListParams) WithIsConsoleServer(isConsoleServer *string) *DcimDevicesListParams { + o.SetIsConsoleServer(isConsoleServer) + return o +} + +// SetIsConsoleServer adds the isConsoleServer to the dcim devices list params +func (o *DcimDevicesListParams) SetIsConsoleServer(isConsoleServer *string) { + o.IsConsoleServer = isConsoleServer +} + +// WithIsFullDepth adds the isFullDepth to the dcim devices list params +func (o *DcimDevicesListParams) WithIsFullDepth(isFullDepth *string) *DcimDevicesListParams { + o.SetIsFullDepth(isFullDepth) + return o +} + +// SetIsFullDepth adds the isFullDepth to the dcim devices list params +func (o *DcimDevicesListParams) SetIsFullDepth(isFullDepth *string) { + o.IsFullDepth = isFullDepth +} + +// WithIsNetworkDevice adds the isNetworkDevice to the dcim devices list params +func (o *DcimDevicesListParams) WithIsNetworkDevice(isNetworkDevice *string) *DcimDevicesListParams { + o.SetIsNetworkDevice(isNetworkDevice) + return o +} + +// SetIsNetworkDevice adds the isNetworkDevice to the dcim devices list params +func (o *DcimDevicesListParams) SetIsNetworkDevice(isNetworkDevice *string) { + o.IsNetworkDevice = isNetworkDevice +} + +// WithIsPdu adds the isPdu to the dcim devices list params +func (o *DcimDevicesListParams) WithIsPdu(isPdu *string) *DcimDevicesListParams { + o.SetIsPdu(isPdu) + return o +} + +// SetIsPdu adds the isPdu to the dcim devices list params +func (o *DcimDevicesListParams) SetIsPdu(isPdu *string) { + o.IsPdu = isPdu +} + +// WithLimit adds the limit to the dcim devices list params +func (o *DcimDevicesListParams) WithLimit(limit *int64) *DcimDevicesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim devices list params +func (o *DcimDevicesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithMacAddress adds the macAddress to the dcim devices list params +func (o *DcimDevicesListParams) WithMacAddress(macAddress *string) *DcimDevicesListParams { + o.SetMacAddress(macAddress) + return o +} + +// SetMacAddress adds the macAddress to the dcim devices list params +func (o *DcimDevicesListParams) SetMacAddress(macAddress *string) { + o.MacAddress = macAddress +} + +// WithManufacturer adds the manufacturer to the dcim devices list params +func (o *DcimDevicesListParams) WithManufacturer(manufacturer *string) *DcimDevicesListParams { + o.SetManufacturer(manufacturer) + return o +} + +// SetManufacturer adds the manufacturer to the dcim devices list params +func (o *DcimDevicesListParams) SetManufacturer(manufacturer *string) { + o.Manufacturer = manufacturer +} + +// WithManufacturerID adds the manufacturerID to the dcim devices list params +func (o *DcimDevicesListParams) WithManufacturerID(manufacturerID *string) *DcimDevicesListParams { + o.SetManufacturerID(manufacturerID) + return o +} + +// SetManufacturerID adds the manufacturerId to the dcim devices list params +func (o *DcimDevicesListParams) SetManufacturerID(manufacturerID *string) { + o.ManufacturerID = manufacturerID +} + +// WithModel adds the model to the dcim devices list params +func (o *DcimDevicesListParams) WithModel(model *string) *DcimDevicesListParams { + o.SetModel(model) + return o +} + +// SetModel adds the model to the dcim devices list params +func (o *DcimDevicesListParams) SetModel(model *string) { + o.Model = model +} + +// WithName adds the name to the dcim devices list params +func (o *DcimDevicesListParams) WithName(name *string) *DcimDevicesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim devices list params +func (o *DcimDevicesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim devices list params +func (o *DcimDevicesListParams) WithOffset(offset *int64) *DcimDevicesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim devices list params +func (o *DcimDevicesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPlatform adds the platform to the dcim devices list params +func (o *DcimDevicesListParams) WithPlatform(platform *string) *DcimDevicesListParams { + o.SetPlatform(platform) + return o +} + +// SetPlatform adds the platform to the dcim devices list params +func (o *DcimDevicesListParams) SetPlatform(platform *string) { + o.Platform = platform +} + +// WithPlatformID adds the platformID to the dcim devices list params +func (o *DcimDevicesListParams) WithPlatformID(platformID *string) *DcimDevicesListParams { + o.SetPlatformID(platformID) + return o +} + +// SetPlatformID adds the platformId to the dcim devices list params +func (o *DcimDevicesListParams) SetPlatformID(platformID *string) { + o.PlatformID = platformID +} + +// WithPosition adds the position to the dcim devices list params +func (o *DcimDevicesListParams) WithPosition(position *float64) *DcimDevicesListParams { + o.SetPosition(position) + return o +} + +// SetPosition adds the position to the dcim devices list params +func (o *DcimDevicesListParams) SetPosition(position *float64) { + o.Position = position +} + +// WithQ adds the q to the dcim devices list params +func (o *DcimDevicesListParams) WithQ(q *string) *DcimDevicesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim devices list params +func (o *DcimDevicesListParams) SetQ(q *string) { + o.Q = q +} + +// WithRackGroupID adds the rackGroupID to the dcim devices list params +func (o *DcimDevicesListParams) WithRackGroupID(rackGroupID *string) *DcimDevicesListParams { + o.SetRackGroupID(rackGroupID) + return o +} + +// SetRackGroupID adds the rackGroupId to the dcim devices list params +func (o *DcimDevicesListParams) SetRackGroupID(rackGroupID *string) { + o.RackGroupID = rackGroupID +} + +// WithRackID adds the rackID to the dcim devices list params +func (o *DcimDevicesListParams) WithRackID(rackID *string) *DcimDevicesListParams { + o.SetRackID(rackID) + return o +} + +// SetRackID adds the rackId to the dcim devices list params +func (o *DcimDevicesListParams) SetRackID(rackID *string) { + o.RackID = rackID +} + +// WithRole adds the role to the dcim devices list params +func (o *DcimDevicesListParams) WithRole(role *string) *DcimDevicesListParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the dcim devices list params +func (o *DcimDevicesListParams) SetRole(role *string) { + o.Role = role +} + +// WithRoleID adds the roleID to the dcim devices list params +func (o *DcimDevicesListParams) WithRoleID(roleID *string) *DcimDevicesListParams { + o.SetRoleID(roleID) + return o +} + +// SetRoleID adds the roleId to the dcim devices list params +func (o *DcimDevicesListParams) SetRoleID(roleID *string) { + o.RoleID = roleID +} + +// WithSerial adds the serial to the dcim devices list params +func (o *DcimDevicesListParams) WithSerial(serial *string) *DcimDevicesListParams { + o.SetSerial(serial) + return o +} + +// SetSerial adds the serial to the dcim devices list params +func (o *DcimDevicesListParams) SetSerial(serial *string) { + o.Serial = serial +} + +// WithSite adds the site to the dcim devices list params +func (o *DcimDevicesListParams) WithSite(site *string) *DcimDevicesListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the dcim devices list params +func (o *DcimDevicesListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the dcim devices list params +func (o *DcimDevicesListParams) WithSiteID(siteID *string) *DcimDevicesListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the dcim devices list params +func (o *DcimDevicesListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithStatus adds the status to the dcim devices list params +func (o *DcimDevicesListParams) WithStatus(status *string) *DcimDevicesListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the dcim devices list params +func (o *DcimDevicesListParams) SetStatus(status *string) { + o.Status = status +} + +// WithTenant adds the tenant to the dcim devices list params +func (o *DcimDevicesListParams) WithTenant(tenant *string) *DcimDevicesListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the dcim devices list params +func (o *DcimDevicesListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the dcim devices list params +func (o *DcimDevicesListParams) WithTenantID(tenantID *string) *DcimDevicesListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the dcim devices list params +func (o *DcimDevicesListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WithVirtualChassisID adds the virtualChassisID to the dcim devices list params +func (o *DcimDevicesListParams) WithVirtualChassisID(virtualChassisID *string) *DcimDevicesListParams { + o.SetVirtualChassisID(virtualChassisID) + return o +} + +// SetVirtualChassisID adds the virtualChassisId to the dcim devices list params +func (o *DcimDevicesListParams) SetVirtualChassisID(virtualChassisID *string) { + o.VirtualChassisID = virtualChassisID +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AssetTag != nil { + + // query param asset_tag + var qrAssetTag string + if o.AssetTag != nil { + qrAssetTag = *o.AssetTag + } + qAssetTag := qrAssetTag + if qAssetTag != "" { + if err := r.SetQueryParam("asset_tag", qAssetTag); err != nil { + return err + } + } + + } + + if o.ClusterID != nil { + + // query param cluster_id + var qrClusterID string + if o.ClusterID != nil { + qrClusterID = *o.ClusterID + } + qClusterID := qrClusterID + if qClusterID != "" { + if err := r.SetQueryParam("cluster_id", qClusterID); err != nil { + return err + } + } + + } + + if o.DeviceTypeID != nil { + + // query param device_type_id + var qrDeviceTypeID string + if o.DeviceTypeID != nil { + qrDeviceTypeID = *o.DeviceTypeID + } + qDeviceTypeID := qrDeviceTypeID + if qDeviceTypeID != "" { + if err := r.SetQueryParam("device_type_id", qDeviceTypeID); err != nil { + return err + } + } + + } + + if o.HasPrimaryIP != nil { + + // query param has_primary_ip + var qrHasPrimaryIP string + if o.HasPrimaryIP != nil { + qrHasPrimaryIP = *o.HasPrimaryIP + } + qHasPrimaryIP := qrHasPrimaryIP + if qHasPrimaryIP != "" { + if err := r.SetQueryParam("has_primary_ip", qHasPrimaryIP); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.IsConsoleServer != nil { + + // query param is_console_server + var qrIsConsoleServer string + if o.IsConsoleServer != nil { + qrIsConsoleServer = *o.IsConsoleServer + } + qIsConsoleServer := qrIsConsoleServer + if qIsConsoleServer != "" { + if err := r.SetQueryParam("is_console_server", qIsConsoleServer); err != nil { + return err + } + } + + } + + if o.IsFullDepth != nil { + + // query param is_full_depth + var qrIsFullDepth string + if o.IsFullDepth != nil { + qrIsFullDepth = *o.IsFullDepth + } + qIsFullDepth := qrIsFullDepth + if qIsFullDepth != "" { + if err := r.SetQueryParam("is_full_depth", qIsFullDepth); err != nil { + return err + } + } + + } + + if o.IsNetworkDevice != nil { + + // query param is_network_device + var qrIsNetworkDevice string + if o.IsNetworkDevice != nil { + qrIsNetworkDevice = *o.IsNetworkDevice + } + qIsNetworkDevice := qrIsNetworkDevice + if qIsNetworkDevice != "" { + if err := r.SetQueryParam("is_network_device", qIsNetworkDevice); err != nil { + return err + } + } + + } + + if o.IsPdu != nil { + + // query param is_pdu + var qrIsPdu string + if o.IsPdu != nil { + qrIsPdu = *o.IsPdu + } + qIsPdu := qrIsPdu + if qIsPdu != "" { + if err := r.SetQueryParam("is_pdu", qIsPdu); 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.MacAddress != nil { + + // query param mac_address + var qrMacAddress string + if o.MacAddress != nil { + qrMacAddress = *o.MacAddress + } + qMacAddress := qrMacAddress + if qMacAddress != "" { + if err := r.SetQueryParam("mac_address", qMacAddress); err != nil { + return err + } + } + + } + + if o.Manufacturer != nil { + + // query param manufacturer + var qrManufacturer string + if o.Manufacturer != nil { + qrManufacturer = *o.Manufacturer + } + qManufacturer := qrManufacturer + if qManufacturer != "" { + if err := r.SetQueryParam("manufacturer", qManufacturer); err != nil { + return err + } + } + + } + + if o.ManufacturerID != nil { + + // query param manufacturer_id + var qrManufacturerID string + if o.ManufacturerID != nil { + qrManufacturerID = *o.ManufacturerID + } + qManufacturerID := qrManufacturerID + if qManufacturerID != "" { + if err := r.SetQueryParam("manufacturer_id", qManufacturerID); err != nil { + return err + } + } + + } + + if o.Model != nil { + + // query param model + var qrModel string + if o.Model != nil { + qrModel = *o.Model + } + qModel := qrModel + if qModel != "" { + if err := r.SetQueryParam("model", qModel); 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.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.Platform != nil { + + // query param platform + var qrPlatform string + if o.Platform != nil { + qrPlatform = *o.Platform + } + qPlatform := qrPlatform + if qPlatform != "" { + if err := r.SetQueryParam("platform", qPlatform); err != nil { + return err + } + } + + } + + if o.PlatformID != nil { + + // query param platform_id + var qrPlatformID string + if o.PlatformID != nil { + qrPlatformID = *o.PlatformID + } + qPlatformID := qrPlatformID + if qPlatformID != "" { + if err := r.SetQueryParam("platform_id", qPlatformID); err != nil { + return err + } + } + + } + + if o.Position != nil { + + // query param position + var qrPosition float64 + if o.Position != nil { + qrPosition = *o.Position + } + qPosition := swag.FormatFloat64(qrPosition) + if qPosition != "" { + if err := r.SetQueryParam("position", qPosition); 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.RackGroupID != nil { + + // query param rack_group_id + var qrRackGroupID string + if o.RackGroupID != nil { + qrRackGroupID = *o.RackGroupID + } + qRackGroupID := qrRackGroupID + if qRackGroupID != "" { + if err := r.SetQueryParam("rack_group_id", qRackGroupID); err != nil { + return err + } + } + + } + + if o.RackID != nil { + + // query param rack_id + var qrRackID string + if o.RackID != nil { + qrRackID = *o.RackID + } + qRackID := qrRackID + if qRackID != "" { + if err := r.SetQueryParam("rack_id", qRackID); 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.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.Serial != nil { + + // query param serial + var qrSerial string + if o.Serial != nil { + qrSerial = *o.Serial + } + qSerial := qrSerial + if qSerial != "" { + if err := r.SetQueryParam("serial", qSerial); 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.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.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.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.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.VirtualChassisID != nil { + + // query param virtual_chassis_id + var qrVirtualChassisID string + if o.VirtualChassisID != nil { + qrVirtualChassisID = *o.VirtualChassisID + } + qVirtualChassisID := qrVirtualChassisID + if qVirtualChassisID != "" { + if err := r.SetQueryParam("virtual_chassis_id", qVirtualChassisID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_list_responses.go new file mode 100644 index 0000000..8c2d569 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDevicesListReader is a Reader for the DcimDevicesList structure. +type DcimDevicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDevicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDevicesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDevicesListOK creates a DcimDevicesListOK with default headers values +func NewDcimDevicesListOK() *DcimDevicesListOK { + return &DcimDevicesListOK{} +} + +/*DcimDevicesListOK handles this case with default header values. + +DcimDevicesListOK dcim devices list o k +*/ +type DcimDevicesListOK struct { + Payload *models.DcimDevicesListOKBody +} + +func (o *DcimDevicesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/devices/][%d] dcimDevicesListOK %+v", 200, o.Payload) +} + +func (o *DcimDevicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimDevicesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_napalm_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_napalm_parameters.go new file mode 100644 index 0000000..c23967a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_napalm_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimDevicesNapalmParams creates a new DcimDevicesNapalmParams object +// with the default values initialized. +func NewDcimDevicesNapalmParams() *DcimDevicesNapalmParams { + var () + return &DcimDevicesNapalmParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDevicesNapalmParamsWithTimeout creates a new DcimDevicesNapalmParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDevicesNapalmParamsWithTimeout(timeout time.Duration) *DcimDevicesNapalmParams { + var () + return &DcimDevicesNapalmParams{ + + timeout: timeout, + } +} + +// NewDcimDevicesNapalmParamsWithContext creates a new DcimDevicesNapalmParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDevicesNapalmParamsWithContext(ctx context.Context) *DcimDevicesNapalmParams { + var () + return &DcimDevicesNapalmParams{ + + Context: ctx, + } +} + +// NewDcimDevicesNapalmParamsWithHTTPClient creates a new DcimDevicesNapalmParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDevicesNapalmParamsWithHTTPClient(client *http.Client) *DcimDevicesNapalmParams { + var () + return &DcimDevicesNapalmParams{ + HTTPClient: client, + } +} + +/*DcimDevicesNapalmParams contains all the parameters to send to the API endpoint +for the dcim devices napalm operation typically these are written to a http.Request +*/ +type DcimDevicesNapalmParams struct { + + /*ID + A unique integer value identifying this device. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim devices napalm params +func (o *DcimDevicesNapalmParams) WithTimeout(timeout time.Duration) *DcimDevicesNapalmParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim devices napalm params +func (o *DcimDevicesNapalmParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim devices napalm params +func (o *DcimDevicesNapalmParams) WithContext(ctx context.Context) *DcimDevicesNapalmParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim devices napalm params +func (o *DcimDevicesNapalmParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim devices napalm params +func (o *DcimDevicesNapalmParams) WithHTTPClient(client *http.Client) *DcimDevicesNapalmParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim devices napalm params +func (o *DcimDevicesNapalmParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim devices napalm params +func (o *DcimDevicesNapalmParams) WithID(id int64) *DcimDevicesNapalmParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim devices napalm params +func (o *DcimDevicesNapalmParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDevicesNapalmParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_napalm_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_napalm_responses.go new file mode 100644 index 0000000..60a60dc --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_napalm_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDevicesNapalmReader is a Reader for the DcimDevicesNapalm structure. +type DcimDevicesNapalmReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDevicesNapalmReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDevicesNapalmOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDevicesNapalmOK creates a DcimDevicesNapalmOK with default headers values +func NewDcimDevicesNapalmOK() *DcimDevicesNapalmOK { + return &DcimDevicesNapalmOK{} +} + +/*DcimDevicesNapalmOK handles this case with default header values. + +DcimDevicesNapalmOK dcim devices napalm o k +*/ +type DcimDevicesNapalmOK struct { + Payload *models.Device +} + +func (o *DcimDevicesNapalmOK) Error() string { + return fmt.Sprintf("[GET /dcim/devices/{id}/napalm/][%d] dcimDevicesNapalmOK %+v", 200, o.Payload) +} + +func (o *DcimDevicesNapalmOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Device) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_partial_update_parameters.go new file mode 100644 index 0000000..4a3bc2c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimDevicesPartialUpdateParams creates a new DcimDevicesPartialUpdateParams object +// with the default values initialized. +func NewDcimDevicesPartialUpdateParams() *DcimDevicesPartialUpdateParams { + var () + return &DcimDevicesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDevicesPartialUpdateParamsWithTimeout creates a new DcimDevicesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDevicesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimDevicesPartialUpdateParams { + var () + return &DcimDevicesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDevicesPartialUpdateParamsWithContext creates a new DcimDevicesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDevicesPartialUpdateParamsWithContext(ctx context.Context) *DcimDevicesPartialUpdateParams { + var () + return &DcimDevicesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDevicesPartialUpdateParamsWithHTTPClient creates a new DcimDevicesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDevicesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimDevicesPartialUpdateParams { + var () + return &DcimDevicesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDevicesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim devices partial update operation typically these are written to a http.Request +*/ +type DcimDevicesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableDevice + /*ID + A unique integer value identifying this device. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimDevicesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) WithContext(ctx context.Context) *DcimDevicesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimDevicesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) WithData(data *models.WritableDevice) *DcimDevicesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) SetData(data *models.WritableDevice) { + o.Data = data +} + +// WithID adds the id to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) WithID(id int64) *DcimDevicesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDevicesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_partial_update_responses.go new file mode 100644 index 0000000..2193368 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDevicesPartialUpdateReader is a Reader for the DcimDevicesPartialUpdate structure. +type DcimDevicesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDevicesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDevicesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDevicesPartialUpdateOK creates a DcimDevicesPartialUpdateOK with default headers values +func NewDcimDevicesPartialUpdateOK() *DcimDevicesPartialUpdateOK { + return &DcimDevicesPartialUpdateOK{} +} + +/*DcimDevicesPartialUpdateOK handles this case with default header values. + +DcimDevicesPartialUpdateOK dcim devices partial update o k +*/ +type DcimDevicesPartialUpdateOK struct { + Payload *models.WritableDevice +} + +func (o *DcimDevicesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/devices/{id}/][%d] dcimDevicesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDevicesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDevice) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_read_parameters.go new file mode 100644 index 0000000..a72431e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimDevicesReadParams creates a new DcimDevicesReadParams object +// with the default values initialized. +func NewDcimDevicesReadParams() *DcimDevicesReadParams { + var () + return &DcimDevicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDevicesReadParamsWithTimeout creates a new DcimDevicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDevicesReadParamsWithTimeout(timeout time.Duration) *DcimDevicesReadParams { + var () + return &DcimDevicesReadParams{ + + timeout: timeout, + } +} + +// NewDcimDevicesReadParamsWithContext creates a new DcimDevicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDevicesReadParamsWithContext(ctx context.Context) *DcimDevicesReadParams { + var () + return &DcimDevicesReadParams{ + + Context: ctx, + } +} + +// NewDcimDevicesReadParamsWithHTTPClient creates a new DcimDevicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDevicesReadParamsWithHTTPClient(client *http.Client) *DcimDevicesReadParams { + var () + return &DcimDevicesReadParams{ + HTTPClient: client, + } +} + +/*DcimDevicesReadParams contains all the parameters to send to the API endpoint +for the dcim devices read operation typically these are written to a http.Request +*/ +type DcimDevicesReadParams struct { + + /*ID + A unique integer value identifying this device. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim devices read params +func (o *DcimDevicesReadParams) WithTimeout(timeout time.Duration) *DcimDevicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim devices read params +func (o *DcimDevicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim devices read params +func (o *DcimDevicesReadParams) WithContext(ctx context.Context) *DcimDevicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim devices read params +func (o *DcimDevicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim devices read params +func (o *DcimDevicesReadParams) WithHTTPClient(client *http.Client) *DcimDevicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim devices read params +func (o *DcimDevicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim devices read params +func (o *DcimDevicesReadParams) WithID(id int64) *DcimDevicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim devices read params +func (o *DcimDevicesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDevicesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_read_responses.go new file mode 100644 index 0000000..25f29c0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDevicesReadReader is a Reader for the DcimDevicesRead structure. +type DcimDevicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDevicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDevicesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDevicesReadOK creates a DcimDevicesReadOK with default headers values +func NewDcimDevicesReadOK() *DcimDevicesReadOK { + return &DcimDevicesReadOK{} +} + +/*DcimDevicesReadOK handles this case with default header values. + +DcimDevicesReadOK dcim devices read o k +*/ +type DcimDevicesReadOK struct { + Payload *models.Device +} + +func (o *DcimDevicesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/devices/{id}/][%d] dcimDevicesReadOK %+v", 200, o.Payload) +} + +func (o *DcimDevicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Device) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_update_parameters.go new file mode 100644 index 0000000..f2a84ad --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimDevicesUpdateParams creates a new DcimDevicesUpdateParams object +// with the default values initialized. +func NewDcimDevicesUpdateParams() *DcimDevicesUpdateParams { + var () + return &DcimDevicesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDevicesUpdateParamsWithTimeout creates a new DcimDevicesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDevicesUpdateParamsWithTimeout(timeout time.Duration) *DcimDevicesUpdateParams { + var () + return &DcimDevicesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDevicesUpdateParamsWithContext creates a new DcimDevicesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDevicesUpdateParamsWithContext(ctx context.Context) *DcimDevicesUpdateParams { + var () + return &DcimDevicesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDevicesUpdateParamsWithHTTPClient creates a new DcimDevicesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDevicesUpdateParamsWithHTTPClient(client *http.Client) *DcimDevicesUpdateParams { + var () + return &DcimDevicesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDevicesUpdateParams contains all the parameters to send to the API endpoint +for the dcim devices update operation typically these are written to a http.Request +*/ +type DcimDevicesUpdateParams struct { + + /*Data*/ + Data *models.WritableDevice + /*ID + A unique integer value identifying this device. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim devices update params +func (o *DcimDevicesUpdateParams) WithTimeout(timeout time.Duration) *DcimDevicesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim devices update params +func (o *DcimDevicesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim devices update params +func (o *DcimDevicesUpdateParams) WithContext(ctx context.Context) *DcimDevicesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim devices update params +func (o *DcimDevicesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim devices update params +func (o *DcimDevicesUpdateParams) WithHTTPClient(client *http.Client) *DcimDevicesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim devices update params +func (o *DcimDevicesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim devices update params +func (o *DcimDevicesUpdateParams) WithData(data *models.WritableDevice) *DcimDevicesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim devices update params +func (o *DcimDevicesUpdateParams) SetData(data *models.WritableDevice) { + o.Data = data +} + +// WithID adds the id to the dcim devices update params +func (o *DcimDevicesUpdateParams) WithID(id int64) *DcimDevicesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim devices update params +func (o *DcimDevicesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDevicesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_update_responses.go new file mode 100644 index 0000000..4fae46c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_devices_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimDevicesUpdateReader is a Reader for the DcimDevicesUpdate structure. +type DcimDevicesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDevicesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDevicesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimDevicesUpdateOK creates a DcimDevicesUpdateOK with default headers values +func NewDcimDevicesUpdateOK() *DcimDevicesUpdateOK { + return &DcimDevicesUpdateOK{} +} + +/*DcimDevicesUpdateOK handles this case with default header values. + +DcimDevicesUpdateOK dcim devices update o k +*/ +type DcimDevicesUpdateOK struct { + Payload *models.WritableDevice +} + +func (o *DcimDevicesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/devices/{id}/][%d] dcimDevicesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDevicesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDevice) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_create_parameters.go new file mode 100644 index 0000000..4231057 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimInterfaceConnectionsCreateParams creates a new DcimInterfaceConnectionsCreateParams object +// with the default values initialized. +func NewDcimInterfaceConnectionsCreateParams() *DcimInterfaceConnectionsCreateParams { + var () + return &DcimInterfaceConnectionsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceConnectionsCreateParamsWithTimeout creates a new DcimInterfaceConnectionsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceConnectionsCreateParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsCreateParams { + var () + return &DcimInterfaceConnectionsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceConnectionsCreateParamsWithContext creates a new DcimInterfaceConnectionsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceConnectionsCreateParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsCreateParams { + var () + return &DcimInterfaceConnectionsCreateParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceConnectionsCreateParamsWithHTTPClient creates a new DcimInterfaceConnectionsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceConnectionsCreateParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsCreateParams { + var () + return &DcimInterfaceConnectionsCreateParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceConnectionsCreateParams contains all the parameters to send to the API endpoint +for the dcim interface connections create operation typically these are written to a http.Request +*/ +type DcimInterfaceConnectionsCreateParams struct { + + /*Data*/ + Data *models.WritableInterfaceConnection + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface connections create params +func (o *DcimInterfaceConnectionsCreateParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface connections create params +func (o *DcimInterfaceConnectionsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface connections create params +func (o *DcimInterfaceConnectionsCreateParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface connections create params +func (o *DcimInterfaceConnectionsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface connections create params +func (o *DcimInterfaceConnectionsCreateParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface connections create params +func (o *DcimInterfaceConnectionsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interface connections create params +func (o *DcimInterfaceConnectionsCreateParams) WithData(data *models.WritableInterfaceConnection) *DcimInterfaceConnectionsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interface connections create params +func (o *DcimInterfaceConnectionsCreateParams) SetData(data *models.WritableInterfaceConnection) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceConnectionsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_create_responses.go new file mode 100644 index 0000000..ca5040e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInterfaceConnectionsCreateReader is a Reader for the DcimInterfaceConnectionsCreate structure. +type DcimInterfaceConnectionsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceConnectionsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimInterfaceConnectionsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfaceConnectionsCreateCreated creates a DcimInterfaceConnectionsCreateCreated with default headers values +func NewDcimInterfaceConnectionsCreateCreated() *DcimInterfaceConnectionsCreateCreated { + return &DcimInterfaceConnectionsCreateCreated{} +} + +/*DcimInterfaceConnectionsCreateCreated handles this case with default header values. + +DcimInterfaceConnectionsCreateCreated dcim interface connections create created +*/ +type DcimInterfaceConnectionsCreateCreated struct { + Payload *models.WritableInterfaceConnection +} + +func (o *DcimInterfaceConnectionsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/interface-connections/][%d] dcimInterfaceConnectionsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimInterfaceConnectionsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterfaceConnection) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_delete_parameters.go new file mode 100644 index 0000000..b392d95 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimInterfaceConnectionsDeleteParams creates a new DcimInterfaceConnectionsDeleteParams object +// with the default values initialized. +func NewDcimInterfaceConnectionsDeleteParams() *DcimInterfaceConnectionsDeleteParams { + var () + return &DcimInterfaceConnectionsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceConnectionsDeleteParamsWithTimeout creates a new DcimInterfaceConnectionsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceConnectionsDeleteParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsDeleteParams { + var () + return &DcimInterfaceConnectionsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceConnectionsDeleteParamsWithContext creates a new DcimInterfaceConnectionsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceConnectionsDeleteParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsDeleteParams { + var () + return &DcimInterfaceConnectionsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceConnectionsDeleteParamsWithHTTPClient creates a new DcimInterfaceConnectionsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceConnectionsDeleteParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsDeleteParams { + var () + return &DcimInterfaceConnectionsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceConnectionsDeleteParams contains all the parameters to send to the API endpoint +for the dcim interface connections delete operation typically these are written to a http.Request +*/ +type DcimInterfaceConnectionsDeleteParams struct { + + /*ID + A unique integer value identifying this interface connection. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface connections delete params +func (o *DcimInterfaceConnectionsDeleteParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface connections delete params +func (o *DcimInterfaceConnectionsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface connections delete params +func (o *DcimInterfaceConnectionsDeleteParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface connections delete params +func (o *DcimInterfaceConnectionsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface connections delete params +func (o *DcimInterfaceConnectionsDeleteParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface connections delete params +func (o *DcimInterfaceConnectionsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim interface connections delete params +func (o *DcimInterfaceConnectionsDeleteParams) WithID(id int64) *DcimInterfaceConnectionsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interface connections delete params +func (o *DcimInterfaceConnectionsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceConnectionsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_delete_responses.go new file mode 100644 index 0000000..061d954 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimInterfaceConnectionsDeleteReader is a Reader for the DcimInterfaceConnectionsDelete structure. +type DcimInterfaceConnectionsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceConnectionsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimInterfaceConnectionsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfaceConnectionsDeleteNoContent creates a DcimInterfaceConnectionsDeleteNoContent with default headers values +func NewDcimInterfaceConnectionsDeleteNoContent() *DcimInterfaceConnectionsDeleteNoContent { + return &DcimInterfaceConnectionsDeleteNoContent{} +} + +/*DcimInterfaceConnectionsDeleteNoContent handles this case with default header values. + +DcimInterfaceConnectionsDeleteNoContent dcim interface connections delete no content +*/ +type DcimInterfaceConnectionsDeleteNoContent struct { +} + +func (o *DcimInterfaceConnectionsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/interface-connections/{id}/][%d] dcimInterfaceConnectionsDeleteNoContent ", 204) +} + +func (o *DcimInterfaceConnectionsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_list_parameters.go new file mode 100644 index 0000000..5e6c1bd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_list_parameters.go @@ -0,0 +1,282 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimInterfaceConnectionsListParams creates a new DcimInterfaceConnectionsListParams object +// with the default values initialized. +func NewDcimInterfaceConnectionsListParams() *DcimInterfaceConnectionsListParams { + var () + return &DcimInterfaceConnectionsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceConnectionsListParamsWithTimeout creates a new DcimInterfaceConnectionsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceConnectionsListParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsListParams { + var () + return &DcimInterfaceConnectionsListParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceConnectionsListParamsWithContext creates a new DcimInterfaceConnectionsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceConnectionsListParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsListParams { + var () + return &DcimInterfaceConnectionsListParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceConnectionsListParamsWithHTTPClient creates a new DcimInterfaceConnectionsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceConnectionsListParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsListParams { + var () + return &DcimInterfaceConnectionsListParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceConnectionsListParams contains all the parameters to send to the API endpoint +for the dcim interface connections list operation typically these are written to a http.Request +*/ +type DcimInterfaceConnectionsListParams struct { + + /*ConnectionStatus*/ + ConnectionStatus *string + /*Device*/ + Device *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Site*/ + Site *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionStatus adds the connectionStatus to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) WithConnectionStatus(connectionStatus *string) *DcimInterfaceConnectionsListParams { + o.SetConnectionStatus(connectionStatus) + return o +} + +// SetConnectionStatus adds the connectionStatus to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) SetConnectionStatus(connectionStatus *string) { + o.ConnectionStatus = connectionStatus +} + +// WithDevice adds the device to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) WithDevice(device *string) *DcimInterfaceConnectionsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithLimit adds the limit to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) WithLimit(limit *int64) *DcimInterfaceConnectionsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) WithOffset(offset *int64) *DcimInterfaceConnectionsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSite adds the site to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) WithSite(site *string) *DcimInterfaceConnectionsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) SetSite(site *string) { + o.Site = site +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceConnectionsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ConnectionStatus != nil { + + // query param connection_status + var qrConnectionStatus string + if o.ConnectionStatus != nil { + qrConnectionStatus = *o.ConnectionStatus + } + qConnectionStatus := qrConnectionStatus + if qConnectionStatus != "" { + if err := r.SetQueryParam("connection_status", qConnectionStatus); err != nil { + return err + } + } + + } + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); 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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_list_responses.go new file mode 100644 index 0000000..f65d4fb --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInterfaceConnectionsListReader is a Reader for the DcimInterfaceConnectionsList structure. +type DcimInterfaceConnectionsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceConnectionsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfaceConnectionsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfaceConnectionsListOK creates a DcimInterfaceConnectionsListOK with default headers values +func NewDcimInterfaceConnectionsListOK() *DcimInterfaceConnectionsListOK { + return &DcimInterfaceConnectionsListOK{} +} + +/*DcimInterfaceConnectionsListOK handles this case with default header values. + +DcimInterfaceConnectionsListOK dcim interface connections list o k +*/ +type DcimInterfaceConnectionsListOK struct { + Payload *models.DcimInterfaceConnectionsListOKBody +} + +func (o *DcimInterfaceConnectionsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/interface-connections/][%d] dcimInterfaceConnectionsListOK %+v", 200, o.Payload) +} + +func (o *DcimInterfaceConnectionsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimInterfaceConnectionsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_partial_update_parameters.go new file mode 100644 index 0000000..eda3947 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimInterfaceConnectionsPartialUpdateParams creates a new DcimInterfaceConnectionsPartialUpdateParams object +// with the default values initialized. +func NewDcimInterfaceConnectionsPartialUpdateParams() *DcimInterfaceConnectionsPartialUpdateParams { + var () + return &DcimInterfaceConnectionsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceConnectionsPartialUpdateParamsWithTimeout creates a new DcimInterfaceConnectionsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceConnectionsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsPartialUpdateParams { + var () + return &DcimInterfaceConnectionsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceConnectionsPartialUpdateParamsWithContext creates a new DcimInterfaceConnectionsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceConnectionsPartialUpdateParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsPartialUpdateParams { + var () + return &DcimInterfaceConnectionsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceConnectionsPartialUpdateParamsWithHTTPClient creates a new DcimInterfaceConnectionsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceConnectionsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsPartialUpdateParams { + var () + return &DcimInterfaceConnectionsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceConnectionsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim interface connections partial update operation typically these are written to a http.Request +*/ +type DcimInterfaceConnectionsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableInterfaceConnection + /*ID + A unique integer value identifying this interface connection. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) WithData(data *models.WritableInterfaceConnection) *DcimInterfaceConnectionsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) SetData(data *models.WritableInterfaceConnection) { + o.Data = data +} + +// WithID adds the id to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) WithID(id int64) *DcimInterfaceConnectionsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceConnectionsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_partial_update_responses.go new file mode 100644 index 0000000..7666482 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInterfaceConnectionsPartialUpdateReader is a Reader for the DcimInterfaceConnectionsPartialUpdate structure. +type DcimInterfaceConnectionsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceConnectionsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfaceConnectionsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfaceConnectionsPartialUpdateOK creates a DcimInterfaceConnectionsPartialUpdateOK with default headers values +func NewDcimInterfaceConnectionsPartialUpdateOK() *DcimInterfaceConnectionsPartialUpdateOK { + return &DcimInterfaceConnectionsPartialUpdateOK{} +} + +/*DcimInterfaceConnectionsPartialUpdateOK handles this case with default header values. + +DcimInterfaceConnectionsPartialUpdateOK dcim interface connections partial update o k +*/ +type DcimInterfaceConnectionsPartialUpdateOK struct { + Payload *models.WritableInterfaceConnection +} + +func (o *DcimInterfaceConnectionsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/interface-connections/{id}/][%d] dcimInterfaceConnectionsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimInterfaceConnectionsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterfaceConnection) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_read_parameters.go new file mode 100644 index 0000000..e24b256 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimInterfaceConnectionsReadParams creates a new DcimInterfaceConnectionsReadParams object +// with the default values initialized. +func NewDcimInterfaceConnectionsReadParams() *DcimInterfaceConnectionsReadParams { + var () + return &DcimInterfaceConnectionsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceConnectionsReadParamsWithTimeout creates a new DcimInterfaceConnectionsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceConnectionsReadParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsReadParams { + var () + return &DcimInterfaceConnectionsReadParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceConnectionsReadParamsWithContext creates a new DcimInterfaceConnectionsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceConnectionsReadParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsReadParams { + var () + return &DcimInterfaceConnectionsReadParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceConnectionsReadParamsWithHTTPClient creates a new DcimInterfaceConnectionsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceConnectionsReadParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsReadParams { + var () + return &DcimInterfaceConnectionsReadParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceConnectionsReadParams contains all the parameters to send to the API endpoint +for the dcim interface connections read operation typically these are written to a http.Request +*/ +type DcimInterfaceConnectionsReadParams struct { + + /*ID + A unique integer value identifying this interface connection. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface connections read params +func (o *DcimInterfaceConnectionsReadParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface connections read params +func (o *DcimInterfaceConnectionsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface connections read params +func (o *DcimInterfaceConnectionsReadParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface connections read params +func (o *DcimInterfaceConnectionsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface connections read params +func (o *DcimInterfaceConnectionsReadParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface connections read params +func (o *DcimInterfaceConnectionsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim interface connections read params +func (o *DcimInterfaceConnectionsReadParams) WithID(id int64) *DcimInterfaceConnectionsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interface connections read params +func (o *DcimInterfaceConnectionsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceConnectionsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_read_responses.go new file mode 100644 index 0000000..9cf2e62 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInterfaceConnectionsReadReader is a Reader for the DcimInterfaceConnectionsRead structure. +type DcimInterfaceConnectionsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceConnectionsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfaceConnectionsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfaceConnectionsReadOK creates a DcimInterfaceConnectionsReadOK with default headers values +func NewDcimInterfaceConnectionsReadOK() *DcimInterfaceConnectionsReadOK { + return &DcimInterfaceConnectionsReadOK{} +} + +/*DcimInterfaceConnectionsReadOK handles this case with default header values. + +DcimInterfaceConnectionsReadOK dcim interface connections read o k +*/ +type DcimInterfaceConnectionsReadOK struct { + Payload *models.InterfaceConnection +} + +func (o *DcimInterfaceConnectionsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/interface-connections/{id}/][%d] dcimInterfaceConnectionsReadOK %+v", 200, o.Payload) +} + +func (o *DcimInterfaceConnectionsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InterfaceConnection) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_update_parameters.go new file mode 100644 index 0000000..85cc6a1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimInterfaceConnectionsUpdateParams creates a new DcimInterfaceConnectionsUpdateParams object +// with the default values initialized. +func NewDcimInterfaceConnectionsUpdateParams() *DcimInterfaceConnectionsUpdateParams { + var () + return &DcimInterfaceConnectionsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceConnectionsUpdateParamsWithTimeout creates a new DcimInterfaceConnectionsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceConnectionsUpdateParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsUpdateParams { + var () + return &DcimInterfaceConnectionsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceConnectionsUpdateParamsWithContext creates a new DcimInterfaceConnectionsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceConnectionsUpdateParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsUpdateParams { + var () + return &DcimInterfaceConnectionsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceConnectionsUpdateParamsWithHTTPClient creates a new DcimInterfaceConnectionsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceConnectionsUpdateParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsUpdateParams { + var () + return &DcimInterfaceConnectionsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceConnectionsUpdateParams contains all the parameters to send to the API endpoint +for the dcim interface connections update operation typically these are written to a http.Request +*/ +type DcimInterfaceConnectionsUpdateParams struct { + + /*Data*/ + Data *models.WritableInterfaceConnection + /*ID + A unique integer value identifying this interface connection. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) WithData(data *models.WritableInterfaceConnection) *DcimInterfaceConnectionsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) SetData(data *models.WritableInterfaceConnection) { + o.Data = data +} + +// WithID adds the id to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) WithID(id int64) *DcimInterfaceConnectionsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceConnectionsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_update_responses.go new file mode 100644 index 0000000..ac16cd5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_connections_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInterfaceConnectionsUpdateReader is a Reader for the DcimInterfaceConnectionsUpdate structure. +type DcimInterfaceConnectionsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceConnectionsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfaceConnectionsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfaceConnectionsUpdateOK creates a DcimInterfaceConnectionsUpdateOK with default headers values +func NewDcimInterfaceConnectionsUpdateOK() *DcimInterfaceConnectionsUpdateOK { + return &DcimInterfaceConnectionsUpdateOK{} +} + +/*DcimInterfaceConnectionsUpdateOK handles this case with default header values. + +DcimInterfaceConnectionsUpdateOK dcim interface connections update o k +*/ +type DcimInterfaceConnectionsUpdateOK struct { + Payload *models.WritableInterfaceConnection +} + +func (o *DcimInterfaceConnectionsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/interface-connections/{id}/][%d] dcimInterfaceConnectionsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimInterfaceConnectionsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterfaceConnection) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_create_parameters.go new file mode 100644 index 0000000..6307ae6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimInterfaceTemplatesCreateParams creates a new DcimInterfaceTemplatesCreateParams object +// with the default values initialized. +func NewDcimInterfaceTemplatesCreateParams() *DcimInterfaceTemplatesCreateParams { + var () + return &DcimInterfaceTemplatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceTemplatesCreateParamsWithTimeout creates a new DcimInterfaceTemplatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceTemplatesCreateParamsWithTimeout(timeout time.Duration) *DcimInterfaceTemplatesCreateParams { + var () + return &DcimInterfaceTemplatesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceTemplatesCreateParamsWithContext creates a new DcimInterfaceTemplatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceTemplatesCreateParamsWithContext(ctx context.Context) *DcimInterfaceTemplatesCreateParams { + var () + return &DcimInterfaceTemplatesCreateParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceTemplatesCreateParamsWithHTTPClient creates a new DcimInterfaceTemplatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceTemplatesCreateParamsWithHTTPClient(client *http.Client) *DcimInterfaceTemplatesCreateParams { + var () + return &DcimInterfaceTemplatesCreateParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceTemplatesCreateParams contains all the parameters to send to the API endpoint +for the dcim interface templates create operation typically these are written to a http.Request +*/ +type DcimInterfaceTemplatesCreateParams struct { + + /*Data*/ + Data *models.WritableInterfaceTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface templates create params +func (o *DcimInterfaceTemplatesCreateParams) WithTimeout(timeout time.Duration) *DcimInterfaceTemplatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface templates create params +func (o *DcimInterfaceTemplatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface templates create params +func (o *DcimInterfaceTemplatesCreateParams) WithContext(ctx context.Context) *DcimInterfaceTemplatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface templates create params +func (o *DcimInterfaceTemplatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface templates create params +func (o *DcimInterfaceTemplatesCreateParams) WithHTTPClient(client *http.Client) *DcimInterfaceTemplatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface templates create params +func (o *DcimInterfaceTemplatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interface templates create params +func (o *DcimInterfaceTemplatesCreateParams) WithData(data *models.WritableInterfaceTemplate) *DcimInterfaceTemplatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interface templates create params +func (o *DcimInterfaceTemplatesCreateParams) SetData(data *models.WritableInterfaceTemplate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceTemplatesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_create_responses.go new file mode 100644 index 0000000..150768f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInterfaceTemplatesCreateReader is a Reader for the DcimInterfaceTemplatesCreate structure. +type DcimInterfaceTemplatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceTemplatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimInterfaceTemplatesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfaceTemplatesCreateCreated creates a DcimInterfaceTemplatesCreateCreated with default headers values +func NewDcimInterfaceTemplatesCreateCreated() *DcimInterfaceTemplatesCreateCreated { + return &DcimInterfaceTemplatesCreateCreated{} +} + +/*DcimInterfaceTemplatesCreateCreated handles this case with default header values. + +DcimInterfaceTemplatesCreateCreated dcim interface templates create created +*/ +type DcimInterfaceTemplatesCreateCreated struct { + Payload *models.WritableInterfaceTemplate +} + +func (o *DcimInterfaceTemplatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/interface-templates/][%d] dcimInterfaceTemplatesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimInterfaceTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterfaceTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_delete_parameters.go new file mode 100644 index 0000000..c564d63 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimInterfaceTemplatesDeleteParams creates a new DcimInterfaceTemplatesDeleteParams object +// with the default values initialized. +func NewDcimInterfaceTemplatesDeleteParams() *DcimInterfaceTemplatesDeleteParams { + var () + return &DcimInterfaceTemplatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceTemplatesDeleteParamsWithTimeout creates a new DcimInterfaceTemplatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceTemplatesDeleteParamsWithTimeout(timeout time.Duration) *DcimInterfaceTemplatesDeleteParams { + var () + return &DcimInterfaceTemplatesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceTemplatesDeleteParamsWithContext creates a new DcimInterfaceTemplatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceTemplatesDeleteParamsWithContext(ctx context.Context) *DcimInterfaceTemplatesDeleteParams { + var () + return &DcimInterfaceTemplatesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceTemplatesDeleteParamsWithHTTPClient creates a new DcimInterfaceTemplatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceTemplatesDeleteParamsWithHTTPClient(client *http.Client) *DcimInterfaceTemplatesDeleteParams { + var () + return &DcimInterfaceTemplatesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceTemplatesDeleteParams contains all the parameters to send to the API endpoint +for the dcim interface templates delete operation typically these are written to a http.Request +*/ +type DcimInterfaceTemplatesDeleteParams struct { + + /*ID + A unique integer value identifying this interface template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface templates delete params +func (o *DcimInterfaceTemplatesDeleteParams) WithTimeout(timeout time.Duration) *DcimInterfaceTemplatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface templates delete params +func (o *DcimInterfaceTemplatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface templates delete params +func (o *DcimInterfaceTemplatesDeleteParams) WithContext(ctx context.Context) *DcimInterfaceTemplatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface templates delete params +func (o *DcimInterfaceTemplatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface templates delete params +func (o *DcimInterfaceTemplatesDeleteParams) WithHTTPClient(client *http.Client) *DcimInterfaceTemplatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface templates delete params +func (o *DcimInterfaceTemplatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim interface templates delete params +func (o *DcimInterfaceTemplatesDeleteParams) WithID(id int64) *DcimInterfaceTemplatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interface templates delete params +func (o *DcimInterfaceTemplatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceTemplatesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_delete_responses.go new file mode 100644 index 0000000..28cb958 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimInterfaceTemplatesDeleteReader is a Reader for the DcimInterfaceTemplatesDelete structure. +type DcimInterfaceTemplatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceTemplatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimInterfaceTemplatesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfaceTemplatesDeleteNoContent creates a DcimInterfaceTemplatesDeleteNoContent with default headers values +func NewDcimInterfaceTemplatesDeleteNoContent() *DcimInterfaceTemplatesDeleteNoContent { + return &DcimInterfaceTemplatesDeleteNoContent{} +} + +/*DcimInterfaceTemplatesDeleteNoContent handles this case with default header values. + +DcimInterfaceTemplatesDeleteNoContent dcim interface templates delete no content +*/ +type DcimInterfaceTemplatesDeleteNoContent struct { +} + +func (o *DcimInterfaceTemplatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/interface-templates/{id}/][%d] dcimInterfaceTemplatesDeleteNoContent ", 204) +} + +func (o *DcimInterfaceTemplatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_list_parameters.go new file mode 100644 index 0000000..44b97fd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_list_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimInterfaceTemplatesListParams creates a new DcimInterfaceTemplatesListParams object +// with the default values initialized. +func NewDcimInterfaceTemplatesListParams() *DcimInterfaceTemplatesListParams { + var () + return &DcimInterfaceTemplatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceTemplatesListParamsWithTimeout creates a new DcimInterfaceTemplatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceTemplatesListParamsWithTimeout(timeout time.Duration) *DcimInterfaceTemplatesListParams { + var () + return &DcimInterfaceTemplatesListParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceTemplatesListParamsWithContext creates a new DcimInterfaceTemplatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceTemplatesListParamsWithContext(ctx context.Context) *DcimInterfaceTemplatesListParams { + var () + return &DcimInterfaceTemplatesListParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceTemplatesListParamsWithHTTPClient creates a new DcimInterfaceTemplatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceTemplatesListParamsWithHTTPClient(client *http.Client) *DcimInterfaceTemplatesListParams { + var () + return &DcimInterfaceTemplatesListParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceTemplatesListParams contains all the parameters to send to the API endpoint +for the dcim interface templates list operation typically these are written to a http.Request +*/ +type DcimInterfaceTemplatesListParams struct { + + /*DevicetypeID*/ + DevicetypeID *string + /*FormFactor*/ + FormFactor *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*MgmtOnly*/ + MgmtOnly *string + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithTimeout(timeout time.Duration) *DcimInterfaceTemplatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithContext(ctx context.Context) *DcimInterfaceTemplatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithHTTPClient(client *http.Client) *DcimInterfaceTemplatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevicetypeID adds the devicetypeID to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithDevicetypeID(devicetypeID *string) *DcimInterfaceTemplatesListParams { + o.SetDevicetypeID(devicetypeID) + return o +} + +// SetDevicetypeID adds the devicetypeId to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetDevicetypeID(devicetypeID *string) { + o.DevicetypeID = devicetypeID +} + +// WithFormFactor adds the formFactor to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithFormFactor(formFactor *string) *DcimInterfaceTemplatesListParams { + o.SetFormFactor(formFactor) + return o +} + +// SetFormFactor adds the formFactor to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetFormFactor(formFactor *string) { + o.FormFactor = formFactor +} + +// WithLimit adds the limit to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithLimit(limit *int64) *DcimInterfaceTemplatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithMgmtOnly adds the mgmtOnly to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithMgmtOnly(mgmtOnly *string) *DcimInterfaceTemplatesListParams { + o.SetMgmtOnly(mgmtOnly) + return o +} + +// SetMgmtOnly adds the mgmtOnly to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetMgmtOnly(mgmtOnly *string) { + o.MgmtOnly = mgmtOnly +} + +// WithName adds the name to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithName(name *string) *DcimInterfaceTemplatesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithOffset(offset *int64) *DcimInterfaceTemplatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DevicetypeID != nil { + + // query param devicetype_id + var qrDevicetypeID string + if o.DevicetypeID != nil { + qrDevicetypeID = *o.DevicetypeID + } + qDevicetypeID := qrDevicetypeID + if qDevicetypeID != "" { + if err := r.SetQueryParam("devicetype_id", qDevicetypeID); err != nil { + return err + } + } + + } + + if o.FormFactor != nil { + + // query param form_factor + var qrFormFactor string + if o.FormFactor != nil { + qrFormFactor = *o.FormFactor + } + qFormFactor := qrFormFactor + if qFormFactor != "" { + if err := r.SetQueryParam("form_factor", qFormFactor); 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.MgmtOnly != nil { + + // query param mgmt_only + var qrMgmtOnly string + if o.MgmtOnly != nil { + qrMgmtOnly = *o.MgmtOnly + } + qMgmtOnly := qrMgmtOnly + if qMgmtOnly != "" { + if err := r.SetQueryParam("mgmt_only", qMgmtOnly); 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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_list_responses.go new file mode 100644 index 0000000..8d505de --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInterfaceTemplatesListReader is a Reader for the DcimInterfaceTemplatesList structure. +type DcimInterfaceTemplatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceTemplatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfaceTemplatesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfaceTemplatesListOK creates a DcimInterfaceTemplatesListOK with default headers values +func NewDcimInterfaceTemplatesListOK() *DcimInterfaceTemplatesListOK { + return &DcimInterfaceTemplatesListOK{} +} + +/*DcimInterfaceTemplatesListOK handles this case with default header values. + +DcimInterfaceTemplatesListOK dcim interface templates list o k +*/ +type DcimInterfaceTemplatesListOK struct { + Payload *models.DcimInterfaceTemplatesListOKBody +} + +func (o *DcimInterfaceTemplatesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/interface-templates/][%d] dcimInterfaceTemplatesListOK %+v", 200, o.Payload) +} + +func (o *DcimInterfaceTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimInterfaceTemplatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_partial_update_parameters.go new file mode 100644 index 0000000..d231ca8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimInterfaceTemplatesPartialUpdateParams creates a new DcimInterfaceTemplatesPartialUpdateParams object +// with the default values initialized. +func NewDcimInterfaceTemplatesPartialUpdateParams() *DcimInterfaceTemplatesPartialUpdateParams { + var () + return &DcimInterfaceTemplatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceTemplatesPartialUpdateParamsWithTimeout creates a new DcimInterfaceTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimInterfaceTemplatesPartialUpdateParams { + var () + return &DcimInterfaceTemplatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceTemplatesPartialUpdateParamsWithContext creates a new DcimInterfaceTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceTemplatesPartialUpdateParamsWithContext(ctx context.Context) *DcimInterfaceTemplatesPartialUpdateParams { + var () + return &DcimInterfaceTemplatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceTemplatesPartialUpdateParamsWithHTTPClient creates a new DcimInterfaceTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimInterfaceTemplatesPartialUpdateParams { + var () + return &DcimInterfaceTemplatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim interface templates partial update operation typically these are written to a http.Request +*/ +type DcimInterfaceTemplatesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableInterfaceTemplate + /*ID + A unique integer value identifying this interface template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimInterfaceTemplatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) WithContext(ctx context.Context) *DcimInterfaceTemplatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimInterfaceTemplatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) WithData(data *models.WritableInterfaceTemplate) *DcimInterfaceTemplatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) SetData(data *models.WritableInterfaceTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) WithID(id int64) *DcimInterfaceTemplatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceTemplatesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_partial_update_responses.go new file mode 100644 index 0000000..7718694 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInterfaceTemplatesPartialUpdateReader is a Reader for the DcimInterfaceTemplatesPartialUpdate structure. +type DcimInterfaceTemplatesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfaceTemplatesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfaceTemplatesPartialUpdateOK creates a DcimInterfaceTemplatesPartialUpdateOK with default headers values +func NewDcimInterfaceTemplatesPartialUpdateOK() *DcimInterfaceTemplatesPartialUpdateOK { + return &DcimInterfaceTemplatesPartialUpdateOK{} +} + +/*DcimInterfaceTemplatesPartialUpdateOK handles this case with default header values. + +DcimInterfaceTemplatesPartialUpdateOK dcim interface templates partial update o k +*/ +type DcimInterfaceTemplatesPartialUpdateOK struct { + Payload *models.WritableInterfaceTemplate +} + +func (o *DcimInterfaceTemplatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/interface-templates/{id}/][%d] dcimInterfaceTemplatesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimInterfaceTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterfaceTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_read_parameters.go new file mode 100644 index 0000000..8446aad --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimInterfaceTemplatesReadParams creates a new DcimInterfaceTemplatesReadParams object +// with the default values initialized. +func NewDcimInterfaceTemplatesReadParams() *DcimInterfaceTemplatesReadParams { + var () + return &DcimInterfaceTemplatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceTemplatesReadParamsWithTimeout creates a new DcimInterfaceTemplatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceTemplatesReadParamsWithTimeout(timeout time.Duration) *DcimInterfaceTemplatesReadParams { + var () + return &DcimInterfaceTemplatesReadParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceTemplatesReadParamsWithContext creates a new DcimInterfaceTemplatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceTemplatesReadParamsWithContext(ctx context.Context) *DcimInterfaceTemplatesReadParams { + var () + return &DcimInterfaceTemplatesReadParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceTemplatesReadParamsWithHTTPClient creates a new DcimInterfaceTemplatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceTemplatesReadParamsWithHTTPClient(client *http.Client) *DcimInterfaceTemplatesReadParams { + var () + return &DcimInterfaceTemplatesReadParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceTemplatesReadParams contains all the parameters to send to the API endpoint +for the dcim interface templates read operation typically these are written to a http.Request +*/ +type DcimInterfaceTemplatesReadParams struct { + + /*ID + A unique integer value identifying this interface template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface templates read params +func (o *DcimInterfaceTemplatesReadParams) WithTimeout(timeout time.Duration) *DcimInterfaceTemplatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface templates read params +func (o *DcimInterfaceTemplatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface templates read params +func (o *DcimInterfaceTemplatesReadParams) WithContext(ctx context.Context) *DcimInterfaceTemplatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface templates read params +func (o *DcimInterfaceTemplatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface templates read params +func (o *DcimInterfaceTemplatesReadParams) WithHTTPClient(client *http.Client) *DcimInterfaceTemplatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface templates read params +func (o *DcimInterfaceTemplatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim interface templates read params +func (o *DcimInterfaceTemplatesReadParams) WithID(id int64) *DcimInterfaceTemplatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interface templates read params +func (o *DcimInterfaceTemplatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceTemplatesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_read_responses.go new file mode 100644 index 0000000..b670d4e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInterfaceTemplatesReadReader is a Reader for the DcimInterfaceTemplatesRead structure. +type DcimInterfaceTemplatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceTemplatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfaceTemplatesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfaceTemplatesReadOK creates a DcimInterfaceTemplatesReadOK with default headers values +func NewDcimInterfaceTemplatesReadOK() *DcimInterfaceTemplatesReadOK { + return &DcimInterfaceTemplatesReadOK{} +} + +/*DcimInterfaceTemplatesReadOK handles this case with default header values. + +DcimInterfaceTemplatesReadOK dcim interface templates read o k +*/ +type DcimInterfaceTemplatesReadOK struct { + Payload *models.InterfaceTemplate +} + +func (o *DcimInterfaceTemplatesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/interface-templates/{id}/][%d] dcimInterfaceTemplatesReadOK %+v", 200, o.Payload) +} + +func (o *DcimInterfaceTemplatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InterfaceTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_update_parameters.go new file mode 100644 index 0000000..526828e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimInterfaceTemplatesUpdateParams creates a new DcimInterfaceTemplatesUpdateParams object +// with the default values initialized. +func NewDcimInterfaceTemplatesUpdateParams() *DcimInterfaceTemplatesUpdateParams { + var () + return &DcimInterfaceTemplatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceTemplatesUpdateParamsWithTimeout creates a new DcimInterfaceTemplatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceTemplatesUpdateParamsWithTimeout(timeout time.Duration) *DcimInterfaceTemplatesUpdateParams { + var () + return &DcimInterfaceTemplatesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceTemplatesUpdateParamsWithContext creates a new DcimInterfaceTemplatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceTemplatesUpdateParamsWithContext(ctx context.Context) *DcimInterfaceTemplatesUpdateParams { + var () + return &DcimInterfaceTemplatesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceTemplatesUpdateParamsWithHTTPClient creates a new DcimInterfaceTemplatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceTemplatesUpdateParamsWithHTTPClient(client *http.Client) *DcimInterfaceTemplatesUpdateParams { + var () + return &DcimInterfaceTemplatesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceTemplatesUpdateParams contains all the parameters to send to the API endpoint +for the dcim interface templates update operation typically these are written to a http.Request +*/ +type DcimInterfaceTemplatesUpdateParams struct { + + /*Data*/ + Data *models.WritableInterfaceTemplate + /*ID + A unique integer value identifying this interface template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) WithTimeout(timeout time.Duration) *DcimInterfaceTemplatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) WithContext(ctx context.Context) *DcimInterfaceTemplatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) WithHTTPClient(client *http.Client) *DcimInterfaceTemplatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) WithData(data *models.WritableInterfaceTemplate) *DcimInterfaceTemplatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) SetData(data *models.WritableInterfaceTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) WithID(id int64) *DcimInterfaceTemplatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceTemplatesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_update_responses.go new file mode 100644 index 0000000..1a14d3b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interface_templates_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInterfaceTemplatesUpdateReader is a Reader for the DcimInterfaceTemplatesUpdate structure. +type DcimInterfaceTemplatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceTemplatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfaceTemplatesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfaceTemplatesUpdateOK creates a DcimInterfaceTemplatesUpdateOK with default headers values +func NewDcimInterfaceTemplatesUpdateOK() *DcimInterfaceTemplatesUpdateOK { + return &DcimInterfaceTemplatesUpdateOK{} +} + +/*DcimInterfaceTemplatesUpdateOK handles this case with default header values. + +DcimInterfaceTemplatesUpdateOK dcim interface templates update o k +*/ +type DcimInterfaceTemplatesUpdateOK struct { + Payload *models.WritableInterfaceTemplate +} + +func (o *DcimInterfaceTemplatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/interface-templates/{id}/][%d] dcimInterfaceTemplatesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimInterfaceTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterfaceTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_create_parameters.go new file mode 100644 index 0000000..16065f4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimInterfacesCreateParams creates a new DcimInterfacesCreateParams object +// with the default values initialized. +func NewDcimInterfacesCreateParams() *DcimInterfacesCreateParams { + var () + return &DcimInterfacesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfacesCreateParamsWithTimeout creates a new DcimInterfacesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfacesCreateParamsWithTimeout(timeout time.Duration) *DcimInterfacesCreateParams { + var () + return &DcimInterfacesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfacesCreateParamsWithContext creates a new DcimInterfacesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfacesCreateParamsWithContext(ctx context.Context) *DcimInterfacesCreateParams { + var () + return &DcimInterfacesCreateParams{ + + Context: ctx, + } +} + +// NewDcimInterfacesCreateParamsWithHTTPClient creates a new DcimInterfacesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfacesCreateParamsWithHTTPClient(client *http.Client) *DcimInterfacesCreateParams { + var () + return &DcimInterfacesCreateParams{ + HTTPClient: client, + } +} + +/*DcimInterfacesCreateParams contains all the parameters to send to the API endpoint +for the dcim interfaces create operation typically these are written to a http.Request +*/ +type DcimInterfacesCreateParams struct { + + /*Data*/ + Data *models.WritableInterface + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interfaces create params +func (o *DcimInterfacesCreateParams) WithTimeout(timeout time.Duration) *DcimInterfacesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interfaces create params +func (o *DcimInterfacesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interfaces create params +func (o *DcimInterfacesCreateParams) WithContext(ctx context.Context) *DcimInterfacesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interfaces create params +func (o *DcimInterfacesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interfaces create params +func (o *DcimInterfacesCreateParams) WithHTTPClient(client *http.Client) *DcimInterfacesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interfaces create params +func (o *DcimInterfacesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interfaces create params +func (o *DcimInterfacesCreateParams) WithData(data *models.WritableInterface) *DcimInterfacesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interfaces create params +func (o *DcimInterfacesCreateParams) SetData(data *models.WritableInterface) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfacesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_create_responses.go new file mode 100644 index 0000000..ca7ba27 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInterfacesCreateReader is a Reader for the DcimInterfacesCreate structure. +type DcimInterfacesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfacesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimInterfacesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfacesCreateCreated creates a DcimInterfacesCreateCreated with default headers values +func NewDcimInterfacesCreateCreated() *DcimInterfacesCreateCreated { + return &DcimInterfacesCreateCreated{} +} + +/*DcimInterfacesCreateCreated handles this case with default header values. + +DcimInterfacesCreateCreated dcim interfaces create created +*/ +type DcimInterfacesCreateCreated struct { + Payload *models.WritableInterface +} + +func (o *DcimInterfacesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/interfaces/][%d] dcimInterfacesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimInterfacesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterface) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_delete_parameters.go new file mode 100644 index 0000000..db8a884 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimInterfacesDeleteParams creates a new DcimInterfacesDeleteParams object +// with the default values initialized. +func NewDcimInterfacesDeleteParams() *DcimInterfacesDeleteParams { + var () + return &DcimInterfacesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfacesDeleteParamsWithTimeout creates a new DcimInterfacesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfacesDeleteParamsWithTimeout(timeout time.Duration) *DcimInterfacesDeleteParams { + var () + return &DcimInterfacesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimInterfacesDeleteParamsWithContext creates a new DcimInterfacesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfacesDeleteParamsWithContext(ctx context.Context) *DcimInterfacesDeleteParams { + var () + return &DcimInterfacesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimInterfacesDeleteParamsWithHTTPClient creates a new DcimInterfacesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfacesDeleteParamsWithHTTPClient(client *http.Client) *DcimInterfacesDeleteParams { + var () + return &DcimInterfacesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimInterfacesDeleteParams contains all the parameters to send to the API endpoint +for the dcim interfaces delete operation typically these are written to a http.Request +*/ +type DcimInterfacesDeleteParams struct { + + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interfaces delete params +func (o *DcimInterfacesDeleteParams) WithTimeout(timeout time.Duration) *DcimInterfacesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interfaces delete params +func (o *DcimInterfacesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interfaces delete params +func (o *DcimInterfacesDeleteParams) WithContext(ctx context.Context) *DcimInterfacesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interfaces delete params +func (o *DcimInterfacesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interfaces delete params +func (o *DcimInterfacesDeleteParams) WithHTTPClient(client *http.Client) *DcimInterfacesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interfaces delete params +func (o *DcimInterfacesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim interfaces delete params +func (o *DcimInterfacesDeleteParams) WithID(id int64) *DcimInterfacesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interfaces delete params +func (o *DcimInterfacesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfacesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_delete_responses.go new file mode 100644 index 0000000..63f526a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimInterfacesDeleteReader is a Reader for the DcimInterfacesDelete structure. +type DcimInterfacesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfacesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimInterfacesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfacesDeleteNoContent creates a DcimInterfacesDeleteNoContent with default headers values +func NewDcimInterfacesDeleteNoContent() *DcimInterfacesDeleteNoContent { + return &DcimInterfacesDeleteNoContent{} +} + +/*DcimInterfacesDeleteNoContent handles this case with default header values. + +DcimInterfacesDeleteNoContent dcim interfaces delete no content +*/ +type DcimInterfacesDeleteNoContent struct { +} + +func (o *DcimInterfacesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/interfaces/{id}/][%d] dcimInterfacesDeleteNoContent ", 204) +} + +func (o *DcimInterfacesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_graphs_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_graphs_parameters.go new file mode 100644 index 0000000..53fe117 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_graphs_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimInterfacesGraphsParams creates a new DcimInterfacesGraphsParams object +// with the default values initialized. +func NewDcimInterfacesGraphsParams() *DcimInterfacesGraphsParams { + var () + return &DcimInterfacesGraphsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfacesGraphsParamsWithTimeout creates a new DcimInterfacesGraphsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfacesGraphsParamsWithTimeout(timeout time.Duration) *DcimInterfacesGraphsParams { + var () + return &DcimInterfacesGraphsParams{ + + timeout: timeout, + } +} + +// NewDcimInterfacesGraphsParamsWithContext creates a new DcimInterfacesGraphsParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfacesGraphsParamsWithContext(ctx context.Context) *DcimInterfacesGraphsParams { + var () + return &DcimInterfacesGraphsParams{ + + Context: ctx, + } +} + +// NewDcimInterfacesGraphsParamsWithHTTPClient creates a new DcimInterfacesGraphsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfacesGraphsParamsWithHTTPClient(client *http.Client) *DcimInterfacesGraphsParams { + var () + return &DcimInterfacesGraphsParams{ + HTTPClient: client, + } +} + +/*DcimInterfacesGraphsParams contains all the parameters to send to the API endpoint +for the dcim interfaces graphs operation typically these are written to a http.Request +*/ +type DcimInterfacesGraphsParams struct { + + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interfaces graphs params +func (o *DcimInterfacesGraphsParams) WithTimeout(timeout time.Duration) *DcimInterfacesGraphsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interfaces graphs params +func (o *DcimInterfacesGraphsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interfaces graphs params +func (o *DcimInterfacesGraphsParams) WithContext(ctx context.Context) *DcimInterfacesGraphsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interfaces graphs params +func (o *DcimInterfacesGraphsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interfaces graphs params +func (o *DcimInterfacesGraphsParams) WithHTTPClient(client *http.Client) *DcimInterfacesGraphsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interfaces graphs params +func (o *DcimInterfacesGraphsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim interfaces graphs params +func (o *DcimInterfacesGraphsParams) WithID(id int64) *DcimInterfacesGraphsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interfaces graphs params +func (o *DcimInterfacesGraphsParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfacesGraphsParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_graphs_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_graphs_responses.go new file mode 100644 index 0000000..868c94a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_graphs_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInterfacesGraphsReader is a Reader for the DcimInterfacesGraphs structure. +type DcimInterfacesGraphsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfacesGraphsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfacesGraphsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfacesGraphsOK creates a DcimInterfacesGraphsOK with default headers values +func NewDcimInterfacesGraphsOK() *DcimInterfacesGraphsOK { + return &DcimInterfacesGraphsOK{} +} + +/*DcimInterfacesGraphsOK handles this case with default header values. + +DcimInterfacesGraphsOK dcim interfaces graphs o k +*/ +type DcimInterfacesGraphsOK struct { + Payload *models.Interface +} + +func (o *DcimInterfacesGraphsOK) Error() string { + return fmt.Sprintf("[GET /dcim/interfaces/{id}/graphs/][%d] dcimInterfacesGraphsOK %+v", 200, o.Payload) +} + +func (o *DcimInterfacesGraphsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Interface) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_list_parameters.go new file mode 100644 index 0000000..a8121cf --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_list_parameters.go @@ -0,0 +1,485 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimInterfacesListParams creates a new DcimInterfacesListParams object +// with the default values initialized. +func NewDcimInterfacesListParams() *DcimInterfacesListParams { + var () + return &DcimInterfacesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfacesListParamsWithTimeout creates a new DcimInterfacesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfacesListParamsWithTimeout(timeout time.Duration) *DcimInterfacesListParams { + var () + return &DcimInterfacesListParams{ + + timeout: timeout, + } +} + +// NewDcimInterfacesListParamsWithContext creates a new DcimInterfacesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfacesListParamsWithContext(ctx context.Context) *DcimInterfacesListParams { + var () + return &DcimInterfacesListParams{ + + Context: ctx, + } +} + +// NewDcimInterfacesListParamsWithHTTPClient creates a new DcimInterfacesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfacesListParamsWithHTTPClient(client *http.Client) *DcimInterfacesListParams { + var () + return &DcimInterfacesListParams{ + HTTPClient: client, + } +} + +/*DcimInterfacesListParams contains all the parameters to send to the API endpoint +for the dcim interfaces list operation typically these are written to a http.Request +*/ +type DcimInterfacesListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *float64 + /*Enabled*/ + Enabled *string + /*FormFactor*/ + FormFactor *string + /*LagID*/ + LagID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*MacAddress*/ + MacAddress *string + /*MgmtOnly*/ + MgmtOnly *string + /*Mtu*/ + Mtu *float64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Type*/ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithTimeout(timeout time.Duration) *DcimInterfacesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithContext(ctx context.Context) *DcimInterfacesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithHTTPClient(client *http.Client) *DcimInterfacesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithDevice(device *string) *DcimInterfacesListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithDeviceID(deviceID *float64) *DcimInterfacesListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetDeviceID(deviceID *float64) { + o.DeviceID = deviceID +} + +// WithEnabled adds the enabled to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithEnabled(enabled *string) *DcimInterfacesListParams { + o.SetEnabled(enabled) + return o +} + +// SetEnabled adds the enabled to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetEnabled(enabled *string) { + o.Enabled = enabled +} + +// WithFormFactor adds the formFactor to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithFormFactor(formFactor *string) *DcimInterfacesListParams { + o.SetFormFactor(formFactor) + return o +} + +// SetFormFactor adds the formFactor to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetFormFactor(formFactor *string) { + o.FormFactor = formFactor +} + +// WithLagID adds the lagID to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithLagID(lagID *string) *DcimInterfacesListParams { + o.SetLagID(lagID) + return o +} + +// SetLagID adds the lagId to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetLagID(lagID *string) { + o.LagID = lagID +} + +// WithLimit adds the limit to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithLimit(limit *int64) *DcimInterfacesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithMacAddress adds the macAddress to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithMacAddress(macAddress *string) *DcimInterfacesListParams { + o.SetMacAddress(macAddress) + return o +} + +// SetMacAddress adds the macAddress to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetMacAddress(macAddress *string) { + o.MacAddress = macAddress +} + +// WithMgmtOnly adds the mgmtOnly to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithMgmtOnly(mgmtOnly *string) *DcimInterfacesListParams { + o.SetMgmtOnly(mgmtOnly) + return o +} + +// SetMgmtOnly adds the mgmtOnly to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetMgmtOnly(mgmtOnly *string) { + o.MgmtOnly = mgmtOnly +} + +// WithMtu adds the mtu to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithMtu(mtu *float64) *DcimInterfacesListParams { + o.SetMtu(mtu) + return o +} + +// SetMtu adds the mtu to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetMtu(mtu *float64) { + o.Mtu = mtu +} + +// WithName adds the name to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithName(name *string) *DcimInterfacesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithOffset(offset *int64) *DcimInterfacesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithType adds the typeVar to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithType(typeVar *string) *DcimInterfacesListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfacesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID float64 + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := swag.FormatFloat64(qrDeviceID) + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.Enabled != nil { + + // query param enabled + var qrEnabled string + if o.Enabled != nil { + qrEnabled = *o.Enabled + } + qEnabled := qrEnabled + if qEnabled != "" { + if err := r.SetQueryParam("enabled", qEnabled); err != nil { + return err + } + } + + } + + if o.FormFactor != nil { + + // query param form_factor + var qrFormFactor string + if o.FormFactor != nil { + qrFormFactor = *o.FormFactor + } + qFormFactor := qrFormFactor + if qFormFactor != "" { + if err := r.SetQueryParam("form_factor", qFormFactor); err != nil { + return err + } + } + + } + + if o.LagID != nil { + + // query param lag_id + var qrLagID string + if o.LagID != nil { + qrLagID = *o.LagID + } + qLagID := qrLagID + if qLagID != "" { + if err := r.SetQueryParam("lag_id", qLagID); 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.MacAddress != nil { + + // query param mac_address + var qrMacAddress string + if o.MacAddress != nil { + qrMacAddress = *o.MacAddress + } + qMacAddress := qrMacAddress + if qMacAddress != "" { + if err := r.SetQueryParam("mac_address", qMacAddress); err != nil { + return err + } + } + + } + + if o.MgmtOnly != nil { + + // query param mgmt_only + var qrMgmtOnly string + if o.MgmtOnly != nil { + qrMgmtOnly = *o.MgmtOnly + } + qMgmtOnly := qrMgmtOnly + if qMgmtOnly != "" { + if err := r.SetQueryParam("mgmt_only", qMgmtOnly); err != nil { + return err + } + } + + } + + if o.Mtu != nil { + + // query param mtu + var qrMtu float64 + if o.Mtu != nil { + qrMtu = *o.Mtu + } + qMtu := swag.FormatFloat64(qrMtu) + if qMtu != "" { + if err := r.SetQueryParam("mtu", qMtu); 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.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.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_list_responses.go new file mode 100644 index 0000000..5245ff7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInterfacesListReader is a Reader for the DcimInterfacesList structure. +type DcimInterfacesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfacesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfacesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfacesListOK creates a DcimInterfacesListOK with default headers values +func NewDcimInterfacesListOK() *DcimInterfacesListOK { + return &DcimInterfacesListOK{} +} + +/*DcimInterfacesListOK handles this case with default header values. + +DcimInterfacesListOK dcim interfaces list o k +*/ +type DcimInterfacesListOK struct { + Payload *models.DcimInterfacesListOKBody +} + +func (o *DcimInterfacesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/interfaces/][%d] dcimInterfacesListOK %+v", 200, o.Payload) +} + +func (o *DcimInterfacesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimInterfacesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_partial_update_parameters.go new file mode 100644 index 0000000..169b7e0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimInterfacesPartialUpdateParams creates a new DcimInterfacesPartialUpdateParams object +// with the default values initialized. +func NewDcimInterfacesPartialUpdateParams() *DcimInterfacesPartialUpdateParams { + var () + return &DcimInterfacesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfacesPartialUpdateParamsWithTimeout creates a new DcimInterfacesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfacesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimInterfacesPartialUpdateParams { + var () + return &DcimInterfacesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfacesPartialUpdateParamsWithContext creates a new DcimInterfacesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfacesPartialUpdateParamsWithContext(ctx context.Context) *DcimInterfacesPartialUpdateParams { + var () + return &DcimInterfacesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimInterfacesPartialUpdateParamsWithHTTPClient creates a new DcimInterfacesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfacesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimInterfacesPartialUpdateParams { + var () + return &DcimInterfacesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimInterfacesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim interfaces partial update operation typically these are written to a http.Request +*/ +type DcimInterfacesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableInterface + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimInterfacesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) WithContext(ctx context.Context) *DcimInterfacesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimInterfacesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) WithData(data *models.WritableInterface) *DcimInterfacesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) SetData(data *models.WritableInterface) { + o.Data = data +} + +// WithID adds the id to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) WithID(id int64) *DcimInterfacesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfacesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_partial_update_responses.go new file mode 100644 index 0000000..1a84d55 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInterfacesPartialUpdateReader is a Reader for the DcimInterfacesPartialUpdate structure. +type DcimInterfacesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfacesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfacesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfacesPartialUpdateOK creates a DcimInterfacesPartialUpdateOK with default headers values +func NewDcimInterfacesPartialUpdateOK() *DcimInterfacesPartialUpdateOK { + return &DcimInterfacesPartialUpdateOK{} +} + +/*DcimInterfacesPartialUpdateOK handles this case with default header values. + +DcimInterfacesPartialUpdateOK dcim interfaces partial update o k +*/ +type DcimInterfacesPartialUpdateOK struct { + Payload *models.WritableInterface +} + +func (o *DcimInterfacesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/interfaces/{id}/][%d] dcimInterfacesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimInterfacesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterface) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_read_parameters.go new file mode 100644 index 0000000..82f40ba --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimInterfacesReadParams creates a new DcimInterfacesReadParams object +// with the default values initialized. +func NewDcimInterfacesReadParams() *DcimInterfacesReadParams { + var () + return &DcimInterfacesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfacesReadParamsWithTimeout creates a new DcimInterfacesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfacesReadParamsWithTimeout(timeout time.Duration) *DcimInterfacesReadParams { + var () + return &DcimInterfacesReadParams{ + + timeout: timeout, + } +} + +// NewDcimInterfacesReadParamsWithContext creates a new DcimInterfacesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfacesReadParamsWithContext(ctx context.Context) *DcimInterfacesReadParams { + var () + return &DcimInterfacesReadParams{ + + Context: ctx, + } +} + +// NewDcimInterfacesReadParamsWithHTTPClient creates a new DcimInterfacesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfacesReadParamsWithHTTPClient(client *http.Client) *DcimInterfacesReadParams { + var () + return &DcimInterfacesReadParams{ + HTTPClient: client, + } +} + +/*DcimInterfacesReadParams contains all the parameters to send to the API endpoint +for the dcim interfaces read operation typically these are written to a http.Request +*/ +type DcimInterfacesReadParams struct { + + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interfaces read params +func (o *DcimInterfacesReadParams) WithTimeout(timeout time.Duration) *DcimInterfacesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interfaces read params +func (o *DcimInterfacesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interfaces read params +func (o *DcimInterfacesReadParams) WithContext(ctx context.Context) *DcimInterfacesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interfaces read params +func (o *DcimInterfacesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interfaces read params +func (o *DcimInterfacesReadParams) WithHTTPClient(client *http.Client) *DcimInterfacesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interfaces read params +func (o *DcimInterfacesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim interfaces read params +func (o *DcimInterfacesReadParams) WithID(id int64) *DcimInterfacesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interfaces read params +func (o *DcimInterfacesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfacesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_read_responses.go new file mode 100644 index 0000000..415b3b5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInterfacesReadReader is a Reader for the DcimInterfacesRead structure. +type DcimInterfacesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfacesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfacesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfacesReadOK creates a DcimInterfacesReadOK with default headers values +func NewDcimInterfacesReadOK() *DcimInterfacesReadOK { + return &DcimInterfacesReadOK{} +} + +/*DcimInterfacesReadOK handles this case with default header values. + +DcimInterfacesReadOK dcim interfaces read o k +*/ +type DcimInterfacesReadOK struct { + Payload *models.Interface +} + +func (o *DcimInterfacesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/interfaces/{id}/][%d] dcimInterfacesReadOK %+v", 200, o.Payload) +} + +func (o *DcimInterfacesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Interface) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_update_parameters.go new file mode 100644 index 0000000..24fd20f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimInterfacesUpdateParams creates a new DcimInterfacesUpdateParams object +// with the default values initialized. +func NewDcimInterfacesUpdateParams() *DcimInterfacesUpdateParams { + var () + return &DcimInterfacesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfacesUpdateParamsWithTimeout creates a new DcimInterfacesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfacesUpdateParamsWithTimeout(timeout time.Duration) *DcimInterfacesUpdateParams { + var () + return &DcimInterfacesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfacesUpdateParamsWithContext creates a new DcimInterfacesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfacesUpdateParamsWithContext(ctx context.Context) *DcimInterfacesUpdateParams { + var () + return &DcimInterfacesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimInterfacesUpdateParamsWithHTTPClient creates a new DcimInterfacesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfacesUpdateParamsWithHTTPClient(client *http.Client) *DcimInterfacesUpdateParams { + var () + return &DcimInterfacesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimInterfacesUpdateParams contains all the parameters to send to the API endpoint +for the dcim interfaces update operation typically these are written to a http.Request +*/ +type DcimInterfacesUpdateParams struct { + + /*Data*/ + Data *models.WritableInterface + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) WithTimeout(timeout time.Duration) *DcimInterfacesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) WithContext(ctx context.Context) *DcimInterfacesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) WithHTTPClient(client *http.Client) *DcimInterfacesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) WithData(data *models.WritableInterface) *DcimInterfacesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) SetData(data *models.WritableInterface) { + o.Data = data +} + +// WithID adds the id to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) WithID(id int64) *DcimInterfacesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfacesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_update_responses.go new file mode 100644 index 0000000..f96bc0a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_interfaces_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInterfacesUpdateReader is a Reader for the DcimInterfacesUpdate structure. +type DcimInterfacesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfacesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfacesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfacesUpdateOK creates a DcimInterfacesUpdateOK with default headers values +func NewDcimInterfacesUpdateOK() *DcimInterfacesUpdateOK { + return &DcimInterfacesUpdateOK{} +} + +/*DcimInterfacesUpdateOK handles this case with default header values. + +DcimInterfacesUpdateOK dcim interfaces update o k +*/ +type DcimInterfacesUpdateOK struct { + Payload *models.WritableInterface +} + +func (o *DcimInterfacesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/interfaces/{id}/][%d] dcimInterfacesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimInterfacesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterface) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_create_parameters.go new file mode 100644 index 0000000..3319bf7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimInventoryItemsCreateParams creates a new DcimInventoryItemsCreateParams object +// with the default values initialized. +func NewDcimInventoryItemsCreateParams() *DcimInventoryItemsCreateParams { + var () + return &DcimInventoryItemsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInventoryItemsCreateParamsWithTimeout creates a new DcimInventoryItemsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInventoryItemsCreateParamsWithTimeout(timeout time.Duration) *DcimInventoryItemsCreateParams { + var () + return &DcimInventoryItemsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimInventoryItemsCreateParamsWithContext creates a new DcimInventoryItemsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInventoryItemsCreateParamsWithContext(ctx context.Context) *DcimInventoryItemsCreateParams { + var () + return &DcimInventoryItemsCreateParams{ + + Context: ctx, + } +} + +// NewDcimInventoryItemsCreateParamsWithHTTPClient creates a new DcimInventoryItemsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInventoryItemsCreateParamsWithHTTPClient(client *http.Client) *DcimInventoryItemsCreateParams { + var () + return &DcimInventoryItemsCreateParams{ + HTTPClient: client, + } +} + +/*DcimInventoryItemsCreateParams contains all the parameters to send to the API endpoint +for the dcim inventory items create operation typically these are written to a http.Request +*/ +type DcimInventoryItemsCreateParams struct { + + /*Data*/ + Data *models.WritableInventoryItem + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim inventory items create params +func (o *DcimInventoryItemsCreateParams) WithTimeout(timeout time.Duration) *DcimInventoryItemsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim inventory items create params +func (o *DcimInventoryItemsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim inventory items create params +func (o *DcimInventoryItemsCreateParams) WithContext(ctx context.Context) *DcimInventoryItemsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim inventory items create params +func (o *DcimInventoryItemsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim inventory items create params +func (o *DcimInventoryItemsCreateParams) WithHTTPClient(client *http.Client) *DcimInventoryItemsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim inventory items create params +func (o *DcimInventoryItemsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim inventory items create params +func (o *DcimInventoryItemsCreateParams) WithData(data *models.WritableInventoryItem) *DcimInventoryItemsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim inventory items create params +func (o *DcimInventoryItemsCreateParams) SetData(data *models.WritableInventoryItem) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInventoryItemsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_create_responses.go new file mode 100644 index 0000000..3dac366 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInventoryItemsCreateReader is a Reader for the DcimInventoryItemsCreate structure. +type DcimInventoryItemsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInventoryItemsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimInventoryItemsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInventoryItemsCreateCreated creates a DcimInventoryItemsCreateCreated with default headers values +func NewDcimInventoryItemsCreateCreated() *DcimInventoryItemsCreateCreated { + return &DcimInventoryItemsCreateCreated{} +} + +/*DcimInventoryItemsCreateCreated handles this case with default header values. + +DcimInventoryItemsCreateCreated dcim inventory items create created +*/ +type DcimInventoryItemsCreateCreated struct { + Payload *models.WritableInventoryItem +} + +func (o *DcimInventoryItemsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/inventory-items/][%d] dcimInventoryItemsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimInventoryItemsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInventoryItem) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_delete_parameters.go new file mode 100644 index 0000000..2ba49c2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimInventoryItemsDeleteParams creates a new DcimInventoryItemsDeleteParams object +// with the default values initialized. +func NewDcimInventoryItemsDeleteParams() *DcimInventoryItemsDeleteParams { + var () + return &DcimInventoryItemsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInventoryItemsDeleteParamsWithTimeout creates a new DcimInventoryItemsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInventoryItemsDeleteParamsWithTimeout(timeout time.Duration) *DcimInventoryItemsDeleteParams { + var () + return &DcimInventoryItemsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimInventoryItemsDeleteParamsWithContext creates a new DcimInventoryItemsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInventoryItemsDeleteParamsWithContext(ctx context.Context) *DcimInventoryItemsDeleteParams { + var () + return &DcimInventoryItemsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimInventoryItemsDeleteParamsWithHTTPClient creates a new DcimInventoryItemsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInventoryItemsDeleteParamsWithHTTPClient(client *http.Client) *DcimInventoryItemsDeleteParams { + var () + return &DcimInventoryItemsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimInventoryItemsDeleteParams contains all the parameters to send to the API endpoint +for the dcim inventory items delete operation typically these are written to a http.Request +*/ +type DcimInventoryItemsDeleteParams struct { + + /*ID + A unique integer value identifying this inventory item. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim inventory items delete params +func (o *DcimInventoryItemsDeleteParams) WithTimeout(timeout time.Duration) *DcimInventoryItemsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim inventory items delete params +func (o *DcimInventoryItemsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim inventory items delete params +func (o *DcimInventoryItemsDeleteParams) WithContext(ctx context.Context) *DcimInventoryItemsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim inventory items delete params +func (o *DcimInventoryItemsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim inventory items delete params +func (o *DcimInventoryItemsDeleteParams) WithHTTPClient(client *http.Client) *DcimInventoryItemsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim inventory items delete params +func (o *DcimInventoryItemsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim inventory items delete params +func (o *DcimInventoryItemsDeleteParams) WithID(id int64) *DcimInventoryItemsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim inventory items delete params +func (o *DcimInventoryItemsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInventoryItemsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_delete_responses.go new file mode 100644 index 0000000..79e6d57 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimInventoryItemsDeleteReader is a Reader for the DcimInventoryItemsDelete structure. +type DcimInventoryItemsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInventoryItemsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimInventoryItemsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInventoryItemsDeleteNoContent creates a DcimInventoryItemsDeleteNoContent with default headers values +func NewDcimInventoryItemsDeleteNoContent() *DcimInventoryItemsDeleteNoContent { + return &DcimInventoryItemsDeleteNoContent{} +} + +/*DcimInventoryItemsDeleteNoContent handles this case with default header values. + +DcimInventoryItemsDeleteNoContent dcim inventory items delete no content +*/ +type DcimInventoryItemsDeleteNoContent struct { +} + +func (o *DcimInventoryItemsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/inventory-items/{id}/][%d] dcimInventoryItemsDeleteNoContent ", 204) +} + +func (o *DcimInventoryItemsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_list_parameters.go new file mode 100644 index 0000000..2df9620 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_list_parameters.go @@ -0,0 +1,514 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimInventoryItemsListParams creates a new DcimInventoryItemsListParams object +// with the default values initialized. +func NewDcimInventoryItemsListParams() *DcimInventoryItemsListParams { + var () + return &DcimInventoryItemsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInventoryItemsListParamsWithTimeout creates a new DcimInventoryItemsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInventoryItemsListParamsWithTimeout(timeout time.Duration) *DcimInventoryItemsListParams { + var () + return &DcimInventoryItemsListParams{ + + timeout: timeout, + } +} + +// NewDcimInventoryItemsListParamsWithContext creates a new DcimInventoryItemsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInventoryItemsListParamsWithContext(ctx context.Context) *DcimInventoryItemsListParams { + var () + return &DcimInventoryItemsListParams{ + + Context: ctx, + } +} + +// NewDcimInventoryItemsListParamsWithHTTPClient creates a new DcimInventoryItemsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInventoryItemsListParamsWithHTTPClient(client *http.Client) *DcimInventoryItemsListParams { + var () + return &DcimInventoryItemsListParams{ + HTTPClient: client, + } +} + +/*DcimInventoryItemsListParams contains all the parameters to send to the API endpoint +for the dcim inventory items list operation typically these are written to a http.Request +*/ +type DcimInventoryItemsListParams struct { + + /*AssetTag*/ + AssetTag *string + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*Discovered*/ + Discovered *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Manufacturer*/ + Manufacturer *string + /*ManufacturerID*/ + ManufacturerID *string + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*ParentID*/ + ParentID *string + /*PartID*/ + PartID *string + /*Q*/ + Q *string + /*Serial*/ + Serial *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithTimeout(timeout time.Duration) *DcimInventoryItemsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithContext(ctx context.Context) *DcimInventoryItemsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithHTTPClient(client *http.Client) *DcimInventoryItemsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAssetTag adds the assetTag to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithAssetTag(assetTag *string) *DcimInventoryItemsListParams { + o.SetAssetTag(assetTag) + return o +} + +// SetAssetTag adds the assetTag to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetAssetTag(assetTag *string) { + o.AssetTag = assetTag +} + +// WithDevice adds the device to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithDevice(device *string) *DcimInventoryItemsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithDeviceID(deviceID *string) *DcimInventoryItemsListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithDiscovered adds the discovered to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithDiscovered(discovered *string) *DcimInventoryItemsListParams { + o.SetDiscovered(discovered) + return o +} + +// SetDiscovered adds the discovered to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetDiscovered(discovered *string) { + o.Discovered = discovered +} + +// WithLimit adds the limit to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithLimit(limit *int64) *DcimInventoryItemsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithManufacturer adds the manufacturer to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithManufacturer(manufacturer *string) *DcimInventoryItemsListParams { + o.SetManufacturer(manufacturer) + return o +} + +// SetManufacturer adds the manufacturer to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetManufacturer(manufacturer *string) { + o.Manufacturer = manufacturer +} + +// WithManufacturerID adds the manufacturerID to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithManufacturerID(manufacturerID *string) *DcimInventoryItemsListParams { + o.SetManufacturerID(manufacturerID) + return o +} + +// SetManufacturerID adds the manufacturerId to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetManufacturerID(manufacturerID *string) { + o.ManufacturerID = manufacturerID +} + +// WithName adds the name to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithName(name *string) *DcimInventoryItemsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithOffset(offset *int64) *DcimInventoryItemsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithParentID adds the parentID to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithParentID(parentID *string) *DcimInventoryItemsListParams { + o.SetParentID(parentID) + return o +} + +// SetParentID adds the parentId to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetParentID(parentID *string) { + o.ParentID = parentID +} + +// WithPartID adds the partID to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithPartID(partID *string) *DcimInventoryItemsListParams { + o.SetPartID(partID) + return o +} + +// SetPartID adds the partId to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetPartID(partID *string) { + o.PartID = partID +} + +// WithQ adds the q to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithQ(q *string) *DcimInventoryItemsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetQ(q *string) { + o.Q = q +} + +// WithSerial adds the serial to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithSerial(serial *string) *DcimInventoryItemsListParams { + o.SetSerial(serial) + return o +} + +// SetSerial adds the serial to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetSerial(serial *string) { + o.Serial = serial +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInventoryItemsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AssetTag != nil { + + // query param asset_tag + var qrAssetTag string + if o.AssetTag != nil { + qrAssetTag = *o.AssetTag + } + qAssetTag := qrAssetTag + if qAssetTag != "" { + if err := r.SetQueryParam("asset_tag", qAssetTag); err != nil { + return err + } + } + + } + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.Discovered != nil { + + // query param discovered + var qrDiscovered string + if o.Discovered != nil { + qrDiscovered = *o.Discovered + } + qDiscovered := qrDiscovered + if qDiscovered != "" { + if err := r.SetQueryParam("discovered", qDiscovered); 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.Manufacturer != nil { + + // query param manufacturer + var qrManufacturer string + if o.Manufacturer != nil { + qrManufacturer = *o.Manufacturer + } + qManufacturer := qrManufacturer + if qManufacturer != "" { + if err := r.SetQueryParam("manufacturer", qManufacturer); err != nil { + return err + } + } + + } + + if o.ManufacturerID != nil { + + // query param manufacturer_id + var qrManufacturerID string + if o.ManufacturerID != nil { + qrManufacturerID = *o.ManufacturerID + } + qManufacturerID := qrManufacturerID + if qManufacturerID != "" { + if err := r.SetQueryParam("manufacturer_id", qManufacturerID); 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.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.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.PartID != nil { + + // query param part_id + var qrPartID string + if o.PartID != nil { + qrPartID = *o.PartID + } + qPartID := qrPartID + if qPartID != "" { + if err := r.SetQueryParam("part_id", qPartID); 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.Serial != nil { + + // query param serial + var qrSerial string + if o.Serial != nil { + qrSerial = *o.Serial + } + qSerial := qrSerial + if qSerial != "" { + if err := r.SetQueryParam("serial", qSerial); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_list_responses.go new file mode 100644 index 0000000..0aea08a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInventoryItemsListReader is a Reader for the DcimInventoryItemsList structure. +type DcimInventoryItemsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInventoryItemsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInventoryItemsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInventoryItemsListOK creates a DcimInventoryItemsListOK with default headers values +func NewDcimInventoryItemsListOK() *DcimInventoryItemsListOK { + return &DcimInventoryItemsListOK{} +} + +/*DcimInventoryItemsListOK handles this case with default header values. + +DcimInventoryItemsListOK dcim inventory items list o k +*/ +type DcimInventoryItemsListOK struct { + Payload *models.DcimInventoryItemsListOKBody +} + +func (o *DcimInventoryItemsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/inventory-items/][%d] dcimInventoryItemsListOK %+v", 200, o.Payload) +} + +func (o *DcimInventoryItemsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimInventoryItemsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_partial_update_parameters.go new file mode 100644 index 0000000..81ab220 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimInventoryItemsPartialUpdateParams creates a new DcimInventoryItemsPartialUpdateParams object +// with the default values initialized. +func NewDcimInventoryItemsPartialUpdateParams() *DcimInventoryItemsPartialUpdateParams { + var () + return &DcimInventoryItemsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInventoryItemsPartialUpdateParamsWithTimeout creates a new DcimInventoryItemsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInventoryItemsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimInventoryItemsPartialUpdateParams { + var () + return &DcimInventoryItemsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimInventoryItemsPartialUpdateParamsWithContext creates a new DcimInventoryItemsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInventoryItemsPartialUpdateParamsWithContext(ctx context.Context) *DcimInventoryItemsPartialUpdateParams { + var () + return &DcimInventoryItemsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimInventoryItemsPartialUpdateParamsWithHTTPClient creates a new DcimInventoryItemsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInventoryItemsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimInventoryItemsPartialUpdateParams { + var () + return &DcimInventoryItemsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimInventoryItemsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim inventory items partial update operation typically these are written to a http.Request +*/ +type DcimInventoryItemsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableInventoryItem + /*ID + A unique integer value identifying this inventory item. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimInventoryItemsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) WithContext(ctx context.Context) *DcimInventoryItemsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimInventoryItemsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) WithData(data *models.WritableInventoryItem) *DcimInventoryItemsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) SetData(data *models.WritableInventoryItem) { + o.Data = data +} + +// WithID adds the id to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) WithID(id int64) *DcimInventoryItemsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInventoryItemsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_partial_update_responses.go new file mode 100644 index 0000000..54bb7e4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInventoryItemsPartialUpdateReader is a Reader for the DcimInventoryItemsPartialUpdate structure. +type DcimInventoryItemsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInventoryItemsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInventoryItemsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInventoryItemsPartialUpdateOK creates a DcimInventoryItemsPartialUpdateOK with default headers values +func NewDcimInventoryItemsPartialUpdateOK() *DcimInventoryItemsPartialUpdateOK { + return &DcimInventoryItemsPartialUpdateOK{} +} + +/*DcimInventoryItemsPartialUpdateOK handles this case with default header values. + +DcimInventoryItemsPartialUpdateOK dcim inventory items partial update o k +*/ +type DcimInventoryItemsPartialUpdateOK struct { + Payload *models.WritableInventoryItem +} + +func (o *DcimInventoryItemsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/inventory-items/{id}/][%d] dcimInventoryItemsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimInventoryItemsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInventoryItem) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_read_parameters.go new file mode 100644 index 0000000..a0161a9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimInventoryItemsReadParams creates a new DcimInventoryItemsReadParams object +// with the default values initialized. +func NewDcimInventoryItemsReadParams() *DcimInventoryItemsReadParams { + var () + return &DcimInventoryItemsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInventoryItemsReadParamsWithTimeout creates a new DcimInventoryItemsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInventoryItemsReadParamsWithTimeout(timeout time.Duration) *DcimInventoryItemsReadParams { + var () + return &DcimInventoryItemsReadParams{ + + timeout: timeout, + } +} + +// NewDcimInventoryItemsReadParamsWithContext creates a new DcimInventoryItemsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInventoryItemsReadParamsWithContext(ctx context.Context) *DcimInventoryItemsReadParams { + var () + return &DcimInventoryItemsReadParams{ + + Context: ctx, + } +} + +// NewDcimInventoryItemsReadParamsWithHTTPClient creates a new DcimInventoryItemsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInventoryItemsReadParamsWithHTTPClient(client *http.Client) *DcimInventoryItemsReadParams { + var () + return &DcimInventoryItemsReadParams{ + HTTPClient: client, + } +} + +/*DcimInventoryItemsReadParams contains all the parameters to send to the API endpoint +for the dcim inventory items read operation typically these are written to a http.Request +*/ +type DcimInventoryItemsReadParams struct { + + /*ID + A unique integer value identifying this inventory item. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim inventory items read params +func (o *DcimInventoryItemsReadParams) WithTimeout(timeout time.Duration) *DcimInventoryItemsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim inventory items read params +func (o *DcimInventoryItemsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim inventory items read params +func (o *DcimInventoryItemsReadParams) WithContext(ctx context.Context) *DcimInventoryItemsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim inventory items read params +func (o *DcimInventoryItemsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim inventory items read params +func (o *DcimInventoryItemsReadParams) WithHTTPClient(client *http.Client) *DcimInventoryItemsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim inventory items read params +func (o *DcimInventoryItemsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim inventory items read params +func (o *DcimInventoryItemsReadParams) WithID(id int64) *DcimInventoryItemsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim inventory items read params +func (o *DcimInventoryItemsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInventoryItemsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_read_responses.go new file mode 100644 index 0000000..4e07cce --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInventoryItemsReadReader is a Reader for the DcimInventoryItemsRead structure. +type DcimInventoryItemsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInventoryItemsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInventoryItemsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInventoryItemsReadOK creates a DcimInventoryItemsReadOK with default headers values +func NewDcimInventoryItemsReadOK() *DcimInventoryItemsReadOK { + return &DcimInventoryItemsReadOK{} +} + +/*DcimInventoryItemsReadOK handles this case with default header values. + +DcimInventoryItemsReadOK dcim inventory items read o k +*/ +type DcimInventoryItemsReadOK struct { + Payload *models.InventoryItem +} + +func (o *DcimInventoryItemsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/inventory-items/{id}/][%d] dcimInventoryItemsReadOK %+v", 200, o.Payload) +} + +func (o *DcimInventoryItemsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InventoryItem) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_update_parameters.go new file mode 100644 index 0000000..cc74879 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimInventoryItemsUpdateParams creates a new DcimInventoryItemsUpdateParams object +// with the default values initialized. +func NewDcimInventoryItemsUpdateParams() *DcimInventoryItemsUpdateParams { + var () + return &DcimInventoryItemsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInventoryItemsUpdateParamsWithTimeout creates a new DcimInventoryItemsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInventoryItemsUpdateParamsWithTimeout(timeout time.Duration) *DcimInventoryItemsUpdateParams { + var () + return &DcimInventoryItemsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimInventoryItemsUpdateParamsWithContext creates a new DcimInventoryItemsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInventoryItemsUpdateParamsWithContext(ctx context.Context) *DcimInventoryItemsUpdateParams { + var () + return &DcimInventoryItemsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimInventoryItemsUpdateParamsWithHTTPClient creates a new DcimInventoryItemsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInventoryItemsUpdateParamsWithHTTPClient(client *http.Client) *DcimInventoryItemsUpdateParams { + var () + return &DcimInventoryItemsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimInventoryItemsUpdateParams contains all the parameters to send to the API endpoint +for the dcim inventory items update operation typically these are written to a http.Request +*/ +type DcimInventoryItemsUpdateParams struct { + + /*Data*/ + Data *models.WritableInventoryItem + /*ID + A unique integer value identifying this inventory item. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) WithTimeout(timeout time.Duration) *DcimInventoryItemsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) WithContext(ctx context.Context) *DcimInventoryItemsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) WithHTTPClient(client *http.Client) *DcimInventoryItemsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) WithData(data *models.WritableInventoryItem) *DcimInventoryItemsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) SetData(data *models.WritableInventoryItem) { + o.Data = data +} + +// WithID adds the id to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) WithID(id int64) *DcimInventoryItemsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInventoryItemsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_update_responses.go new file mode 100644 index 0000000..b915f00 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_inventory_items_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimInventoryItemsUpdateReader is a Reader for the DcimInventoryItemsUpdate structure. +type DcimInventoryItemsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInventoryItemsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInventoryItemsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInventoryItemsUpdateOK creates a DcimInventoryItemsUpdateOK with default headers values +func NewDcimInventoryItemsUpdateOK() *DcimInventoryItemsUpdateOK { + return &DcimInventoryItemsUpdateOK{} +} + +/*DcimInventoryItemsUpdateOK handles this case with default header values. + +DcimInventoryItemsUpdateOK dcim inventory items update o k +*/ +type DcimInventoryItemsUpdateOK struct { + Payload *models.WritableInventoryItem +} + +func (o *DcimInventoryItemsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/inventory-items/{id}/][%d] dcimInventoryItemsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimInventoryItemsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInventoryItem) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_create_parameters.go new file mode 100644 index 0000000..200dc0a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimManufacturersCreateParams creates a new DcimManufacturersCreateParams object +// with the default values initialized. +func NewDcimManufacturersCreateParams() *DcimManufacturersCreateParams { + var () + return &DcimManufacturersCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimManufacturersCreateParamsWithTimeout creates a new DcimManufacturersCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimManufacturersCreateParamsWithTimeout(timeout time.Duration) *DcimManufacturersCreateParams { + var () + return &DcimManufacturersCreateParams{ + + timeout: timeout, + } +} + +// NewDcimManufacturersCreateParamsWithContext creates a new DcimManufacturersCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimManufacturersCreateParamsWithContext(ctx context.Context) *DcimManufacturersCreateParams { + var () + return &DcimManufacturersCreateParams{ + + Context: ctx, + } +} + +// NewDcimManufacturersCreateParamsWithHTTPClient creates a new DcimManufacturersCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimManufacturersCreateParamsWithHTTPClient(client *http.Client) *DcimManufacturersCreateParams { + var () + return &DcimManufacturersCreateParams{ + HTTPClient: client, + } +} + +/*DcimManufacturersCreateParams contains all the parameters to send to the API endpoint +for the dcim manufacturers create operation typically these are written to a http.Request +*/ +type DcimManufacturersCreateParams struct { + + /*Data*/ + Data *models.Manufacturer + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim manufacturers create params +func (o *DcimManufacturersCreateParams) WithTimeout(timeout time.Duration) *DcimManufacturersCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim manufacturers create params +func (o *DcimManufacturersCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim manufacturers create params +func (o *DcimManufacturersCreateParams) WithContext(ctx context.Context) *DcimManufacturersCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim manufacturers create params +func (o *DcimManufacturersCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim manufacturers create params +func (o *DcimManufacturersCreateParams) WithHTTPClient(client *http.Client) *DcimManufacturersCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim manufacturers create params +func (o *DcimManufacturersCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim manufacturers create params +func (o *DcimManufacturersCreateParams) WithData(data *models.Manufacturer) *DcimManufacturersCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim manufacturers create params +func (o *DcimManufacturersCreateParams) SetData(data *models.Manufacturer) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimManufacturersCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_create_responses.go new file mode 100644 index 0000000..f0afa25 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimManufacturersCreateReader is a Reader for the DcimManufacturersCreate structure. +type DcimManufacturersCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimManufacturersCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimManufacturersCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimManufacturersCreateCreated creates a DcimManufacturersCreateCreated with default headers values +func NewDcimManufacturersCreateCreated() *DcimManufacturersCreateCreated { + return &DcimManufacturersCreateCreated{} +} + +/*DcimManufacturersCreateCreated handles this case with default header values. + +DcimManufacturersCreateCreated dcim manufacturers create created +*/ +type DcimManufacturersCreateCreated struct { + Payload *models.Manufacturer +} + +func (o *DcimManufacturersCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/manufacturers/][%d] dcimManufacturersCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimManufacturersCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Manufacturer) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_delete_parameters.go new file mode 100644 index 0000000..01472a9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimManufacturersDeleteParams creates a new DcimManufacturersDeleteParams object +// with the default values initialized. +func NewDcimManufacturersDeleteParams() *DcimManufacturersDeleteParams { + var () + return &DcimManufacturersDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimManufacturersDeleteParamsWithTimeout creates a new DcimManufacturersDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimManufacturersDeleteParamsWithTimeout(timeout time.Duration) *DcimManufacturersDeleteParams { + var () + return &DcimManufacturersDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimManufacturersDeleteParamsWithContext creates a new DcimManufacturersDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimManufacturersDeleteParamsWithContext(ctx context.Context) *DcimManufacturersDeleteParams { + var () + return &DcimManufacturersDeleteParams{ + + Context: ctx, + } +} + +// NewDcimManufacturersDeleteParamsWithHTTPClient creates a new DcimManufacturersDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimManufacturersDeleteParamsWithHTTPClient(client *http.Client) *DcimManufacturersDeleteParams { + var () + return &DcimManufacturersDeleteParams{ + HTTPClient: client, + } +} + +/*DcimManufacturersDeleteParams contains all the parameters to send to the API endpoint +for the dcim manufacturers delete operation typically these are written to a http.Request +*/ +type DcimManufacturersDeleteParams struct { + + /*ID + A unique integer value identifying this manufacturer. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim manufacturers delete params +func (o *DcimManufacturersDeleteParams) WithTimeout(timeout time.Duration) *DcimManufacturersDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim manufacturers delete params +func (o *DcimManufacturersDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim manufacturers delete params +func (o *DcimManufacturersDeleteParams) WithContext(ctx context.Context) *DcimManufacturersDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim manufacturers delete params +func (o *DcimManufacturersDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim manufacturers delete params +func (o *DcimManufacturersDeleteParams) WithHTTPClient(client *http.Client) *DcimManufacturersDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim manufacturers delete params +func (o *DcimManufacturersDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim manufacturers delete params +func (o *DcimManufacturersDeleteParams) WithID(id int64) *DcimManufacturersDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim manufacturers delete params +func (o *DcimManufacturersDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimManufacturersDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_delete_responses.go new file mode 100644 index 0000000..f5e67e6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimManufacturersDeleteReader is a Reader for the DcimManufacturersDelete structure. +type DcimManufacturersDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimManufacturersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimManufacturersDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimManufacturersDeleteNoContent creates a DcimManufacturersDeleteNoContent with default headers values +func NewDcimManufacturersDeleteNoContent() *DcimManufacturersDeleteNoContent { + return &DcimManufacturersDeleteNoContent{} +} + +/*DcimManufacturersDeleteNoContent handles this case with default header values. + +DcimManufacturersDeleteNoContent dcim manufacturers delete no content +*/ +type DcimManufacturersDeleteNoContent struct { +} + +func (o *DcimManufacturersDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/manufacturers/{id}/][%d] dcimManufacturersDeleteNoContent ", 204) +} + +func (o *DcimManufacturersDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_list_parameters.go new file mode 100644 index 0000000..d741f3e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_list_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimManufacturersListParams creates a new DcimManufacturersListParams object +// with the default values initialized. +func NewDcimManufacturersListParams() *DcimManufacturersListParams { + var () + return &DcimManufacturersListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimManufacturersListParamsWithTimeout creates a new DcimManufacturersListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimManufacturersListParamsWithTimeout(timeout time.Duration) *DcimManufacturersListParams { + var () + return &DcimManufacturersListParams{ + + timeout: timeout, + } +} + +// NewDcimManufacturersListParamsWithContext creates a new DcimManufacturersListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimManufacturersListParamsWithContext(ctx context.Context) *DcimManufacturersListParams { + var () + return &DcimManufacturersListParams{ + + Context: ctx, + } +} + +// NewDcimManufacturersListParamsWithHTTPClient creates a new DcimManufacturersListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimManufacturersListParamsWithHTTPClient(client *http.Client) *DcimManufacturersListParams { + var () + return &DcimManufacturersListParams{ + HTTPClient: client, + } +} + +/*DcimManufacturersListParams contains all the parameters to send to the API endpoint +for the dcim manufacturers list operation typically these are written to a http.Request +*/ +type DcimManufacturersListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithTimeout(timeout time.Duration) *DcimManufacturersListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithContext(ctx context.Context) *DcimManufacturersListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithHTTPClient(client *http.Client) *DcimManufacturersListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithLimit(limit *int64) *DcimManufacturersListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithName(name *string) *DcimManufacturersListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithOffset(offset *int64) *DcimManufacturersListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithSlug(slug *string) *DcimManufacturersListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimManufacturersListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_list_responses.go new file mode 100644 index 0000000..ac2d046 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimManufacturersListReader is a Reader for the DcimManufacturersList structure. +type DcimManufacturersListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimManufacturersListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimManufacturersListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimManufacturersListOK creates a DcimManufacturersListOK with default headers values +func NewDcimManufacturersListOK() *DcimManufacturersListOK { + return &DcimManufacturersListOK{} +} + +/*DcimManufacturersListOK handles this case with default header values. + +DcimManufacturersListOK dcim manufacturers list o k +*/ +type DcimManufacturersListOK struct { + Payload *models.DcimManufacturersListOKBody +} + +func (o *DcimManufacturersListOK) Error() string { + return fmt.Sprintf("[GET /dcim/manufacturers/][%d] dcimManufacturersListOK %+v", 200, o.Payload) +} + +func (o *DcimManufacturersListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimManufacturersListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_partial_update_parameters.go new file mode 100644 index 0000000..03d10e4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimManufacturersPartialUpdateParams creates a new DcimManufacturersPartialUpdateParams object +// with the default values initialized. +func NewDcimManufacturersPartialUpdateParams() *DcimManufacturersPartialUpdateParams { + var () + return &DcimManufacturersPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimManufacturersPartialUpdateParamsWithTimeout creates a new DcimManufacturersPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimManufacturersPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimManufacturersPartialUpdateParams { + var () + return &DcimManufacturersPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimManufacturersPartialUpdateParamsWithContext creates a new DcimManufacturersPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimManufacturersPartialUpdateParamsWithContext(ctx context.Context) *DcimManufacturersPartialUpdateParams { + var () + return &DcimManufacturersPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimManufacturersPartialUpdateParamsWithHTTPClient creates a new DcimManufacturersPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimManufacturersPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimManufacturersPartialUpdateParams { + var () + return &DcimManufacturersPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimManufacturersPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim manufacturers partial update operation typically these are written to a http.Request +*/ +type DcimManufacturersPartialUpdateParams struct { + + /*Data*/ + Data *models.Manufacturer + /*ID + A unique integer value identifying this manufacturer. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimManufacturersPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) WithContext(ctx context.Context) *DcimManufacturersPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimManufacturersPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) WithData(data *models.Manufacturer) *DcimManufacturersPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) SetData(data *models.Manufacturer) { + o.Data = data +} + +// WithID adds the id to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) WithID(id int64) *DcimManufacturersPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimManufacturersPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_partial_update_responses.go new file mode 100644 index 0000000..6e5826a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimManufacturersPartialUpdateReader is a Reader for the DcimManufacturersPartialUpdate structure. +type DcimManufacturersPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimManufacturersPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimManufacturersPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimManufacturersPartialUpdateOK creates a DcimManufacturersPartialUpdateOK with default headers values +func NewDcimManufacturersPartialUpdateOK() *DcimManufacturersPartialUpdateOK { + return &DcimManufacturersPartialUpdateOK{} +} + +/*DcimManufacturersPartialUpdateOK handles this case with default header values. + +DcimManufacturersPartialUpdateOK dcim manufacturers partial update o k +*/ +type DcimManufacturersPartialUpdateOK struct { + Payload *models.Manufacturer +} + +func (o *DcimManufacturersPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/manufacturers/{id}/][%d] dcimManufacturersPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimManufacturersPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Manufacturer) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_read_parameters.go new file mode 100644 index 0000000..1b54dbf --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimManufacturersReadParams creates a new DcimManufacturersReadParams object +// with the default values initialized. +func NewDcimManufacturersReadParams() *DcimManufacturersReadParams { + var () + return &DcimManufacturersReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimManufacturersReadParamsWithTimeout creates a new DcimManufacturersReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimManufacturersReadParamsWithTimeout(timeout time.Duration) *DcimManufacturersReadParams { + var () + return &DcimManufacturersReadParams{ + + timeout: timeout, + } +} + +// NewDcimManufacturersReadParamsWithContext creates a new DcimManufacturersReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimManufacturersReadParamsWithContext(ctx context.Context) *DcimManufacturersReadParams { + var () + return &DcimManufacturersReadParams{ + + Context: ctx, + } +} + +// NewDcimManufacturersReadParamsWithHTTPClient creates a new DcimManufacturersReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimManufacturersReadParamsWithHTTPClient(client *http.Client) *DcimManufacturersReadParams { + var () + return &DcimManufacturersReadParams{ + HTTPClient: client, + } +} + +/*DcimManufacturersReadParams contains all the parameters to send to the API endpoint +for the dcim manufacturers read operation typically these are written to a http.Request +*/ +type DcimManufacturersReadParams struct { + + /*ID + A unique integer value identifying this manufacturer. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim manufacturers read params +func (o *DcimManufacturersReadParams) WithTimeout(timeout time.Duration) *DcimManufacturersReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim manufacturers read params +func (o *DcimManufacturersReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim manufacturers read params +func (o *DcimManufacturersReadParams) WithContext(ctx context.Context) *DcimManufacturersReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim manufacturers read params +func (o *DcimManufacturersReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim manufacturers read params +func (o *DcimManufacturersReadParams) WithHTTPClient(client *http.Client) *DcimManufacturersReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim manufacturers read params +func (o *DcimManufacturersReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim manufacturers read params +func (o *DcimManufacturersReadParams) WithID(id int64) *DcimManufacturersReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim manufacturers read params +func (o *DcimManufacturersReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimManufacturersReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_read_responses.go new file mode 100644 index 0000000..1440577 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimManufacturersReadReader is a Reader for the DcimManufacturersRead structure. +type DcimManufacturersReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimManufacturersReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimManufacturersReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimManufacturersReadOK creates a DcimManufacturersReadOK with default headers values +func NewDcimManufacturersReadOK() *DcimManufacturersReadOK { + return &DcimManufacturersReadOK{} +} + +/*DcimManufacturersReadOK handles this case with default header values. + +DcimManufacturersReadOK dcim manufacturers read o k +*/ +type DcimManufacturersReadOK struct { + Payload *models.Manufacturer +} + +func (o *DcimManufacturersReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/manufacturers/{id}/][%d] dcimManufacturersReadOK %+v", 200, o.Payload) +} + +func (o *DcimManufacturersReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Manufacturer) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_update_parameters.go new file mode 100644 index 0000000..2782ce7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimManufacturersUpdateParams creates a new DcimManufacturersUpdateParams object +// with the default values initialized. +func NewDcimManufacturersUpdateParams() *DcimManufacturersUpdateParams { + var () + return &DcimManufacturersUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimManufacturersUpdateParamsWithTimeout creates a new DcimManufacturersUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimManufacturersUpdateParamsWithTimeout(timeout time.Duration) *DcimManufacturersUpdateParams { + var () + return &DcimManufacturersUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimManufacturersUpdateParamsWithContext creates a new DcimManufacturersUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimManufacturersUpdateParamsWithContext(ctx context.Context) *DcimManufacturersUpdateParams { + var () + return &DcimManufacturersUpdateParams{ + + Context: ctx, + } +} + +// NewDcimManufacturersUpdateParamsWithHTTPClient creates a new DcimManufacturersUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimManufacturersUpdateParamsWithHTTPClient(client *http.Client) *DcimManufacturersUpdateParams { + var () + return &DcimManufacturersUpdateParams{ + HTTPClient: client, + } +} + +/*DcimManufacturersUpdateParams contains all the parameters to send to the API endpoint +for the dcim manufacturers update operation typically these are written to a http.Request +*/ +type DcimManufacturersUpdateParams struct { + + /*Data*/ + Data *models.Manufacturer + /*ID + A unique integer value identifying this manufacturer. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) WithTimeout(timeout time.Duration) *DcimManufacturersUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) WithContext(ctx context.Context) *DcimManufacturersUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) WithHTTPClient(client *http.Client) *DcimManufacturersUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) WithData(data *models.Manufacturer) *DcimManufacturersUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) SetData(data *models.Manufacturer) { + o.Data = data +} + +// WithID adds the id to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) WithID(id int64) *DcimManufacturersUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimManufacturersUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_update_responses.go new file mode 100644 index 0000000..4d7da12 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_manufacturers_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimManufacturersUpdateReader is a Reader for the DcimManufacturersUpdate structure. +type DcimManufacturersUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimManufacturersUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimManufacturersUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimManufacturersUpdateOK creates a DcimManufacturersUpdateOK with default headers values +func NewDcimManufacturersUpdateOK() *DcimManufacturersUpdateOK { + return &DcimManufacturersUpdateOK{} +} + +/*DcimManufacturersUpdateOK handles this case with default header values. + +DcimManufacturersUpdateOK dcim manufacturers update o k +*/ +type DcimManufacturersUpdateOK struct { + Payload *models.Manufacturer +} + +func (o *DcimManufacturersUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/manufacturers/{id}/][%d] dcimManufacturersUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimManufacturersUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Manufacturer) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_create_parameters.go new file mode 100644 index 0000000..c3036b4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPlatformsCreateParams creates a new DcimPlatformsCreateParams object +// with the default values initialized. +func NewDcimPlatformsCreateParams() *DcimPlatformsCreateParams { + var () + return &DcimPlatformsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPlatformsCreateParamsWithTimeout creates a new DcimPlatformsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPlatformsCreateParamsWithTimeout(timeout time.Duration) *DcimPlatformsCreateParams { + var () + return &DcimPlatformsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimPlatformsCreateParamsWithContext creates a new DcimPlatformsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPlatformsCreateParamsWithContext(ctx context.Context) *DcimPlatformsCreateParams { + var () + return &DcimPlatformsCreateParams{ + + Context: ctx, + } +} + +// NewDcimPlatformsCreateParamsWithHTTPClient creates a new DcimPlatformsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPlatformsCreateParamsWithHTTPClient(client *http.Client) *DcimPlatformsCreateParams { + var () + return &DcimPlatformsCreateParams{ + HTTPClient: client, + } +} + +/*DcimPlatformsCreateParams contains all the parameters to send to the API endpoint +for the dcim platforms create operation typically these are written to a http.Request +*/ +type DcimPlatformsCreateParams struct { + + /*Data*/ + Data *models.WritablePlatform + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim platforms create params +func (o *DcimPlatformsCreateParams) WithTimeout(timeout time.Duration) *DcimPlatformsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim platforms create params +func (o *DcimPlatformsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim platforms create params +func (o *DcimPlatformsCreateParams) WithContext(ctx context.Context) *DcimPlatformsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim platforms create params +func (o *DcimPlatformsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim platforms create params +func (o *DcimPlatformsCreateParams) WithHTTPClient(client *http.Client) *DcimPlatformsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim platforms create params +func (o *DcimPlatformsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim platforms create params +func (o *DcimPlatformsCreateParams) WithData(data *models.WritablePlatform) *DcimPlatformsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim platforms create params +func (o *DcimPlatformsCreateParams) SetData(data *models.WritablePlatform) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPlatformsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_create_responses.go new file mode 100644 index 0000000..8450833 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPlatformsCreateReader is a Reader for the DcimPlatformsCreate structure. +type DcimPlatformsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPlatformsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimPlatformsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPlatformsCreateCreated creates a DcimPlatformsCreateCreated with default headers values +func NewDcimPlatformsCreateCreated() *DcimPlatformsCreateCreated { + return &DcimPlatformsCreateCreated{} +} + +/*DcimPlatformsCreateCreated handles this case with default header values. + +DcimPlatformsCreateCreated dcim platforms create created +*/ +type DcimPlatformsCreateCreated struct { + Payload *models.WritablePlatform +} + +func (o *DcimPlatformsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/platforms/][%d] dcimPlatformsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimPlatformsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePlatform) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_delete_parameters.go new file mode 100644 index 0000000..4807f41 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPlatformsDeleteParams creates a new DcimPlatformsDeleteParams object +// with the default values initialized. +func NewDcimPlatformsDeleteParams() *DcimPlatformsDeleteParams { + var () + return &DcimPlatformsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPlatformsDeleteParamsWithTimeout creates a new DcimPlatformsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPlatformsDeleteParamsWithTimeout(timeout time.Duration) *DcimPlatformsDeleteParams { + var () + return &DcimPlatformsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimPlatformsDeleteParamsWithContext creates a new DcimPlatformsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPlatformsDeleteParamsWithContext(ctx context.Context) *DcimPlatformsDeleteParams { + var () + return &DcimPlatformsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimPlatformsDeleteParamsWithHTTPClient creates a new DcimPlatformsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPlatformsDeleteParamsWithHTTPClient(client *http.Client) *DcimPlatformsDeleteParams { + var () + return &DcimPlatformsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimPlatformsDeleteParams contains all the parameters to send to the API endpoint +for the dcim platforms delete operation typically these are written to a http.Request +*/ +type DcimPlatformsDeleteParams struct { + + /*ID + A unique integer value identifying this platform. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim platforms delete params +func (o *DcimPlatformsDeleteParams) WithTimeout(timeout time.Duration) *DcimPlatformsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim platforms delete params +func (o *DcimPlatformsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim platforms delete params +func (o *DcimPlatformsDeleteParams) WithContext(ctx context.Context) *DcimPlatformsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim platforms delete params +func (o *DcimPlatformsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim platforms delete params +func (o *DcimPlatformsDeleteParams) WithHTTPClient(client *http.Client) *DcimPlatformsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim platforms delete params +func (o *DcimPlatformsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim platforms delete params +func (o *DcimPlatformsDeleteParams) WithID(id int64) *DcimPlatformsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim platforms delete params +func (o *DcimPlatformsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPlatformsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_delete_responses.go new file mode 100644 index 0000000..da9e3f9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimPlatformsDeleteReader is a Reader for the DcimPlatformsDelete structure. +type DcimPlatformsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPlatformsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimPlatformsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPlatformsDeleteNoContent creates a DcimPlatformsDeleteNoContent with default headers values +func NewDcimPlatformsDeleteNoContent() *DcimPlatformsDeleteNoContent { + return &DcimPlatformsDeleteNoContent{} +} + +/*DcimPlatformsDeleteNoContent handles this case with default header values. + +DcimPlatformsDeleteNoContent dcim platforms delete no content +*/ +type DcimPlatformsDeleteNoContent struct { +} + +func (o *DcimPlatformsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/platforms/{id}/][%d] dcimPlatformsDeleteNoContent ", 204) +} + +func (o *DcimPlatformsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_list_parameters.go new file mode 100644 index 0000000..85b2afd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_list_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPlatformsListParams creates a new DcimPlatformsListParams object +// with the default values initialized. +func NewDcimPlatformsListParams() *DcimPlatformsListParams { + var () + return &DcimPlatformsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPlatformsListParamsWithTimeout creates a new DcimPlatformsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPlatformsListParamsWithTimeout(timeout time.Duration) *DcimPlatformsListParams { + var () + return &DcimPlatformsListParams{ + + timeout: timeout, + } +} + +// NewDcimPlatformsListParamsWithContext creates a new DcimPlatformsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPlatformsListParamsWithContext(ctx context.Context) *DcimPlatformsListParams { + var () + return &DcimPlatformsListParams{ + + Context: ctx, + } +} + +// NewDcimPlatformsListParamsWithHTTPClient creates a new DcimPlatformsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPlatformsListParamsWithHTTPClient(client *http.Client) *DcimPlatformsListParams { + var () + return &DcimPlatformsListParams{ + HTTPClient: client, + } +} + +/*DcimPlatformsListParams contains all the parameters to send to the API endpoint +for the dcim platforms list operation typically these are written to a http.Request +*/ +type DcimPlatformsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Manufacturer*/ + Manufacturer *string + /*ManufacturerID*/ + ManufacturerID *string + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim platforms list params +func (o *DcimPlatformsListParams) WithTimeout(timeout time.Duration) *DcimPlatformsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim platforms list params +func (o *DcimPlatformsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim platforms list params +func (o *DcimPlatformsListParams) WithContext(ctx context.Context) *DcimPlatformsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim platforms list params +func (o *DcimPlatformsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim platforms list params +func (o *DcimPlatformsListParams) WithHTTPClient(client *http.Client) *DcimPlatformsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim platforms list params +func (o *DcimPlatformsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the dcim platforms list params +func (o *DcimPlatformsListParams) WithLimit(limit *int64) *DcimPlatformsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim platforms list params +func (o *DcimPlatformsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithManufacturer adds the manufacturer to the dcim platforms list params +func (o *DcimPlatformsListParams) WithManufacturer(manufacturer *string) *DcimPlatformsListParams { + o.SetManufacturer(manufacturer) + return o +} + +// SetManufacturer adds the manufacturer to the dcim platforms list params +func (o *DcimPlatformsListParams) SetManufacturer(manufacturer *string) { + o.Manufacturer = manufacturer +} + +// WithManufacturerID adds the manufacturerID to the dcim platforms list params +func (o *DcimPlatformsListParams) WithManufacturerID(manufacturerID *string) *DcimPlatformsListParams { + o.SetManufacturerID(manufacturerID) + return o +} + +// SetManufacturerID adds the manufacturerId to the dcim platforms list params +func (o *DcimPlatformsListParams) SetManufacturerID(manufacturerID *string) { + o.ManufacturerID = manufacturerID +} + +// WithName adds the name to the dcim platforms list params +func (o *DcimPlatformsListParams) WithName(name *string) *DcimPlatformsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim platforms list params +func (o *DcimPlatformsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim platforms list params +func (o *DcimPlatformsListParams) WithOffset(offset *int64) *DcimPlatformsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim platforms list params +func (o *DcimPlatformsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the dcim platforms list params +func (o *DcimPlatformsListParams) WithSlug(slug *string) *DcimPlatformsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the dcim platforms list params +func (o *DcimPlatformsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPlatformsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.Manufacturer != nil { + + // query param manufacturer + var qrManufacturer string + if o.Manufacturer != nil { + qrManufacturer = *o.Manufacturer + } + qManufacturer := qrManufacturer + if qManufacturer != "" { + if err := r.SetQueryParam("manufacturer", qManufacturer); err != nil { + return err + } + } + + } + + if o.ManufacturerID != nil { + + // query param manufacturer_id + var qrManufacturerID string + if o.ManufacturerID != nil { + qrManufacturerID = *o.ManufacturerID + } + qManufacturerID := qrManufacturerID + if qManufacturerID != "" { + if err := r.SetQueryParam("manufacturer_id", qManufacturerID); 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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_list_responses.go new file mode 100644 index 0000000..a1613b8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPlatformsListReader is a Reader for the DcimPlatformsList structure. +type DcimPlatformsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPlatformsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPlatformsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPlatformsListOK creates a DcimPlatformsListOK with default headers values +func NewDcimPlatformsListOK() *DcimPlatformsListOK { + return &DcimPlatformsListOK{} +} + +/*DcimPlatformsListOK handles this case with default header values. + +DcimPlatformsListOK dcim platforms list o k +*/ +type DcimPlatformsListOK struct { + Payload *models.DcimPlatformsListOKBody +} + +func (o *DcimPlatformsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/platforms/][%d] dcimPlatformsListOK %+v", 200, o.Payload) +} + +func (o *DcimPlatformsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimPlatformsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_partial_update_parameters.go new file mode 100644 index 0000000..38d50da --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPlatformsPartialUpdateParams creates a new DcimPlatformsPartialUpdateParams object +// with the default values initialized. +func NewDcimPlatformsPartialUpdateParams() *DcimPlatformsPartialUpdateParams { + var () + return &DcimPlatformsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPlatformsPartialUpdateParamsWithTimeout creates a new DcimPlatformsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPlatformsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimPlatformsPartialUpdateParams { + var () + return &DcimPlatformsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPlatformsPartialUpdateParamsWithContext creates a new DcimPlatformsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPlatformsPartialUpdateParamsWithContext(ctx context.Context) *DcimPlatformsPartialUpdateParams { + var () + return &DcimPlatformsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPlatformsPartialUpdateParamsWithHTTPClient creates a new DcimPlatformsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPlatformsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimPlatformsPartialUpdateParams { + var () + return &DcimPlatformsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPlatformsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim platforms partial update operation typically these are written to a http.Request +*/ +type DcimPlatformsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritablePlatform + /*ID + A unique integer value identifying this platform. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimPlatformsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) WithContext(ctx context.Context) *DcimPlatformsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimPlatformsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) WithData(data *models.WritablePlatform) *DcimPlatformsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) SetData(data *models.WritablePlatform) { + o.Data = data +} + +// WithID adds the id to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) WithID(id int64) *DcimPlatformsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPlatformsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_partial_update_responses.go new file mode 100644 index 0000000..aad0071 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPlatformsPartialUpdateReader is a Reader for the DcimPlatformsPartialUpdate structure. +type DcimPlatformsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPlatformsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPlatformsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPlatformsPartialUpdateOK creates a DcimPlatformsPartialUpdateOK with default headers values +func NewDcimPlatformsPartialUpdateOK() *DcimPlatformsPartialUpdateOK { + return &DcimPlatformsPartialUpdateOK{} +} + +/*DcimPlatformsPartialUpdateOK handles this case with default header values. + +DcimPlatformsPartialUpdateOK dcim platforms partial update o k +*/ +type DcimPlatformsPartialUpdateOK struct { + Payload *models.WritablePlatform +} + +func (o *DcimPlatformsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/platforms/{id}/][%d] dcimPlatformsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPlatformsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePlatform) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_read_parameters.go new file mode 100644 index 0000000..dac4a65 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPlatformsReadParams creates a new DcimPlatformsReadParams object +// with the default values initialized. +func NewDcimPlatformsReadParams() *DcimPlatformsReadParams { + var () + return &DcimPlatformsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPlatformsReadParamsWithTimeout creates a new DcimPlatformsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPlatformsReadParamsWithTimeout(timeout time.Duration) *DcimPlatformsReadParams { + var () + return &DcimPlatformsReadParams{ + + timeout: timeout, + } +} + +// NewDcimPlatformsReadParamsWithContext creates a new DcimPlatformsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPlatformsReadParamsWithContext(ctx context.Context) *DcimPlatformsReadParams { + var () + return &DcimPlatformsReadParams{ + + Context: ctx, + } +} + +// NewDcimPlatformsReadParamsWithHTTPClient creates a new DcimPlatformsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPlatformsReadParamsWithHTTPClient(client *http.Client) *DcimPlatformsReadParams { + var () + return &DcimPlatformsReadParams{ + HTTPClient: client, + } +} + +/*DcimPlatformsReadParams contains all the parameters to send to the API endpoint +for the dcim platforms read operation typically these are written to a http.Request +*/ +type DcimPlatformsReadParams struct { + + /*ID + A unique integer value identifying this platform. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim platforms read params +func (o *DcimPlatformsReadParams) WithTimeout(timeout time.Duration) *DcimPlatformsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim platforms read params +func (o *DcimPlatformsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim platforms read params +func (o *DcimPlatformsReadParams) WithContext(ctx context.Context) *DcimPlatformsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim platforms read params +func (o *DcimPlatformsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim platforms read params +func (o *DcimPlatformsReadParams) WithHTTPClient(client *http.Client) *DcimPlatformsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim platforms read params +func (o *DcimPlatformsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim platforms read params +func (o *DcimPlatformsReadParams) WithID(id int64) *DcimPlatformsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim platforms read params +func (o *DcimPlatformsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPlatformsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_read_responses.go new file mode 100644 index 0000000..67220ba --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPlatformsReadReader is a Reader for the DcimPlatformsRead structure. +type DcimPlatformsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPlatformsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPlatformsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPlatformsReadOK creates a DcimPlatformsReadOK with default headers values +func NewDcimPlatformsReadOK() *DcimPlatformsReadOK { + return &DcimPlatformsReadOK{} +} + +/*DcimPlatformsReadOK handles this case with default header values. + +DcimPlatformsReadOK dcim platforms read o k +*/ +type DcimPlatformsReadOK struct { + Payload *models.Platform +} + +func (o *DcimPlatformsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/platforms/{id}/][%d] dcimPlatformsReadOK %+v", 200, o.Payload) +} + +func (o *DcimPlatformsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Platform) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_update_parameters.go new file mode 100644 index 0000000..08123e1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPlatformsUpdateParams creates a new DcimPlatformsUpdateParams object +// with the default values initialized. +func NewDcimPlatformsUpdateParams() *DcimPlatformsUpdateParams { + var () + return &DcimPlatformsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPlatformsUpdateParamsWithTimeout creates a new DcimPlatformsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPlatformsUpdateParamsWithTimeout(timeout time.Duration) *DcimPlatformsUpdateParams { + var () + return &DcimPlatformsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPlatformsUpdateParamsWithContext creates a new DcimPlatformsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPlatformsUpdateParamsWithContext(ctx context.Context) *DcimPlatformsUpdateParams { + var () + return &DcimPlatformsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPlatformsUpdateParamsWithHTTPClient creates a new DcimPlatformsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPlatformsUpdateParamsWithHTTPClient(client *http.Client) *DcimPlatformsUpdateParams { + var () + return &DcimPlatformsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPlatformsUpdateParams contains all the parameters to send to the API endpoint +for the dcim platforms update operation typically these are written to a http.Request +*/ +type DcimPlatformsUpdateParams struct { + + /*Data*/ + Data *models.WritablePlatform + /*ID + A unique integer value identifying this platform. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) WithTimeout(timeout time.Duration) *DcimPlatformsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) WithContext(ctx context.Context) *DcimPlatformsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) WithHTTPClient(client *http.Client) *DcimPlatformsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) WithData(data *models.WritablePlatform) *DcimPlatformsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) SetData(data *models.WritablePlatform) { + o.Data = data +} + +// WithID adds the id to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) WithID(id int64) *DcimPlatformsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPlatformsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_update_responses.go new file mode 100644 index 0000000..e6c6942 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_platforms_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPlatformsUpdateReader is a Reader for the DcimPlatformsUpdate structure. +type DcimPlatformsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPlatformsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPlatformsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPlatformsUpdateOK creates a DcimPlatformsUpdateOK with default headers values +func NewDcimPlatformsUpdateOK() *DcimPlatformsUpdateOK { + return &DcimPlatformsUpdateOK{} +} + +/*DcimPlatformsUpdateOK handles this case with default header values. + +DcimPlatformsUpdateOK dcim platforms update o k +*/ +type DcimPlatformsUpdateOK struct { + Payload *models.WritablePlatform +} + +func (o *DcimPlatformsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/platforms/{id}/][%d] dcimPlatformsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPlatformsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePlatform) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_connections_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_connections_list_parameters.go new file mode 100644 index 0000000..2926f1e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_connections_list_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerConnectionsListParams creates a new DcimPowerConnectionsListParams object +// with the default values initialized. +func NewDcimPowerConnectionsListParams() *DcimPowerConnectionsListParams { + var () + return &DcimPowerConnectionsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerConnectionsListParamsWithTimeout creates a new DcimPowerConnectionsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerConnectionsListParamsWithTimeout(timeout time.Duration) *DcimPowerConnectionsListParams { + var () + return &DcimPowerConnectionsListParams{ + + timeout: timeout, + } +} + +// NewDcimPowerConnectionsListParamsWithContext creates a new DcimPowerConnectionsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerConnectionsListParamsWithContext(ctx context.Context) *DcimPowerConnectionsListParams { + var () + return &DcimPowerConnectionsListParams{ + + Context: ctx, + } +} + +// NewDcimPowerConnectionsListParamsWithHTTPClient creates a new DcimPowerConnectionsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerConnectionsListParamsWithHTTPClient(client *http.Client) *DcimPowerConnectionsListParams { + var () + return &DcimPowerConnectionsListParams{ + HTTPClient: client, + } +} + +/*DcimPowerConnectionsListParams contains all the parameters to send to the API endpoint +for the dcim power connections list operation typically these are written to a http.Request +*/ +type DcimPowerConnectionsListParams struct { + + /*ConnectionStatus*/ + ConnectionStatus *string + /*Device*/ + Device *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Site*/ + Site *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithTimeout(timeout time.Duration) *DcimPowerConnectionsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithContext(ctx context.Context) *DcimPowerConnectionsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithHTTPClient(client *http.Client) *DcimPowerConnectionsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionStatus adds the connectionStatus to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithConnectionStatus(connectionStatus *string) *DcimPowerConnectionsListParams { + o.SetConnectionStatus(connectionStatus) + return o +} + +// SetConnectionStatus adds the connectionStatus to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetConnectionStatus(connectionStatus *string) { + o.ConnectionStatus = connectionStatus +} + +// WithDevice adds the device to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithDevice(device *string) *DcimPowerConnectionsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithLimit adds the limit to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithLimit(limit *int64) *DcimPowerConnectionsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithName(name *string) *DcimPowerConnectionsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithOffset(offset *int64) *DcimPowerConnectionsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSite adds the site to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithSite(site *string) *DcimPowerConnectionsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetSite(site *string) { + o.Site = site +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerConnectionsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ConnectionStatus != nil { + + // query param connection_status + var qrConnectionStatus string + if o.ConnectionStatus != nil { + qrConnectionStatus = *o.ConnectionStatus + } + qConnectionStatus := qrConnectionStatus + if qConnectionStatus != "" { + if err := r.SetQueryParam("connection_status", qConnectionStatus); err != nil { + return err + } + } + + } + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); 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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_connections_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_connections_list_responses.go new file mode 100644 index 0000000..ac4a5dc --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_connections_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerConnectionsListReader is a Reader for the DcimPowerConnectionsList structure. +type DcimPowerConnectionsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerConnectionsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerConnectionsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerConnectionsListOK creates a DcimPowerConnectionsListOK with default headers values +func NewDcimPowerConnectionsListOK() *DcimPowerConnectionsListOK { + return &DcimPowerConnectionsListOK{} +} + +/*DcimPowerConnectionsListOK handles this case with default header values. + +DcimPowerConnectionsListOK dcim power connections list o k +*/ +type DcimPowerConnectionsListOK struct { + Payload *models.DcimPowerConnectionsListOKBody +} + +func (o *DcimPowerConnectionsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-connections/][%d] dcimPowerConnectionsListOK %+v", 200, o.Payload) +} + +func (o *DcimPowerConnectionsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimPowerConnectionsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_create_parameters.go new file mode 100644 index 0000000..e714e22 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerOutletTemplatesCreateParams creates a new DcimPowerOutletTemplatesCreateParams object +// with the default values initialized. +func NewDcimPowerOutletTemplatesCreateParams() *DcimPowerOutletTemplatesCreateParams { + var () + return &DcimPowerOutletTemplatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletTemplatesCreateParamsWithTimeout creates a new DcimPowerOutletTemplatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletTemplatesCreateParamsWithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesCreateParams { + var () + return &DcimPowerOutletTemplatesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletTemplatesCreateParamsWithContext creates a new DcimPowerOutletTemplatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletTemplatesCreateParamsWithContext(ctx context.Context) *DcimPowerOutletTemplatesCreateParams { + var () + return &DcimPowerOutletTemplatesCreateParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletTemplatesCreateParamsWithHTTPClient creates a new DcimPowerOutletTemplatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletTemplatesCreateParamsWithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesCreateParams { + var () + return &DcimPowerOutletTemplatesCreateParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletTemplatesCreateParams contains all the parameters to send to the API endpoint +for the dcim power outlet templates create operation typically these are written to a http.Request +*/ +type DcimPowerOutletTemplatesCreateParams struct { + + /*Data*/ + Data *models.WritablePowerOutletTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlet templates create params +func (o *DcimPowerOutletTemplatesCreateParams) WithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlet templates create params +func (o *DcimPowerOutletTemplatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlet templates create params +func (o *DcimPowerOutletTemplatesCreateParams) WithContext(ctx context.Context) *DcimPowerOutletTemplatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlet templates create params +func (o *DcimPowerOutletTemplatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlet templates create params +func (o *DcimPowerOutletTemplatesCreateParams) WithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlet templates create params +func (o *DcimPowerOutletTemplatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power outlet templates create params +func (o *DcimPowerOutletTemplatesCreateParams) WithData(data *models.WritablePowerOutletTemplate) *DcimPowerOutletTemplatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power outlet templates create params +func (o *DcimPowerOutletTemplatesCreateParams) SetData(data *models.WritablePowerOutletTemplate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletTemplatesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_create_responses.go new file mode 100644 index 0000000..0dd2e5a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerOutletTemplatesCreateReader is a Reader for the DcimPowerOutletTemplatesCreate structure. +type DcimPowerOutletTemplatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletTemplatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimPowerOutletTemplatesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerOutletTemplatesCreateCreated creates a DcimPowerOutletTemplatesCreateCreated with default headers values +func NewDcimPowerOutletTemplatesCreateCreated() *DcimPowerOutletTemplatesCreateCreated { + return &DcimPowerOutletTemplatesCreateCreated{} +} + +/*DcimPowerOutletTemplatesCreateCreated handles this case with default header values. + +DcimPowerOutletTemplatesCreateCreated dcim power outlet templates create created +*/ +type DcimPowerOutletTemplatesCreateCreated struct { + Payload *models.WritablePowerOutletTemplate +} + +func (o *DcimPowerOutletTemplatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/power-outlet-templates/][%d] dcimPowerOutletTemplatesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimPowerOutletTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerOutletTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_delete_parameters.go new file mode 100644 index 0000000..e26bb3b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerOutletTemplatesDeleteParams creates a new DcimPowerOutletTemplatesDeleteParams object +// with the default values initialized. +func NewDcimPowerOutletTemplatesDeleteParams() *DcimPowerOutletTemplatesDeleteParams { + var () + return &DcimPowerOutletTemplatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletTemplatesDeleteParamsWithTimeout creates a new DcimPowerOutletTemplatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletTemplatesDeleteParamsWithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesDeleteParams { + var () + return &DcimPowerOutletTemplatesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletTemplatesDeleteParamsWithContext creates a new DcimPowerOutletTemplatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletTemplatesDeleteParamsWithContext(ctx context.Context) *DcimPowerOutletTemplatesDeleteParams { + var () + return &DcimPowerOutletTemplatesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletTemplatesDeleteParamsWithHTTPClient creates a new DcimPowerOutletTemplatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletTemplatesDeleteParamsWithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesDeleteParams { + var () + return &DcimPowerOutletTemplatesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletTemplatesDeleteParams contains all the parameters to send to the API endpoint +for the dcim power outlet templates delete operation typically these are written to a http.Request +*/ +type DcimPowerOutletTemplatesDeleteParams struct { + + /*ID + A unique integer value identifying this power outlet template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlet templates delete params +func (o *DcimPowerOutletTemplatesDeleteParams) WithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlet templates delete params +func (o *DcimPowerOutletTemplatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlet templates delete params +func (o *DcimPowerOutletTemplatesDeleteParams) WithContext(ctx context.Context) *DcimPowerOutletTemplatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlet templates delete params +func (o *DcimPowerOutletTemplatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlet templates delete params +func (o *DcimPowerOutletTemplatesDeleteParams) WithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlet templates delete params +func (o *DcimPowerOutletTemplatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power outlet templates delete params +func (o *DcimPowerOutletTemplatesDeleteParams) WithID(id int64) *DcimPowerOutletTemplatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlet templates delete params +func (o *DcimPowerOutletTemplatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletTemplatesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_delete_responses.go new file mode 100644 index 0000000..b6845f8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimPowerOutletTemplatesDeleteReader is a Reader for the DcimPowerOutletTemplatesDelete structure. +type DcimPowerOutletTemplatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletTemplatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimPowerOutletTemplatesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerOutletTemplatesDeleteNoContent creates a DcimPowerOutletTemplatesDeleteNoContent with default headers values +func NewDcimPowerOutletTemplatesDeleteNoContent() *DcimPowerOutletTemplatesDeleteNoContent { + return &DcimPowerOutletTemplatesDeleteNoContent{} +} + +/*DcimPowerOutletTemplatesDeleteNoContent handles this case with default header values. + +DcimPowerOutletTemplatesDeleteNoContent dcim power outlet templates delete no content +*/ +type DcimPowerOutletTemplatesDeleteNoContent struct { +} + +func (o *DcimPowerOutletTemplatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/power-outlet-templates/{id}/][%d] dcimPowerOutletTemplatesDeleteNoContent ", 204) +} + +func (o *DcimPowerOutletTemplatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_list_parameters.go new file mode 100644 index 0000000..860a335 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_list_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerOutletTemplatesListParams creates a new DcimPowerOutletTemplatesListParams object +// with the default values initialized. +func NewDcimPowerOutletTemplatesListParams() *DcimPowerOutletTemplatesListParams { + var () + return &DcimPowerOutletTemplatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletTemplatesListParamsWithTimeout creates a new DcimPowerOutletTemplatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletTemplatesListParamsWithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesListParams { + var () + return &DcimPowerOutletTemplatesListParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletTemplatesListParamsWithContext creates a new DcimPowerOutletTemplatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletTemplatesListParamsWithContext(ctx context.Context) *DcimPowerOutletTemplatesListParams { + var () + return &DcimPowerOutletTemplatesListParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletTemplatesListParamsWithHTTPClient creates a new DcimPowerOutletTemplatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletTemplatesListParamsWithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesListParams { + var () + return &DcimPowerOutletTemplatesListParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletTemplatesListParams contains all the parameters to send to the API endpoint +for the dcim power outlet templates list operation typically these are written to a http.Request +*/ +type DcimPowerOutletTemplatesListParams struct { + + /*DevicetypeID*/ + DevicetypeID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithContext(ctx context.Context) *DcimPowerOutletTemplatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevicetypeID adds the devicetypeID to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithDevicetypeID(devicetypeID *string) *DcimPowerOutletTemplatesListParams { + o.SetDevicetypeID(devicetypeID) + return o +} + +// SetDevicetypeID adds the devicetypeId to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetDevicetypeID(devicetypeID *string) { + o.DevicetypeID = devicetypeID +} + +// WithLimit adds the limit to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithLimit(limit *int64) *DcimPowerOutletTemplatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithName(name *string) *DcimPowerOutletTemplatesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithOffset(offset *int64) *DcimPowerOutletTemplatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DevicetypeID != nil { + + // query param devicetype_id + var qrDevicetypeID string + if o.DevicetypeID != nil { + qrDevicetypeID = *o.DevicetypeID + } + qDevicetypeID := qrDevicetypeID + if qDevicetypeID != "" { + if err := r.SetQueryParam("devicetype_id", qDevicetypeID); 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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_list_responses.go new file mode 100644 index 0000000..f57d14a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerOutletTemplatesListReader is a Reader for the DcimPowerOutletTemplatesList structure. +type DcimPowerOutletTemplatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletTemplatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletTemplatesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerOutletTemplatesListOK creates a DcimPowerOutletTemplatesListOK with default headers values +func NewDcimPowerOutletTemplatesListOK() *DcimPowerOutletTemplatesListOK { + return &DcimPowerOutletTemplatesListOK{} +} + +/*DcimPowerOutletTemplatesListOK handles this case with default header values. + +DcimPowerOutletTemplatesListOK dcim power outlet templates list o k +*/ +type DcimPowerOutletTemplatesListOK struct { + Payload *models.DcimPowerOutletTemplatesListOKBody +} + +func (o *DcimPowerOutletTemplatesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-outlet-templates/][%d] dcimPowerOutletTemplatesListOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimPowerOutletTemplatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_partial_update_parameters.go new file mode 100644 index 0000000..36a52c3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerOutletTemplatesPartialUpdateParams creates a new DcimPowerOutletTemplatesPartialUpdateParams object +// with the default values initialized. +func NewDcimPowerOutletTemplatesPartialUpdateParams() *DcimPowerOutletTemplatesPartialUpdateParams { + var () + return &DcimPowerOutletTemplatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletTemplatesPartialUpdateParamsWithTimeout creates a new DcimPowerOutletTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesPartialUpdateParams { + var () + return &DcimPowerOutletTemplatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletTemplatesPartialUpdateParamsWithContext creates a new DcimPowerOutletTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletTemplatesPartialUpdateParamsWithContext(ctx context.Context) *DcimPowerOutletTemplatesPartialUpdateParams { + var () + return &DcimPowerOutletTemplatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletTemplatesPartialUpdateParamsWithHTTPClient creates a new DcimPowerOutletTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesPartialUpdateParams { + var () + return &DcimPowerOutletTemplatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim power outlet templates partial update operation typically these are written to a http.Request +*/ +type DcimPowerOutletTemplatesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerOutletTemplate + /*ID + A unique integer value identifying this power outlet template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) WithContext(ctx context.Context) *DcimPowerOutletTemplatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) WithData(data *models.WritablePowerOutletTemplate) *DcimPowerOutletTemplatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) SetData(data *models.WritablePowerOutletTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) WithID(id int64) *DcimPowerOutletTemplatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletTemplatesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_partial_update_responses.go new file mode 100644 index 0000000..8d573bf --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerOutletTemplatesPartialUpdateReader is a Reader for the DcimPowerOutletTemplatesPartialUpdate structure. +type DcimPowerOutletTemplatesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletTemplatesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerOutletTemplatesPartialUpdateOK creates a DcimPowerOutletTemplatesPartialUpdateOK with default headers values +func NewDcimPowerOutletTemplatesPartialUpdateOK() *DcimPowerOutletTemplatesPartialUpdateOK { + return &DcimPowerOutletTemplatesPartialUpdateOK{} +} + +/*DcimPowerOutletTemplatesPartialUpdateOK handles this case with default header values. + +DcimPowerOutletTemplatesPartialUpdateOK dcim power outlet templates partial update o k +*/ +type DcimPowerOutletTemplatesPartialUpdateOK struct { + Payload *models.WritablePowerOutletTemplate +} + +func (o *DcimPowerOutletTemplatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/power-outlet-templates/{id}/][%d] dcimPowerOutletTemplatesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerOutletTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_read_parameters.go new file mode 100644 index 0000000..7290f3c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerOutletTemplatesReadParams creates a new DcimPowerOutletTemplatesReadParams object +// with the default values initialized. +func NewDcimPowerOutletTemplatesReadParams() *DcimPowerOutletTemplatesReadParams { + var () + return &DcimPowerOutletTemplatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletTemplatesReadParamsWithTimeout creates a new DcimPowerOutletTemplatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletTemplatesReadParamsWithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesReadParams { + var () + return &DcimPowerOutletTemplatesReadParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletTemplatesReadParamsWithContext creates a new DcimPowerOutletTemplatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletTemplatesReadParamsWithContext(ctx context.Context) *DcimPowerOutletTemplatesReadParams { + var () + return &DcimPowerOutletTemplatesReadParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletTemplatesReadParamsWithHTTPClient creates a new DcimPowerOutletTemplatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletTemplatesReadParamsWithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesReadParams { + var () + return &DcimPowerOutletTemplatesReadParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletTemplatesReadParams contains all the parameters to send to the API endpoint +for the dcim power outlet templates read operation typically these are written to a http.Request +*/ +type DcimPowerOutletTemplatesReadParams struct { + + /*ID + A unique integer value identifying this power outlet template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlet templates read params +func (o *DcimPowerOutletTemplatesReadParams) WithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlet templates read params +func (o *DcimPowerOutletTemplatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlet templates read params +func (o *DcimPowerOutletTemplatesReadParams) WithContext(ctx context.Context) *DcimPowerOutletTemplatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlet templates read params +func (o *DcimPowerOutletTemplatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlet templates read params +func (o *DcimPowerOutletTemplatesReadParams) WithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlet templates read params +func (o *DcimPowerOutletTemplatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power outlet templates read params +func (o *DcimPowerOutletTemplatesReadParams) WithID(id int64) *DcimPowerOutletTemplatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlet templates read params +func (o *DcimPowerOutletTemplatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletTemplatesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_read_responses.go new file mode 100644 index 0000000..ce8d931 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerOutletTemplatesReadReader is a Reader for the DcimPowerOutletTemplatesRead structure. +type DcimPowerOutletTemplatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletTemplatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletTemplatesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerOutletTemplatesReadOK creates a DcimPowerOutletTemplatesReadOK with default headers values +func NewDcimPowerOutletTemplatesReadOK() *DcimPowerOutletTemplatesReadOK { + return &DcimPowerOutletTemplatesReadOK{} +} + +/*DcimPowerOutletTemplatesReadOK handles this case with default header values. + +DcimPowerOutletTemplatesReadOK dcim power outlet templates read o k +*/ +type DcimPowerOutletTemplatesReadOK struct { + Payload *models.PowerOutletTemplate +} + +func (o *DcimPowerOutletTemplatesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-outlet-templates/{id}/][%d] dcimPowerOutletTemplatesReadOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletTemplatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerOutletTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_update_parameters.go new file mode 100644 index 0000000..5402906 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerOutletTemplatesUpdateParams creates a new DcimPowerOutletTemplatesUpdateParams object +// with the default values initialized. +func NewDcimPowerOutletTemplatesUpdateParams() *DcimPowerOutletTemplatesUpdateParams { + var () + return &DcimPowerOutletTemplatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletTemplatesUpdateParamsWithTimeout creates a new DcimPowerOutletTemplatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletTemplatesUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesUpdateParams { + var () + return &DcimPowerOutletTemplatesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletTemplatesUpdateParamsWithContext creates a new DcimPowerOutletTemplatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletTemplatesUpdateParamsWithContext(ctx context.Context) *DcimPowerOutletTemplatesUpdateParams { + var () + return &DcimPowerOutletTemplatesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletTemplatesUpdateParamsWithHTTPClient creates a new DcimPowerOutletTemplatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletTemplatesUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesUpdateParams { + var () + return &DcimPowerOutletTemplatesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletTemplatesUpdateParams contains all the parameters to send to the API endpoint +for the dcim power outlet templates update operation typically these are written to a http.Request +*/ +type DcimPowerOutletTemplatesUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerOutletTemplate + /*ID + A unique integer value identifying this power outlet template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) WithContext(ctx context.Context) *DcimPowerOutletTemplatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) WithData(data *models.WritablePowerOutletTemplate) *DcimPowerOutletTemplatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) SetData(data *models.WritablePowerOutletTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) WithID(id int64) *DcimPowerOutletTemplatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletTemplatesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_update_responses.go new file mode 100644 index 0000000..b933d33 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlet_templates_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerOutletTemplatesUpdateReader is a Reader for the DcimPowerOutletTemplatesUpdate structure. +type DcimPowerOutletTemplatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletTemplatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletTemplatesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerOutletTemplatesUpdateOK creates a DcimPowerOutletTemplatesUpdateOK with default headers values +func NewDcimPowerOutletTemplatesUpdateOK() *DcimPowerOutletTemplatesUpdateOK { + return &DcimPowerOutletTemplatesUpdateOK{} +} + +/*DcimPowerOutletTemplatesUpdateOK handles this case with default header values. + +DcimPowerOutletTemplatesUpdateOK dcim power outlet templates update o k +*/ +type DcimPowerOutletTemplatesUpdateOK struct { + Payload *models.WritablePowerOutletTemplate +} + +func (o *DcimPowerOutletTemplatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/power-outlet-templates/{id}/][%d] dcimPowerOutletTemplatesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerOutletTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_create_parameters.go new file mode 100644 index 0000000..177b9e2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerOutletsCreateParams creates a new DcimPowerOutletsCreateParams object +// with the default values initialized. +func NewDcimPowerOutletsCreateParams() *DcimPowerOutletsCreateParams { + var () + return &DcimPowerOutletsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletsCreateParamsWithTimeout creates a new DcimPowerOutletsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletsCreateParamsWithTimeout(timeout time.Duration) *DcimPowerOutletsCreateParams { + var () + return &DcimPowerOutletsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletsCreateParamsWithContext creates a new DcimPowerOutletsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletsCreateParamsWithContext(ctx context.Context) *DcimPowerOutletsCreateParams { + var () + return &DcimPowerOutletsCreateParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletsCreateParamsWithHTTPClient creates a new DcimPowerOutletsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletsCreateParamsWithHTTPClient(client *http.Client) *DcimPowerOutletsCreateParams { + var () + return &DcimPowerOutletsCreateParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletsCreateParams contains all the parameters to send to the API endpoint +for the dcim power outlets create operation typically these are written to a http.Request +*/ +type DcimPowerOutletsCreateParams struct { + + /*Data*/ + Data *models.WritablePowerOutlet + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlets create params +func (o *DcimPowerOutletsCreateParams) WithTimeout(timeout time.Duration) *DcimPowerOutletsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlets create params +func (o *DcimPowerOutletsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlets create params +func (o *DcimPowerOutletsCreateParams) WithContext(ctx context.Context) *DcimPowerOutletsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlets create params +func (o *DcimPowerOutletsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlets create params +func (o *DcimPowerOutletsCreateParams) WithHTTPClient(client *http.Client) *DcimPowerOutletsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlets create params +func (o *DcimPowerOutletsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power outlets create params +func (o *DcimPowerOutletsCreateParams) WithData(data *models.WritablePowerOutlet) *DcimPowerOutletsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power outlets create params +func (o *DcimPowerOutletsCreateParams) SetData(data *models.WritablePowerOutlet) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_create_responses.go new file mode 100644 index 0000000..972ccc2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerOutletsCreateReader is a Reader for the DcimPowerOutletsCreate structure. +type DcimPowerOutletsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimPowerOutletsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerOutletsCreateCreated creates a DcimPowerOutletsCreateCreated with default headers values +func NewDcimPowerOutletsCreateCreated() *DcimPowerOutletsCreateCreated { + return &DcimPowerOutletsCreateCreated{} +} + +/*DcimPowerOutletsCreateCreated handles this case with default header values. + +DcimPowerOutletsCreateCreated dcim power outlets create created +*/ +type DcimPowerOutletsCreateCreated struct { + Payload *models.WritablePowerOutlet +} + +func (o *DcimPowerOutletsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/power-outlets/][%d] dcimPowerOutletsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimPowerOutletsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerOutlet) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_delete_parameters.go new file mode 100644 index 0000000..017807a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerOutletsDeleteParams creates a new DcimPowerOutletsDeleteParams object +// with the default values initialized. +func NewDcimPowerOutletsDeleteParams() *DcimPowerOutletsDeleteParams { + var () + return &DcimPowerOutletsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletsDeleteParamsWithTimeout creates a new DcimPowerOutletsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletsDeleteParamsWithTimeout(timeout time.Duration) *DcimPowerOutletsDeleteParams { + var () + return &DcimPowerOutletsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletsDeleteParamsWithContext creates a new DcimPowerOutletsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletsDeleteParamsWithContext(ctx context.Context) *DcimPowerOutletsDeleteParams { + var () + return &DcimPowerOutletsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletsDeleteParamsWithHTTPClient creates a new DcimPowerOutletsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletsDeleteParamsWithHTTPClient(client *http.Client) *DcimPowerOutletsDeleteParams { + var () + return &DcimPowerOutletsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletsDeleteParams contains all the parameters to send to the API endpoint +for the dcim power outlets delete operation typically these are written to a http.Request +*/ +type DcimPowerOutletsDeleteParams struct { + + /*ID + A unique integer value identifying this power outlet. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlets delete params +func (o *DcimPowerOutletsDeleteParams) WithTimeout(timeout time.Duration) *DcimPowerOutletsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlets delete params +func (o *DcimPowerOutletsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlets delete params +func (o *DcimPowerOutletsDeleteParams) WithContext(ctx context.Context) *DcimPowerOutletsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlets delete params +func (o *DcimPowerOutletsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlets delete params +func (o *DcimPowerOutletsDeleteParams) WithHTTPClient(client *http.Client) *DcimPowerOutletsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlets delete params +func (o *DcimPowerOutletsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power outlets delete params +func (o *DcimPowerOutletsDeleteParams) WithID(id int64) *DcimPowerOutletsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlets delete params +func (o *DcimPowerOutletsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_delete_responses.go new file mode 100644 index 0000000..5a645b5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimPowerOutletsDeleteReader is a Reader for the DcimPowerOutletsDelete structure. +type DcimPowerOutletsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimPowerOutletsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerOutletsDeleteNoContent creates a DcimPowerOutletsDeleteNoContent with default headers values +func NewDcimPowerOutletsDeleteNoContent() *DcimPowerOutletsDeleteNoContent { + return &DcimPowerOutletsDeleteNoContent{} +} + +/*DcimPowerOutletsDeleteNoContent handles this case with default header values. + +DcimPowerOutletsDeleteNoContent dcim power outlets delete no content +*/ +type DcimPowerOutletsDeleteNoContent struct { +} + +func (o *DcimPowerOutletsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/power-outlets/{id}/][%d] dcimPowerOutletsDeleteNoContent ", 204) +} + +func (o *DcimPowerOutletsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_list_parameters.go new file mode 100644 index 0000000..e83ce7d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_list_parameters.go @@ -0,0 +1,282 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerOutletsListParams creates a new DcimPowerOutletsListParams object +// with the default values initialized. +func NewDcimPowerOutletsListParams() *DcimPowerOutletsListParams { + var () + return &DcimPowerOutletsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletsListParamsWithTimeout creates a new DcimPowerOutletsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletsListParamsWithTimeout(timeout time.Duration) *DcimPowerOutletsListParams { + var () + return &DcimPowerOutletsListParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletsListParamsWithContext creates a new DcimPowerOutletsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletsListParamsWithContext(ctx context.Context) *DcimPowerOutletsListParams { + var () + return &DcimPowerOutletsListParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletsListParamsWithHTTPClient creates a new DcimPowerOutletsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletsListParamsWithHTTPClient(client *http.Client) *DcimPowerOutletsListParams { + var () + return &DcimPowerOutletsListParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletsListParams contains all the parameters to send to the API endpoint +for the dcim power outlets list operation typically these are written to a http.Request +*/ +type DcimPowerOutletsListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithTimeout(timeout time.Duration) *DcimPowerOutletsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithContext(ctx context.Context) *DcimPowerOutletsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithHTTPClient(client *http.Client) *DcimPowerOutletsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithDevice(device *string) *DcimPowerOutletsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithDeviceID(deviceID *string) *DcimPowerOutletsListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithLimit adds the limit to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithLimit(limit *int64) *DcimPowerOutletsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithName(name *string) *DcimPowerOutletsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithOffset(offset *int64) *DcimPowerOutletsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); 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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_list_responses.go new file mode 100644 index 0000000..cbe5249 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerOutletsListReader is a Reader for the DcimPowerOutletsList structure. +type DcimPowerOutletsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerOutletsListOK creates a DcimPowerOutletsListOK with default headers values +func NewDcimPowerOutletsListOK() *DcimPowerOutletsListOK { + return &DcimPowerOutletsListOK{} +} + +/*DcimPowerOutletsListOK handles this case with default header values. + +DcimPowerOutletsListOK dcim power outlets list o k +*/ +type DcimPowerOutletsListOK struct { + Payload *models.DcimPowerOutletsListOKBody +} + +func (o *DcimPowerOutletsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-outlets/][%d] dcimPowerOutletsListOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimPowerOutletsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_partial_update_parameters.go new file mode 100644 index 0000000..42e1924 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerOutletsPartialUpdateParams creates a new DcimPowerOutletsPartialUpdateParams object +// with the default values initialized. +func NewDcimPowerOutletsPartialUpdateParams() *DcimPowerOutletsPartialUpdateParams { + var () + return &DcimPowerOutletsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletsPartialUpdateParamsWithTimeout creates a new DcimPowerOutletsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerOutletsPartialUpdateParams { + var () + return &DcimPowerOutletsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletsPartialUpdateParamsWithContext creates a new DcimPowerOutletsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletsPartialUpdateParamsWithContext(ctx context.Context) *DcimPowerOutletsPartialUpdateParams { + var () + return &DcimPowerOutletsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletsPartialUpdateParamsWithHTTPClient creates a new DcimPowerOutletsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerOutletsPartialUpdateParams { + var () + return &DcimPowerOutletsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim power outlets partial update operation typically these are written to a http.Request +*/ +type DcimPowerOutletsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerOutlet + /*ID + A unique integer value identifying this power outlet. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerOutletsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) WithContext(ctx context.Context) *DcimPowerOutletsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerOutletsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) WithData(data *models.WritablePowerOutlet) *DcimPowerOutletsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) SetData(data *models.WritablePowerOutlet) { + o.Data = data +} + +// WithID adds the id to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) WithID(id int64) *DcimPowerOutletsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_partial_update_responses.go new file mode 100644 index 0000000..0dda720 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerOutletsPartialUpdateReader is a Reader for the DcimPowerOutletsPartialUpdate structure. +type DcimPowerOutletsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerOutletsPartialUpdateOK creates a DcimPowerOutletsPartialUpdateOK with default headers values +func NewDcimPowerOutletsPartialUpdateOK() *DcimPowerOutletsPartialUpdateOK { + return &DcimPowerOutletsPartialUpdateOK{} +} + +/*DcimPowerOutletsPartialUpdateOK handles this case with default header values. + +DcimPowerOutletsPartialUpdateOK dcim power outlets partial update o k +*/ +type DcimPowerOutletsPartialUpdateOK struct { + Payload *models.WritablePowerOutlet +} + +func (o *DcimPowerOutletsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/power-outlets/{id}/][%d] dcimPowerOutletsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerOutlet) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_read_parameters.go new file mode 100644 index 0000000..bd517a5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerOutletsReadParams creates a new DcimPowerOutletsReadParams object +// with the default values initialized. +func NewDcimPowerOutletsReadParams() *DcimPowerOutletsReadParams { + var () + return &DcimPowerOutletsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletsReadParamsWithTimeout creates a new DcimPowerOutletsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletsReadParamsWithTimeout(timeout time.Duration) *DcimPowerOutletsReadParams { + var () + return &DcimPowerOutletsReadParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletsReadParamsWithContext creates a new DcimPowerOutletsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletsReadParamsWithContext(ctx context.Context) *DcimPowerOutletsReadParams { + var () + return &DcimPowerOutletsReadParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletsReadParamsWithHTTPClient creates a new DcimPowerOutletsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletsReadParamsWithHTTPClient(client *http.Client) *DcimPowerOutletsReadParams { + var () + return &DcimPowerOutletsReadParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletsReadParams contains all the parameters to send to the API endpoint +for the dcim power outlets read operation typically these are written to a http.Request +*/ +type DcimPowerOutletsReadParams struct { + + /*ID + A unique integer value identifying this power outlet. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlets read params +func (o *DcimPowerOutletsReadParams) WithTimeout(timeout time.Duration) *DcimPowerOutletsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlets read params +func (o *DcimPowerOutletsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlets read params +func (o *DcimPowerOutletsReadParams) WithContext(ctx context.Context) *DcimPowerOutletsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlets read params +func (o *DcimPowerOutletsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlets read params +func (o *DcimPowerOutletsReadParams) WithHTTPClient(client *http.Client) *DcimPowerOutletsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlets read params +func (o *DcimPowerOutletsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power outlets read params +func (o *DcimPowerOutletsReadParams) WithID(id int64) *DcimPowerOutletsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlets read params +func (o *DcimPowerOutletsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_read_responses.go new file mode 100644 index 0000000..468ff3d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerOutletsReadReader is a Reader for the DcimPowerOutletsRead structure. +type DcimPowerOutletsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerOutletsReadOK creates a DcimPowerOutletsReadOK with default headers values +func NewDcimPowerOutletsReadOK() *DcimPowerOutletsReadOK { + return &DcimPowerOutletsReadOK{} +} + +/*DcimPowerOutletsReadOK handles this case with default header values. + +DcimPowerOutletsReadOK dcim power outlets read o k +*/ +type DcimPowerOutletsReadOK struct { + Payload *models.PowerOutlet +} + +func (o *DcimPowerOutletsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-outlets/{id}/][%d] dcimPowerOutletsReadOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerOutlet) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_update_parameters.go new file mode 100644 index 0000000..2f0e1aa --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerOutletsUpdateParams creates a new DcimPowerOutletsUpdateParams object +// with the default values initialized. +func NewDcimPowerOutletsUpdateParams() *DcimPowerOutletsUpdateParams { + var () + return &DcimPowerOutletsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletsUpdateParamsWithTimeout creates a new DcimPowerOutletsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletsUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerOutletsUpdateParams { + var () + return &DcimPowerOutletsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletsUpdateParamsWithContext creates a new DcimPowerOutletsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletsUpdateParamsWithContext(ctx context.Context) *DcimPowerOutletsUpdateParams { + var () + return &DcimPowerOutletsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletsUpdateParamsWithHTTPClient creates a new DcimPowerOutletsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletsUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerOutletsUpdateParams { + var () + return &DcimPowerOutletsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletsUpdateParams contains all the parameters to send to the API endpoint +for the dcim power outlets update operation typically these are written to a http.Request +*/ +type DcimPowerOutletsUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerOutlet + /*ID + A unique integer value identifying this power outlet. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerOutletsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) WithContext(ctx context.Context) *DcimPowerOutletsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerOutletsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) WithData(data *models.WritablePowerOutlet) *DcimPowerOutletsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) SetData(data *models.WritablePowerOutlet) { + o.Data = data +} + +// WithID adds the id to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) WithID(id int64) *DcimPowerOutletsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_update_responses.go new file mode 100644 index 0000000..5a26117 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_outlets_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerOutletsUpdateReader is a Reader for the DcimPowerOutletsUpdate structure. +type DcimPowerOutletsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerOutletsUpdateOK creates a DcimPowerOutletsUpdateOK with default headers values +func NewDcimPowerOutletsUpdateOK() *DcimPowerOutletsUpdateOK { + return &DcimPowerOutletsUpdateOK{} +} + +/*DcimPowerOutletsUpdateOK handles this case with default header values. + +DcimPowerOutletsUpdateOK dcim power outlets update o k +*/ +type DcimPowerOutletsUpdateOK struct { + Payload *models.WritablePowerOutlet +} + +func (o *DcimPowerOutletsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/power-outlets/{id}/][%d] dcimPowerOutletsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerOutlet) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_create_parameters.go new file mode 100644 index 0000000..fe10b21 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerPortTemplatesCreateParams creates a new DcimPowerPortTemplatesCreateParams object +// with the default values initialized. +func NewDcimPowerPortTemplatesCreateParams() *DcimPowerPortTemplatesCreateParams { + var () + return &DcimPowerPortTemplatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortTemplatesCreateParamsWithTimeout creates a new DcimPowerPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortTemplatesCreateParamsWithTimeout(timeout time.Duration) *DcimPowerPortTemplatesCreateParams { + var () + return &DcimPowerPortTemplatesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortTemplatesCreateParamsWithContext creates a new DcimPowerPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortTemplatesCreateParamsWithContext(ctx context.Context) *DcimPowerPortTemplatesCreateParams { + var () + return &DcimPowerPortTemplatesCreateParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortTemplatesCreateParamsWithHTTPClient creates a new DcimPowerPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortTemplatesCreateParamsWithHTTPClient(client *http.Client) *DcimPowerPortTemplatesCreateParams { + var () + return &DcimPowerPortTemplatesCreateParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortTemplatesCreateParams contains all the parameters to send to the API endpoint +for the dcim power port templates create operation typically these are written to a http.Request +*/ +type DcimPowerPortTemplatesCreateParams struct { + + /*Data*/ + Data *models.WritablePowerPortTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power port templates create params +func (o *DcimPowerPortTemplatesCreateParams) WithTimeout(timeout time.Duration) *DcimPowerPortTemplatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power port templates create params +func (o *DcimPowerPortTemplatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power port templates create params +func (o *DcimPowerPortTemplatesCreateParams) WithContext(ctx context.Context) *DcimPowerPortTemplatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power port templates create params +func (o *DcimPowerPortTemplatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power port templates create params +func (o *DcimPowerPortTemplatesCreateParams) WithHTTPClient(client *http.Client) *DcimPowerPortTemplatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power port templates create params +func (o *DcimPowerPortTemplatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power port templates create params +func (o *DcimPowerPortTemplatesCreateParams) WithData(data *models.WritablePowerPortTemplate) *DcimPowerPortTemplatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power port templates create params +func (o *DcimPowerPortTemplatesCreateParams) SetData(data *models.WritablePowerPortTemplate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortTemplatesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_create_responses.go new file mode 100644 index 0000000..93040a2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerPortTemplatesCreateReader is a Reader for the DcimPowerPortTemplatesCreate structure. +type DcimPowerPortTemplatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortTemplatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimPowerPortTemplatesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPortTemplatesCreateCreated creates a DcimPowerPortTemplatesCreateCreated with default headers values +func NewDcimPowerPortTemplatesCreateCreated() *DcimPowerPortTemplatesCreateCreated { + return &DcimPowerPortTemplatesCreateCreated{} +} + +/*DcimPowerPortTemplatesCreateCreated handles this case with default header values. + +DcimPowerPortTemplatesCreateCreated dcim power port templates create created +*/ +type DcimPowerPortTemplatesCreateCreated struct { + Payload *models.WritablePowerPortTemplate +} + +func (o *DcimPowerPortTemplatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/power-port-templates/][%d] dcimPowerPortTemplatesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimPowerPortTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_delete_parameters.go new file mode 100644 index 0000000..81469b3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerPortTemplatesDeleteParams creates a new DcimPowerPortTemplatesDeleteParams object +// with the default values initialized. +func NewDcimPowerPortTemplatesDeleteParams() *DcimPowerPortTemplatesDeleteParams { + var () + return &DcimPowerPortTemplatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortTemplatesDeleteParamsWithTimeout creates a new DcimPowerPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortTemplatesDeleteParamsWithTimeout(timeout time.Duration) *DcimPowerPortTemplatesDeleteParams { + var () + return &DcimPowerPortTemplatesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortTemplatesDeleteParamsWithContext creates a new DcimPowerPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortTemplatesDeleteParamsWithContext(ctx context.Context) *DcimPowerPortTemplatesDeleteParams { + var () + return &DcimPowerPortTemplatesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortTemplatesDeleteParamsWithHTTPClient creates a new DcimPowerPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortTemplatesDeleteParamsWithHTTPClient(client *http.Client) *DcimPowerPortTemplatesDeleteParams { + var () + return &DcimPowerPortTemplatesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortTemplatesDeleteParams contains all the parameters to send to the API endpoint +for the dcim power port templates delete operation typically these are written to a http.Request +*/ +type DcimPowerPortTemplatesDeleteParams struct { + + /*ID + A unique integer value identifying this power port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power port templates delete params +func (o *DcimPowerPortTemplatesDeleteParams) WithTimeout(timeout time.Duration) *DcimPowerPortTemplatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power port templates delete params +func (o *DcimPowerPortTemplatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power port templates delete params +func (o *DcimPowerPortTemplatesDeleteParams) WithContext(ctx context.Context) *DcimPowerPortTemplatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power port templates delete params +func (o *DcimPowerPortTemplatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power port templates delete params +func (o *DcimPowerPortTemplatesDeleteParams) WithHTTPClient(client *http.Client) *DcimPowerPortTemplatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power port templates delete params +func (o *DcimPowerPortTemplatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power port templates delete params +func (o *DcimPowerPortTemplatesDeleteParams) WithID(id int64) *DcimPowerPortTemplatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power port templates delete params +func (o *DcimPowerPortTemplatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortTemplatesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_delete_responses.go new file mode 100644 index 0000000..cc3ffdc --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimPowerPortTemplatesDeleteReader is a Reader for the DcimPowerPortTemplatesDelete structure. +type DcimPowerPortTemplatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortTemplatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimPowerPortTemplatesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPortTemplatesDeleteNoContent creates a DcimPowerPortTemplatesDeleteNoContent with default headers values +func NewDcimPowerPortTemplatesDeleteNoContent() *DcimPowerPortTemplatesDeleteNoContent { + return &DcimPowerPortTemplatesDeleteNoContent{} +} + +/*DcimPowerPortTemplatesDeleteNoContent handles this case with default header values. + +DcimPowerPortTemplatesDeleteNoContent dcim power port templates delete no content +*/ +type DcimPowerPortTemplatesDeleteNoContent struct { +} + +func (o *DcimPowerPortTemplatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/power-port-templates/{id}/][%d] dcimPowerPortTemplatesDeleteNoContent ", 204) +} + +func (o *DcimPowerPortTemplatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_list_parameters.go new file mode 100644 index 0000000..0cd93cc --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_list_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerPortTemplatesListParams creates a new DcimPowerPortTemplatesListParams object +// with the default values initialized. +func NewDcimPowerPortTemplatesListParams() *DcimPowerPortTemplatesListParams { + var () + return &DcimPowerPortTemplatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortTemplatesListParamsWithTimeout creates a new DcimPowerPortTemplatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortTemplatesListParamsWithTimeout(timeout time.Duration) *DcimPowerPortTemplatesListParams { + var () + return &DcimPowerPortTemplatesListParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortTemplatesListParamsWithContext creates a new DcimPowerPortTemplatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortTemplatesListParamsWithContext(ctx context.Context) *DcimPowerPortTemplatesListParams { + var () + return &DcimPowerPortTemplatesListParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortTemplatesListParamsWithHTTPClient creates a new DcimPowerPortTemplatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortTemplatesListParamsWithHTTPClient(client *http.Client) *DcimPowerPortTemplatesListParams { + var () + return &DcimPowerPortTemplatesListParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortTemplatesListParams contains all the parameters to send to the API endpoint +for the dcim power port templates list operation typically these are written to a http.Request +*/ +type DcimPowerPortTemplatesListParams struct { + + /*DevicetypeID*/ + DevicetypeID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithTimeout(timeout time.Duration) *DcimPowerPortTemplatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithContext(ctx context.Context) *DcimPowerPortTemplatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithHTTPClient(client *http.Client) *DcimPowerPortTemplatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevicetypeID adds the devicetypeID to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithDevicetypeID(devicetypeID *string) *DcimPowerPortTemplatesListParams { + o.SetDevicetypeID(devicetypeID) + return o +} + +// SetDevicetypeID adds the devicetypeId to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetDevicetypeID(devicetypeID *string) { + o.DevicetypeID = devicetypeID +} + +// WithLimit adds the limit to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithLimit(limit *int64) *DcimPowerPortTemplatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithName(name *string) *DcimPowerPortTemplatesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithOffset(offset *int64) *DcimPowerPortTemplatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DevicetypeID != nil { + + // query param devicetype_id + var qrDevicetypeID string + if o.DevicetypeID != nil { + qrDevicetypeID = *o.DevicetypeID + } + qDevicetypeID := qrDevicetypeID + if qDevicetypeID != "" { + if err := r.SetQueryParam("devicetype_id", qDevicetypeID); 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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_list_responses.go new file mode 100644 index 0000000..83daf9e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerPortTemplatesListReader is a Reader for the DcimPowerPortTemplatesList structure. +type DcimPowerPortTemplatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortTemplatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortTemplatesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPortTemplatesListOK creates a DcimPowerPortTemplatesListOK with default headers values +func NewDcimPowerPortTemplatesListOK() *DcimPowerPortTemplatesListOK { + return &DcimPowerPortTemplatesListOK{} +} + +/*DcimPowerPortTemplatesListOK handles this case with default header values. + +DcimPowerPortTemplatesListOK dcim power port templates list o k +*/ +type DcimPowerPortTemplatesListOK struct { + Payload *models.DcimPowerPortTemplatesListOKBody +} + +func (o *DcimPowerPortTemplatesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-port-templates/][%d] dcimPowerPortTemplatesListOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimPowerPortTemplatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_partial_update_parameters.go new file mode 100644 index 0000000..a79fd7a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerPortTemplatesPartialUpdateParams creates a new DcimPowerPortTemplatesPartialUpdateParams object +// with the default values initialized. +func NewDcimPowerPortTemplatesPartialUpdateParams() *DcimPowerPortTemplatesPartialUpdateParams { + var () + return &DcimPowerPortTemplatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortTemplatesPartialUpdateParamsWithTimeout creates a new DcimPowerPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerPortTemplatesPartialUpdateParams { + var () + return &DcimPowerPortTemplatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortTemplatesPartialUpdateParamsWithContext creates a new DcimPowerPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortTemplatesPartialUpdateParamsWithContext(ctx context.Context) *DcimPowerPortTemplatesPartialUpdateParams { + var () + return &DcimPowerPortTemplatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortTemplatesPartialUpdateParamsWithHTTPClient creates a new DcimPowerPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerPortTemplatesPartialUpdateParams { + var () + return &DcimPowerPortTemplatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim power port templates partial update operation typically these are written to a http.Request +*/ +type DcimPowerPortTemplatesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerPortTemplate + /*ID + A unique integer value identifying this power port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerPortTemplatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) WithContext(ctx context.Context) *DcimPowerPortTemplatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerPortTemplatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) WithData(data *models.WritablePowerPortTemplate) *DcimPowerPortTemplatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) SetData(data *models.WritablePowerPortTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) WithID(id int64) *DcimPowerPortTemplatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortTemplatesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_partial_update_responses.go new file mode 100644 index 0000000..9746c7e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerPortTemplatesPartialUpdateReader is a Reader for the DcimPowerPortTemplatesPartialUpdate structure. +type DcimPowerPortTemplatesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortTemplatesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPortTemplatesPartialUpdateOK creates a DcimPowerPortTemplatesPartialUpdateOK with default headers values +func NewDcimPowerPortTemplatesPartialUpdateOK() *DcimPowerPortTemplatesPartialUpdateOK { + return &DcimPowerPortTemplatesPartialUpdateOK{} +} + +/*DcimPowerPortTemplatesPartialUpdateOK handles this case with default header values. + +DcimPowerPortTemplatesPartialUpdateOK dcim power port templates partial update o k +*/ +type DcimPowerPortTemplatesPartialUpdateOK struct { + Payload *models.WritablePowerPortTemplate +} + +func (o *DcimPowerPortTemplatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/power-port-templates/{id}/][%d] dcimPowerPortTemplatesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_read_parameters.go new file mode 100644 index 0000000..a8dd7bb --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerPortTemplatesReadParams creates a new DcimPowerPortTemplatesReadParams object +// with the default values initialized. +func NewDcimPowerPortTemplatesReadParams() *DcimPowerPortTemplatesReadParams { + var () + return &DcimPowerPortTemplatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortTemplatesReadParamsWithTimeout creates a new DcimPowerPortTemplatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortTemplatesReadParamsWithTimeout(timeout time.Duration) *DcimPowerPortTemplatesReadParams { + var () + return &DcimPowerPortTemplatesReadParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortTemplatesReadParamsWithContext creates a new DcimPowerPortTemplatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortTemplatesReadParamsWithContext(ctx context.Context) *DcimPowerPortTemplatesReadParams { + var () + return &DcimPowerPortTemplatesReadParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortTemplatesReadParamsWithHTTPClient creates a new DcimPowerPortTemplatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortTemplatesReadParamsWithHTTPClient(client *http.Client) *DcimPowerPortTemplatesReadParams { + var () + return &DcimPowerPortTemplatesReadParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortTemplatesReadParams contains all the parameters to send to the API endpoint +for the dcim power port templates read operation typically these are written to a http.Request +*/ +type DcimPowerPortTemplatesReadParams struct { + + /*ID + A unique integer value identifying this power port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power port templates read params +func (o *DcimPowerPortTemplatesReadParams) WithTimeout(timeout time.Duration) *DcimPowerPortTemplatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power port templates read params +func (o *DcimPowerPortTemplatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power port templates read params +func (o *DcimPowerPortTemplatesReadParams) WithContext(ctx context.Context) *DcimPowerPortTemplatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power port templates read params +func (o *DcimPowerPortTemplatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power port templates read params +func (o *DcimPowerPortTemplatesReadParams) WithHTTPClient(client *http.Client) *DcimPowerPortTemplatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power port templates read params +func (o *DcimPowerPortTemplatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power port templates read params +func (o *DcimPowerPortTemplatesReadParams) WithID(id int64) *DcimPowerPortTemplatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power port templates read params +func (o *DcimPowerPortTemplatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortTemplatesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_read_responses.go new file mode 100644 index 0000000..4517170 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerPortTemplatesReadReader is a Reader for the DcimPowerPortTemplatesRead structure. +type DcimPowerPortTemplatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortTemplatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortTemplatesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPortTemplatesReadOK creates a DcimPowerPortTemplatesReadOK with default headers values +func NewDcimPowerPortTemplatesReadOK() *DcimPowerPortTemplatesReadOK { + return &DcimPowerPortTemplatesReadOK{} +} + +/*DcimPowerPortTemplatesReadOK handles this case with default header values. + +DcimPowerPortTemplatesReadOK dcim power port templates read o k +*/ +type DcimPowerPortTemplatesReadOK struct { + Payload *models.PowerPortTemplate +} + +func (o *DcimPowerPortTemplatesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-port-templates/{id}/][%d] dcimPowerPortTemplatesReadOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortTemplatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_update_parameters.go new file mode 100644 index 0000000..f1820eb --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerPortTemplatesUpdateParams creates a new DcimPowerPortTemplatesUpdateParams object +// with the default values initialized. +func NewDcimPowerPortTemplatesUpdateParams() *DcimPowerPortTemplatesUpdateParams { + var () + return &DcimPowerPortTemplatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortTemplatesUpdateParamsWithTimeout creates a new DcimPowerPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortTemplatesUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerPortTemplatesUpdateParams { + var () + return &DcimPowerPortTemplatesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortTemplatesUpdateParamsWithContext creates a new DcimPowerPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortTemplatesUpdateParamsWithContext(ctx context.Context) *DcimPowerPortTemplatesUpdateParams { + var () + return &DcimPowerPortTemplatesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortTemplatesUpdateParamsWithHTTPClient creates a new DcimPowerPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortTemplatesUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerPortTemplatesUpdateParams { + var () + return &DcimPowerPortTemplatesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortTemplatesUpdateParams contains all the parameters to send to the API endpoint +for the dcim power port templates update operation typically these are written to a http.Request +*/ +type DcimPowerPortTemplatesUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerPortTemplate + /*ID + A unique integer value identifying this power port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerPortTemplatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) WithContext(ctx context.Context) *DcimPowerPortTemplatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerPortTemplatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) WithData(data *models.WritablePowerPortTemplate) *DcimPowerPortTemplatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) SetData(data *models.WritablePowerPortTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) WithID(id int64) *DcimPowerPortTemplatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortTemplatesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_update_responses.go new file mode 100644 index 0000000..d19d457 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_port_templates_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerPortTemplatesUpdateReader is a Reader for the DcimPowerPortTemplatesUpdate structure. +type DcimPowerPortTemplatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortTemplatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortTemplatesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPortTemplatesUpdateOK creates a DcimPowerPortTemplatesUpdateOK with default headers values +func NewDcimPowerPortTemplatesUpdateOK() *DcimPowerPortTemplatesUpdateOK { + return &DcimPowerPortTemplatesUpdateOK{} +} + +/*DcimPowerPortTemplatesUpdateOK handles this case with default header values. + +DcimPowerPortTemplatesUpdateOK dcim power port templates update o k +*/ +type DcimPowerPortTemplatesUpdateOK struct { + Payload *models.WritablePowerPortTemplate +} + +func (o *DcimPowerPortTemplatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/power-port-templates/{id}/][%d] dcimPowerPortTemplatesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_create_parameters.go new file mode 100644 index 0000000..da44b48 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerPortsCreateParams creates a new DcimPowerPortsCreateParams object +// with the default values initialized. +func NewDcimPowerPortsCreateParams() *DcimPowerPortsCreateParams { + var () + return &DcimPowerPortsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortsCreateParamsWithTimeout creates a new DcimPowerPortsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortsCreateParamsWithTimeout(timeout time.Duration) *DcimPowerPortsCreateParams { + var () + return &DcimPowerPortsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortsCreateParamsWithContext creates a new DcimPowerPortsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortsCreateParamsWithContext(ctx context.Context) *DcimPowerPortsCreateParams { + var () + return &DcimPowerPortsCreateParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortsCreateParamsWithHTTPClient creates a new DcimPowerPortsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortsCreateParamsWithHTTPClient(client *http.Client) *DcimPowerPortsCreateParams { + var () + return &DcimPowerPortsCreateParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortsCreateParams contains all the parameters to send to the API endpoint +for the dcim power ports create operation typically these are written to a http.Request +*/ +type DcimPowerPortsCreateParams struct { + + /*Data*/ + Data *models.WritablePowerPort + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power ports create params +func (o *DcimPowerPortsCreateParams) WithTimeout(timeout time.Duration) *DcimPowerPortsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power ports create params +func (o *DcimPowerPortsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power ports create params +func (o *DcimPowerPortsCreateParams) WithContext(ctx context.Context) *DcimPowerPortsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power ports create params +func (o *DcimPowerPortsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power ports create params +func (o *DcimPowerPortsCreateParams) WithHTTPClient(client *http.Client) *DcimPowerPortsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power ports create params +func (o *DcimPowerPortsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power ports create params +func (o *DcimPowerPortsCreateParams) WithData(data *models.WritablePowerPort) *DcimPowerPortsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power ports create params +func (o *DcimPowerPortsCreateParams) SetData(data *models.WritablePowerPort) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_create_responses.go new file mode 100644 index 0000000..fd7c4b2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerPortsCreateReader is a Reader for the DcimPowerPortsCreate structure. +type DcimPowerPortsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimPowerPortsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPortsCreateCreated creates a DcimPowerPortsCreateCreated with default headers values +func NewDcimPowerPortsCreateCreated() *DcimPowerPortsCreateCreated { + return &DcimPowerPortsCreateCreated{} +} + +/*DcimPowerPortsCreateCreated handles this case with default header values. + +DcimPowerPortsCreateCreated dcim power ports create created +*/ +type DcimPowerPortsCreateCreated struct { + Payload *models.WritablePowerPort +} + +func (o *DcimPowerPortsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/power-ports/][%d] dcimPowerPortsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimPowerPortsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_delete_parameters.go new file mode 100644 index 0000000..04455a3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerPortsDeleteParams creates a new DcimPowerPortsDeleteParams object +// with the default values initialized. +func NewDcimPowerPortsDeleteParams() *DcimPowerPortsDeleteParams { + var () + return &DcimPowerPortsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortsDeleteParamsWithTimeout creates a new DcimPowerPortsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortsDeleteParamsWithTimeout(timeout time.Duration) *DcimPowerPortsDeleteParams { + var () + return &DcimPowerPortsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortsDeleteParamsWithContext creates a new DcimPowerPortsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortsDeleteParamsWithContext(ctx context.Context) *DcimPowerPortsDeleteParams { + var () + return &DcimPowerPortsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortsDeleteParamsWithHTTPClient creates a new DcimPowerPortsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortsDeleteParamsWithHTTPClient(client *http.Client) *DcimPowerPortsDeleteParams { + var () + return &DcimPowerPortsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortsDeleteParams contains all the parameters to send to the API endpoint +for the dcim power ports delete operation typically these are written to a http.Request +*/ +type DcimPowerPortsDeleteParams struct { + + /*ID + A unique integer value identifying this power port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power ports delete params +func (o *DcimPowerPortsDeleteParams) WithTimeout(timeout time.Duration) *DcimPowerPortsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power ports delete params +func (o *DcimPowerPortsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power ports delete params +func (o *DcimPowerPortsDeleteParams) WithContext(ctx context.Context) *DcimPowerPortsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power ports delete params +func (o *DcimPowerPortsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power ports delete params +func (o *DcimPowerPortsDeleteParams) WithHTTPClient(client *http.Client) *DcimPowerPortsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power ports delete params +func (o *DcimPowerPortsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power ports delete params +func (o *DcimPowerPortsDeleteParams) WithID(id int64) *DcimPowerPortsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power ports delete params +func (o *DcimPowerPortsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_delete_responses.go new file mode 100644 index 0000000..483f11a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimPowerPortsDeleteReader is a Reader for the DcimPowerPortsDelete structure. +type DcimPowerPortsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimPowerPortsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPortsDeleteNoContent creates a DcimPowerPortsDeleteNoContent with default headers values +func NewDcimPowerPortsDeleteNoContent() *DcimPowerPortsDeleteNoContent { + return &DcimPowerPortsDeleteNoContent{} +} + +/*DcimPowerPortsDeleteNoContent handles this case with default header values. + +DcimPowerPortsDeleteNoContent dcim power ports delete no content +*/ +type DcimPowerPortsDeleteNoContent struct { +} + +func (o *DcimPowerPortsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/power-ports/{id}/][%d] dcimPowerPortsDeleteNoContent ", 204) +} + +func (o *DcimPowerPortsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_list_parameters.go new file mode 100644 index 0000000..6db800c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_list_parameters.go @@ -0,0 +1,282 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerPortsListParams creates a new DcimPowerPortsListParams object +// with the default values initialized. +func NewDcimPowerPortsListParams() *DcimPowerPortsListParams { + var () + return &DcimPowerPortsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortsListParamsWithTimeout creates a new DcimPowerPortsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortsListParamsWithTimeout(timeout time.Duration) *DcimPowerPortsListParams { + var () + return &DcimPowerPortsListParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortsListParamsWithContext creates a new DcimPowerPortsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortsListParamsWithContext(ctx context.Context) *DcimPowerPortsListParams { + var () + return &DcimPowerPortsListParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortsListParamsWithHTTPClient creates a new DcimPowerPortsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortsListParamsWithHTTPClient(client *http.Client) *DcimPowerPortsListParams { + var () + return &DcimPowerPortsListParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortsListParams contains all the parameters to send to the API endpoint +for the dcim power ports list operation typically these are written to a http.Request +*/ +type DcimPowerPortsListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithTimeout(timeout time.Duration) *DcimPowerPortsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithContext(ctx context.Context) *DcimPowerPortsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithHTTPClient(client *http.Client) *DcimPowerPortsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithDevice(device *string) *DcimPowerPortsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithDeviceID(deviceID *string) *DcimPowerPortsListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithLimit adds the limit to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithLimit(limit *int64) *DcimPowerPortsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithName(name *string) *DcimPowerPortsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithOffset(offset *int64) *DcimPowerPortsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); 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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_list_responses.go new file mode 100644 index 0000000..d4ba8d4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerPortsListReader is a Reader for the DcimPowerPortsList structure. +type DcimPowerPortsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPortsListOK creates a DcimPowerPortsListOK with default headers values +func NewDcimPowerPortsListOK() *DcimPowerPortsListOK { + return &DcimPowerPortsListOK{} +} + +/*DcimPowerPortsListOK handles this case with default header values. + +DcimPowerPortsListOK dcim power ports list o k +*/ +type DcimPowerPortsListOK struct { + Payload *models.DcimPowerPortsListOKBody +} + +func (o *DcimPowerPortsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-ports/][%d] dcimPowerPortsListOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimPowerPortsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_partial_update_parameters.go new file mode 100644 index 0000000..25e0a5e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerPortsPartialUpdateParams creates a new DcimPowerPortsPartialUpdateParams object +// with the default values initialized. +func NewDcimPowerPortsPartialUpdateParams() *DcimPowerPortsPartialUpdateParams { + var () + return &DcimPowerPortsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortsPartialUpdateParamsWithTimeout creates a new DcimPowerPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerPortsPartialUpdateParams { + var () + return &DcimPowerPortsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortsPartialUpdateParamsWithContext creates a new DcimPowerPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortsPartialUpdateParamsWithContext(ctx context.Context) *DcimPowerPortsPartialUpdateParams { + var () + return &DcimPowerPortsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortsPartialUpdateParamsWithHTTPClient creates a new DcimPowerPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerPortsPartialUpdateParams { + var () + return &DcimPowerPortsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim power ports partial update operation typically these are written to a http.Request +*/ +type DcimPowerPortsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerPort + /*ID + A unique integer value identifying this power port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerPortsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) WithContext(ctx context.Context) *DcimPowerPortsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerPortsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) WithData(data *models.WritablePowerPort) *DcimPowerPortsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) SetData(data *models.WritablePowerPort) { + o.Data = data +} + +// WithID adds the id to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) WithID(id int64) *DcimPowerPortsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_partial_update_responses.go new file mode 100644 index 0000000..398fea9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerPortsPartialUpdateReader is a Reader for the DcimPowerPortsPartialUpdate structure. +type DcimPowerPortsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPortsPartialUpdateOK creates a DcimPowerPortsPartialUpdateOK with default headers values +func NewDcimPowerPortsPartialUpdateOK() *DcimPowerPortsPartialUpdateOK { + return &DcimPowerPortsPartialUpdateOK{} +} + +/*DcimPowerPortsPartialUpdateOK handles this case with default header values. + +DcimPowerPortsPartialUpdateOK dcim power ports partial update o k +*/ +type DcimPowerPortsPartialUpdateOK struct { + Payload *models.WritablePowerPort +} + +func (o *DcimPowerPortsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/power-ports/{id}/][%d] dcimPowerPortsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_read_parameters.go new file mode 100644 index 0000000..0916143 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerPortsReadParams creates a new DcimPowerPortsReadParams object +// with the default values initialized. +func NewDcimPowerPortsReadParams() *DcimPowerPortsReadParams { + var () + return &DcimPowerPortsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortsReadParamsWithTimeout creates a new DcimPowerPortsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortsReadParamsWithTimeout(timeout time.Duration) *DcimPowerPortsReadParams { + var () + return &DcimPowerPortsReadParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortsReadParamsWithContext creates a new DcimPowerPortsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortsReadParamsWithContext(ctx context.Context) *DcimPowerPortsReadParams { + var () + return &DcimPowerPortsReadParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortsReadParamsWithHTTPClient creates a new DcimPowerPortsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortsReadParamsWithHTTPClient(client *http.Client) *DcimPowerPortsReadParams { + var () + return &DcimPowerPortsReadParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortsReadParams contains all the parameters to send to the API endpoint +for the dcim power ports read operation typically these are written to a http.Request +*/ +type DcimPowerPortsReadParams struct { + + /*ID + A unique integer value identifying this power port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power ports read params +func (o *DcimPowerPortsReadParams) WithTimeout(timeout time.Duration) *DcimPowerPortsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power ports read params +func (o *DcimPowerPortsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power ports read params +func (o *DcimPowerPortsReadParams) WithContext(ctx context.Context) *DcimPowerPortsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power ports read params +func (o *DcimPowerPortsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power ports read params +func (o *DcimPowerPortsReadParams) WithHTTPClient(client *http.Client) *DcimPowerPortsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power ports read params +func (o *DcimPowerPortsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power ports read params +func (o *DcimPowerPortsReadParams) WithID(id int64) *DcimPowerPortsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power ports read params +func (o *DcimPowerPortsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_read_responses.go new file mode 100644 index 0000000..a85e478 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerPortsReadReader is a Reader for the DcimPowerPortsRead structure. +type DcimPowerPortsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPortsReadOK creates a DcimPowerPortsReadOK with default headers values +func NewDcimPowerPortsReadOK() *DcimPowerPortsReadOK { + return &DcimPowerPortsReadOK{} +} + +/*DcimPowerPortsReadOK handles this case with default header values. + +DcimPowerPortsReadOK dcim power ports read o k +*/ +type DcimPowerPortsReadOK struct { + Payload *models.PowerPort +} + +func (o *DcimPowerPortsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-ports/{id}/][%d] dcimPowerPortsReadOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_update_parameters.go new file mode 100644 index 0000000..05299dd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerPortsUpdateParams creates a new DcimPowerPortsUpdateParams object +// with the default values initialized. +func NewDcimPowerPortsUpdateParams() *DcimPowerPortsUpdateParams { + var () + return &DcimPowerPortsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortsUpdateParamsWithTimeout creates a new DcimPowerPortsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortsUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerPortsUpdateParams { + var () + return &DcimPowerPortsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortsUpdateParamsWithContext creates a new DcimPowerPortsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortsUpdateParamsWithContext(ctx context.Context) *DcimPowerPortsUpdateParams { + var () + return &DcimPowerPortsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortsUpdateParamsWithHTTPClient creates a new DcimPowerPortsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortsUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerPortsUpdateParams { + var () + return &DcimPowerPortsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortsUpdateParams contains all the parameters to send to the API endpoint +for the dcim power ports update operation typically these are written to a http.Request +*/ +type DcimPowerPortsUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerPort + /*ID + A unique integer value identifying this power port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerPortsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) WithContext(ctx context.Context) *DcimPowerPortsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerPortsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) WithData(data *models.WritablePowerPort) *DcimPowerPortsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) SetData(data *models.WritablePowerPort) { + o.Data = data +} + +// WithID adds the id to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) WithID(id int64) *DcimPowerPortsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_update_responses.go new file mode 100644 index 0000000..db4b090 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_power_ports_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerPortsUpdateReader is a Reader for the DcimPowerPortsUpdate structure. +type DcimPowerPortsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPortsUpdateOK creates a DcimPowerPortsUpdateOK with default headers values +func NewDcimPowerPortsUpdateOK() *DcimPowerPortsUpdateOK { + return &DcimPowerPortsUpdateOK{} +} + +/*DcimPowerPortsUpdateOK handles this case with default header values. + +DcimPowerPortsUpdateOK dcim power ports update o k +*/ +type DcimPowerPortsUpdateOK struct { + Payload *models.WritablePowerPort +} + +func (o *DcimPowerPortsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/power-ports/{id}/][%d] dcimPowerPortsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_create_parameters.go new file mode 100644 index 0000000..fe004c2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRackGroupsCreateParams creates a new DcimRackGroupsCreateParams object +// with the default values initialized. +func NewDcimRackGroupsCreateParams() *DcimRackGroupsCreateParams { + var () + return &DcimRackGroupsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackGroupsCreateParamsWithTimeout creates a new DcimRackGroupsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackGroupsCreateParamsWithTimeout(timeout time.Duration) *DcimRackGroupsCreateParams { + var () + return &DcimRackGroupsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimRackGroupsCreateParamsWithContext creates a new DcimRackGroupsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackGroupsCreateParamsWithContext(ctx context.Context) *DcimRackGroupsCreateParams { + var () + return &DcimRackGroupsCreateParams{ + + Context: ctx, + } +} + +// NewDcimRackGroupsCreateParamsWithHTTPClient creates a new DcimRackGroupsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackGroupsCreateParamsWithHTTPClient(client *http.Client) *DcimRackGroupsCreateParams { + var () + return &DcimRackGroupsCreateParams{ + HTTPClient: client, + } +} + +/*DcimRackGroupsCreateParams contains all the parameters to send to the API endpoint +for the dcim rack groups create operation typically these are written to a http.Request +*/ +type DcimRackGroupsCreateParams struct { + + /*Data*/ + Data *models.WritableRackGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack groups create params +func (o *DcimRackGroupsCreateParams) WithTimeout(timeout time.Duration) *DcimRackGroupsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack groups create params +func (o *DcimRackGroupsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack groups create params +func (o *DcimRackGroupsCreateParams) WithContext(ctx context.Context) *DcimRackGroupsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack groups create params +func (o *DcimRackGroupsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack groups create params +func (o *DcimRackGroupsCreateParams) WithHTTPClient(client *http.Client) *DcimRackGroupsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack groups create params +func (o *DcimRackGroupsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack groups create params +func (o *DcimRackGroupsCreateParams) WithData(data *models.WritableRackGroup) *DcimRackGroupsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack groups create params +func (o *DcimRackGroupsCreateParams) SetData(data *models.WritableRackGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackGroupsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_create_responses.go new file mode 100644 index 0000000..651256a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRackGroupsCreateReader is a Reader for the DcimRackGroupsCreate structure. +type DcimRackGroupsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackGroupsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimRackGroupsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackGroupsCreateCreated creates a DcimRackGroupsCreateCreated with default headers values +func NewDcimRackGroupsCreateCreated() *DcimRackGroupsCreateCreated { + return &DcimRackGroupsCreateCreated{} +} + +/*DcimRackGroupsCreateCreated handles this case with default header values. + +DcimRackGroupsCreateCreated dcim rack groups create created +*/ +type DcimRackGroupsCreateCreated struct { + Payload *models.WritableRackGroup +} + +func (o *DcimRackGroupsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/rack-groups/][%d] dcimRackGroupsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimRackGroupsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRackGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_delete_parameters.go new file mode 100644 index 0000000..407e8fd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRackGroupsDeleteParams creates a new DcimRackGroupsDeleteParams object +// with the default values initialized. +func NewDcimRackGroupsDeleteParams() *DcimRackGroupsDeleteParams { + var () + return &DcimRackGroupsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackGroupsDeleteParamsWithTimeout creates a new DcimRackGroupsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackGroupsDeleteParamsWithTimeout(timeout time.Duration) *DcimRackGroupsDeleteParams { + var () + return &DcimRackGroupsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimRackGroupsDeleteParamsWithContext creates a new DcimRackGroupsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackGroupsDeleteParamsWithContext(ctx context.Context) *DcimRackGroupsDeleteParams { + var () + return &DcimRackGroupsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimRackGroupsDeleteParamsWithHTTPClient creates a new DcimRackGroupsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackGroupsDeleteParamsWithHTTPClient(client *http.Client) *DcimRackGroupsDeleteParams { + var () + return &DcimRackGroupsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimRackGroupsDeleteParams contains all the parameters to send to the API endpoint +for the dcim rack groups delete operation typically these are written to a http.Request +*/ +type DcimRackGroupsDeleteParams struct { + + /*ID + A unique integer value identifying this rack group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack groups delete params +func (o *DcimRackGroupsDeleteParams) WithTimeout(timeout time.Duration) *DcimRackGroupsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack groups delete params +func (o *DcimRackGroupsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack groups delete params +func (o *DcimRackGroupsDeleteParams) WithContext(ctx context.Context) *DcimRackGroupsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack groups delete params +func (o *DcimRackGroupsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack groups delete params +func (o *DcimRackGroupsDeleteParams) WithHTTPClient(client *http.Client) *DcimRackGroupsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack groups delete params +func (o *DcimRackGroupsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim rack groups delete params +func (o *DcimRackGroupsDeleteParams) WithID(id int64) *DcimRackGroupsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack groups delete params +func (o *DcimRackGroupsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackGroupsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_delete_responses.go new file mode 100644 index 0000000..fb59a5f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimRackGroupsDeleteReader is a Reader for the DcimRackGroupsDelete structure. +type DcimRackGroupsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackGroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimRackGroupsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackGroupsDeleteNoContent creates a DcimRackGroupsDeleteNoContent with default headers values +func NewDcimRackGroupsDeleteNoContent() *DcimRackGroupsDeleteNoContent { + return &DcimRackGroupsDeleteNoContent{} +} + +/*DcimRackGroupsDeleteNoContent handles this case with default header values. + +DcimRackGroupsDeleteNoContent dcim rack groups delete no content +*/ +type DcimRackGroupsDeleteNoContent struct { +} + +func (o *DcimRackGroupsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/rack-groups/{id}/][%d] dcimRackGroupsDeleteNoContent ", 204) +} + +func (o *DcimRackGroupsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_list_parameters.go new file mode 100644 index 0000000..dedc12c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_list_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRackGroupsListParams creates a new DcimRackGroupsListParams object +// with the default values initialized. +func NewDcimRackGroupsListParams() *DcimRackGroupsListParams { + var () + return &DcimRackGroupsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackGroupsListParamsWithTimeout creates a new DcimRackGroupsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackGroupsListParamsWithTimeout(timeout time.Duration) *DcimRackGroupsListParams { + var () + return &DcimRackGroupsListParams{ + + timeout: timeout, + } +} + +// NewDcimRackGroupsListParamsWithContext creates a new DcimRackGroupsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackGroupsListParamsWithContext(ctx context.Context) *DcimRackGroupsListParams { + var () + return &DcimRackGroupsListParams{ + + Context: ctx, + } +} + +// NewDcimRackGroupsListParamsWithHTTPClient creates a new DcimRackGroupsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackGroupsListParamsWithHTTPClient(client *http.Client) *DcimRackGroupsListParams { + var () + return &DcimRackGroupsListParams{ + HTTPClient: client, + } +} + +/*DcimRackGroupsListParams contains all the parameters to send to the API endpoint +for the dcim rack groups list operation typically these are written to a http.Request +*/ +type DcimRackGroupsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithTimeout(timeout time.Duration) *DcimRackGroupsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithContext(ctx context.Context) *DcimRackGroupsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithHTTPClient(client *http.Client) *DcimRackGroupsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithLimit(limit *int64) *DcimRackGroupsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithName(name *string) *DcimRackGroupsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithOffset(offset *int64) *DcimRackGroupsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSite adds the site to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithSite(site *string) *DcimRackGroupsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithSiteID(siteID *string) *DcimRackGroupsListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithSlug adds the slug to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithSlug(slug *string) *DcimRackGroupsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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.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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_list_responses.go new file mode 100644 index 0000000..20cda21 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRackGroupsListReader is a Reader for the DcimRackGroupsList structure. +type DcimRackGroupsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackGroupsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackGroupsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackGroupsListOK creates a DcimRackGroupsListOK with default headers values +func NewDcimRackGroupsListOK() *DcimRackGroupsListOK { + return &DcimRackGroupsListOK{} +} + +/*DcimRackGroupsListOK handles this case with default header values. + +DcimRackGroupsListOK dcim rack groups list o k +*/ +type DcimRackGroupsListOK struct { + Payload *models.DcimRackGroupsListOKBody +} + +func (o *DcimRackGroupsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/rack-groups/][%d] dcimRackGroupsListOK %+v", 200, o.Payload) +} + +func (o *DcimRackGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimRackGroupsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_partial_update_parameters.go new file mode 100644 index 0000000..e6061df --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRackGroupsPartialUpdateParams creates a new DcimRackGroupsPartialUpdateParams object +// with the default values initialized. +func NewDcimRackGroupsPartialUpdateParams() *DcimRackGroupsPartialUpdateParams { + var () + return &DcimRackGroupsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackGroupsPartialUpdateParamsWithTimeout creates a new DcimRackGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackGroupsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimRackGroupsPartialUpdateParams { + var () + return &DcimRackGroupsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRackGroupsPartialUpdateParamsWithContext creates a new DcimRackGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackGroupsPartialUpdateParamsWithContext(ctx context.Context) *DcimRackGroupsPartialUpdateParams { + var () + return &DcimRackGroupsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRackGroupsPartialUpdateParamsWithHTTPClient creates a new DcimRackGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackGroupsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimRackGroupsPartialUpdateParams { + var () + return &DcimRackGroupsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRackGroupsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim rack groups partial update operation typically these are written to a http.Request +*/ +type DcimRackGroupsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableRackGroup + /*ID + A unique integer value identifying this rack group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimRackGroupsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) WithContext(ctx context.Context) *DcimRackGroupsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimRackGroupsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) WithData(data *models.WritableRackGroup) *DcimRackGroupsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) SetData(data *models.WritableRackGroup) { + o.Data = data +} + +// WithID adds the id to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) WithID(id int64) *DcimRackGroupsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackGroupsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_partial_update_responses.go new file mode 100644 index 0000000..bde1d46 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRackGroupsPartialUpdateReader is a Reader for the DcimRackGroupsPartialUpdate structure. +type DcimRackGroupsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackGroupsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackGroupsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackGroupsPartialUpdateOK creates a DcimRackGroupsPartialUpdateOK with default headers values +func NewDcimRackGroupsPartialUpdateOK() *DcimRackGroupsPartialUpdateOK { + return &DcimRackGroupsPartialUpdateOK{} +} + +/*DcimRackGroupsPartialUpdateOK handles this case with default header values. + +DcimRackGroupsPartialUpdateOK dcim rack groups partial update o k +*/ +type DcimRackGroupsPartialUpdateOK struct { + Payload *models.WritableRackGroup +} + +func (o *DcimRackGroupsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/rack-groups/{id}/][%d] dcimRackGroupsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRackGroupsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRackGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_read_parameters.go new file mode 100644 index 0000000..d38f929 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRackGroupsReadParams creates a new DcimRackGroupsReadParams object +// with the default values initialized. +func NewDcimRackGroupsReadParams() *DcimRackGroupsReadParams { + var () + return &DcimRackGroupsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackGroupsReadParamsWithTimeout creates a new DcimRackGroupsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackGroupsReadParamsWithTimeout(timeout time.Duration) *DcimRackGroupsReadParams { + var () + return &DcimRackGroupsReadParams{ + + timeout: timeout, + } +} + +// NewDcimRackGroupsReadParamsWithContext creates a new DcimRackGroupsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackGroupsReadParamsWithContext(ctx context.Context) *DcimRackGroupsReadParams { + var () + return &DcimRackGroupsReadParams{ + + Context: ctx, + } +} + +// NewDcimRackGroupsReadParamsWithHTTPClient creates a new DcimRackGroupsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackGroupsReadParamsWithHTTPClient(client *http.Client) *DcimRackGroupsReadParams { + var () + return &DcimRackGroupsReadParams{ + HTTPClient: client, + } +} + +/*DcimRackGroupsReadParams contains all the parameters to send to the API endpoint +for the dcim rack groups read operation typically these are written to a http.Request +*/ +type DcimRackGroupsReadParams struct { + + /*ID + A unique integer value identifying this rack group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack groups read params +func (o *DcimRackGroupsReadParams) WithTimeout(timeout time.Duration) *DcimRackGroupsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack groups read params +func (o *DcimRackGroupsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack groups read params +func (o *DcimRackGroupsReadParams) WithContext(ctx context.Context) *DcimRackGroupsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack groups read params +func (o *DcimRackGroupsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack groups read params +func (o *DcimRackGroupsReadParams) WithHTTPClient(client *http.Client) *DcimRackGroupsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack groups read params +func (o *DcimRackGroupsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim rack groups read params +func (o *DcimRackGroupsReadParams) WithID(id int64) *DcimRackGroupsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack groups read params +func (o *DcimRackGroupsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackGroupsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_read_responses.go new file mode 100644 index 0000000..962177a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRackGroupsReadReader is a Reader for the DcimRackGroupsRead structure. +type DcimRackGroupsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackGroupsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackGroupsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackGroupsReadOK creates a DcimRackGroupsReadOK with default headers values +func NewDcimRackGroupsReadOK() *DcimRackGroupsReadOK { + return &DcimRackGroupsReadOK{} +} + +/*DcimRackGroupsReadOK handles this case with default header values. + +DcimRackGroupsReadOK dcim rack groups read o k +*/ +type DcimRackGroupsReadOK struct { + Payload *models.RackGroup +} + +func (o *DcimRackGroupsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/rack-groups/{id}/][%d] dcimRackGroupsReadOK %+v", 200, o.Payload) +} + +func (o *DcimRackGroupsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RackGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_update_parameters.go new file mode 100644 index 0000000..1538164 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRackGroupsUpdateParams creates a new DcimRackGroupsUpdateParams object +// with the default values initialized. +func NewDcimRackGroupsUpdateParams() *DcimRackGroupsUpdateParams { + var () + return &DcimRackGroupsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackGroupsUpdateParamsWithTimeout creates a new DcimRackGroupsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackGroupsUpdateParamsWithTimeout(timeout time.Duration) *DcimRackGroupsUpdateParams { + var () + return &DcimRackGroupsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRackGroupsUpdateParamsWithContext creates a new DcimRackGroupsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackGroupsUpdateParamsWithContext(ctx context.Context) *DcimRackGroupsUpdateParams { + var () + return &DcimRackGroupsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRackGroupsUpdateParamsWithHTTPClient creates a new DcimRackGroupsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackGroupsUpdateParamsWithHTTPClient(client *http.Client) *DcimRackGroupsUpdateParams { + var () + return &DcimRackGroupsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRackGroupsUpdateParams contains all the parameters to send to the API endpoint +for the dcim rack groups update operation typically these are written to a http.Request +*/ +type DcimRackGroupsUpdateParams struct { + + /*Data*/ + Data *models.WritableRackGroup + /*ID + A unique integer value identifying this rack group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) WithTimeout(timeout time.Duration) *DcimRackGroupsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) WithContext(ctx context.Context) *DcimRackGroupsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) WithHTTPClient(client *http.Client) *DcimRackGroupsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) WithData(data *models.WritableRackGroup) *DcimRackGroupsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) SetData(data *models.WritableRackGroup) { + o.Data = data +} + +// WithID adds the id to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) WithID(id int64) *DcimRackGroupsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackGroupsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_update_responses.go new file mode 100644 index 0000000..d43c50f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_groups_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRackGroupsUpdateReader is a Reader for the DcimRackGroupsUpdate structure. +type DcimRackGroupsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackGroupsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackGroupsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackGroupsUpdateOK creates a DcimRackGroupsUpdateOK with default headers values +func NewDcimRackGroupsUpdateOK() *DcimRackGroupsUpdateOK { + return &DcimRackGroupsUpdateOK{} +} + +/*DcimRackGroupsUpdateOK handles this case with default header values. + +DcimRackGroupsUpdateOK dcim rack groups update o k +*/ +type DcimRackGroupsUpdateOK struct { + Payload *models.WritableRackGroup +} + +func (o *DcimRackGroupsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/rack-groups/{id}/][%d] dcimRackGroupsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRackGroupsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRackGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_create_parameters.go new file mode 100644 index 0000000..c1a1ad2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRackReservationsCreateParams creates a new DcimRackReservationsCreateParams object +// with the default values initialized. +func NewDcimRackReservationsCreateParams() *DcimRackReservationsCreateParams { + var () + return &DcimRackReservationsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackReservationsCreateParamsWithTimeout creates a new DcimRackReservationsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackReservationsCreateParamsWithTimeout(timeout time.Duration) *DcimRackReservationsCreateParams { + var () + return &DcimRackReservationsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimRackReservationsCreateParamsWithContext creates a new DcimRackReservationsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackReservationsCreateParamsWithContext(ctx context.Context) *DcimRackReservationsCreateParams { + var () + return &DcimRackReservationsCreateParams{ + + Context: ctx, + } +} + +// NewDcimRackReservationsCreateParamsWithHTTPClient creates a new DcimRackReservationsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackReservationsCreateParamsWithHTTPClient(client *http.Client) *DcimRackReservationsCreateParams { + var () + return &DcimRackReservationsCreateParams{ + HTTPClient: client, + } +} + +/*DcimRackReservationsCreateParams contains all the parameters to send to the API endpoint +for the dcim rack reservations create operation typically these are written to a http.Request +*/ +type DcimRackReservationsCreateParams struct { + + /*Data*/ + Data *models.WritableRackReservation + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack reservations create params +func (o *DcimRackReservationsCreateParams) WithTimeout(timeout time.Duration) *DcimRackReservationsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack reservations create params +func (o *DcimRackReservationsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack reservations create params +func (o *DcimRackReservationsCreateParams) WithContext(ctx context.Context) *DcimRackReservationsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack reservations create params +func (o *DcimRackReservationsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack reservations create params +func (o *DcimRackReservationsCreateParams) WithHTTPClient(client *http.Client) *DcimRackReservationsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack reservations create params +func (o *DcimRackReservationsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack reservations create params +func (o *DcimRackReservationsCreateParams) WithData(data *models.WritableRackReservation) *DcimRackReservationsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack reservations create params +func (o *DcimRackReservationsCreateParams) SetData(data *models.WritableRackReservation) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackReservationsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_create_responses.go new file mode 100644 index 0000000..002160b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRackReservationsCreateReader is a Reader for the DcimRackReservationsCreate structure. +type DcimRackReservationsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackReservationsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimRackReservationsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackReservationsCreateCreated creates a DcimRackReservationsCreateCreated with default headers values +func NewDcimRackReservationsCreateCreated() *DcimRackReservationsCreateCreated { + return &DcimRackReservationsCreateCreated{} +} + +/*DcimRackReservationsCreateCreated handles this case with default header values. + +DcimRackReservationsCreateCreated dcim rack reservations create created +*/ +type DcimRackReservationsCreateCreated struct { + Payload *models.WritableRackReservation +} + +func (o *DcimRackReservationsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/rack-reservations/][%d] dcimRackReservationsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimRackReservationsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRackReservation) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_delete_parameters.go new file mode 100644 index 0000000..97b77bf --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRackReservationsDeleteParams creates a new DcimRackReservationsDeleteParams object +// with the default values initialized. +func NewDcimRackReservationsDeleteParams() *DcimRackReservationsDeleteParams { + var () + return &DcimRackReservationsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackReservationsDeleteParamsWithTimeout creates a new DcimRackReservationsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackReservationsDeleteParamsWithTimeout(timeout time.Duration) *DcimRackReservationsDeleteParams { + var () + return &DcimRackReservationsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimRackReservationsDeleteParamsWithContext creates a new DcimRackReservationsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackReservationsDeleteParamsWithContext(ctx context.Context) *DcimRackReservationsDeleteParams { + var () + return &DcimRackReservationsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimRackReservationsDeleteParamsWithHTTPClient creates a new DcimRackReservationsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackReservationsDeleteParamsWithHTTPClient(client *http.Client) *DcimRackReservationsDeleteParams { + var () + return &DcimRackReservationsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimRackReservationsDeleteParams contains all the parameters to send to the API endpoint +for the dcim rack reservations delete operation typically these are written to a http.Request +*/ +type DcimRackReservationsDeleteParams struct { + + /*ID + A unique integer value identifying this rack reservation. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack reservations delete params +func (o *DcimRackReservationsDeleteParams) WithTimeout(timeout time.Duration) *DcimRackReservationsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack reservations delete params +func (o *DcimRackReservationsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack reservations delete params +func (o *DcimRackReservationsDeleteParams) WithContext(ctx context.Context) *DcimRackReservationsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack reservations delete params +func (o *DcimRackReservationsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack reservations delete params +func (o *DcimRackReservationsDeleteParams) WithHTTPClient(client *http.Client) *DcimRackReservationsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack reservations delete params +func (o *DcimRackReservationsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim rack reservations delete params +func (o *DcimRackReservationsDeleteParams) WithID(id int64) *DcimRackReservationsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack reservations delete params +func (o *DcimRackReservationsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackReservationsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_delete_responses.go new file mode 100644 index 0000000..a6a5eca --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimRackReservationsDeleteReader is a Reader for the DcimRackReservationsDelete structure. +type DcimRackReservationsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackReservationsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimRackReservationsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackReservationsDeleteNoContent creates a DcimRackReservationsDeleteNoContent with default headers values +func NewDcimRackReservationsDeleteNoContent() *DcimRackReservationsDeleteNoContent { + return &DcimRackReservationsDeleteNoContent{} +} + +/*DcimRackReservationsDeleteNoContent handles this case with default header values. + +DcimRackReservationsDeleteNoContent dcim rack reservations delete no content +*/ +type DcimRackReservationsDeleteNoContent struct { +} + +func (o *DcimRackReservationsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/rack-reservations/{id}/][%d] dcimRackReservationsDeleteNoContent ", 204) +} + +func (o *DcimRackReservationsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_list_parameters.go new file mode 100644 index 0000000..bf4fd02 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_list_parameters.go @@ -0,0 +1,546 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRackReservationsListParams creates a new DcimRackReservationsListParams object +// with the default values initialized. +func NewDcimRackReservationsListParams() *DcimRackReservationsListParams { + var () + return &DcimRackReservationsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackReservationsListParamsWithTimeout creates a new DcimRackReservationsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackReservationsListParamsWithTimeout(timeout time.Duration) *DcimRackReservationsListParams { + var () + return &DcimRackReservationsListParams{ + + timeout: timeout, + } +} + +// NewDcimRackReservationsListParamsWithContext creates a new DcimRackReservationsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackReservationsListParamsWithContext(ctx context.Context) *DcimRackReservationsListParams { + var () + return &DcimRackReservationsListParams{ + + Context: ctx, + } +} + +// NewDcimRackReservationsListParamsWithHTTPClient creates a new DcimRackReservationsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackReservationsListParamsWithHTTPClient(client *http.Client) *DcimRackReservationsListParams { + var () + return &DcimRackReservationsListParams{ + HTTPClient: client, + } +} + +/*DcimRackReservationsListParams contains all the parameters to send to the API endpoint +for the dcim rack reservations list operation typically these are written to a http.Request +*/ +type DcimRackReservationsListParams struct { + + /*Created*/ + Created *string + /*Group*/ + Group *string + /*GroupID*/ + GroupID *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *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 + /*RackID*/ + RackID *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + /*User*/ + User *string + /*UserID*/ + UserID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithTimeout(timeout time.Duration) *DcimRackReservationsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithContext(ctx context.Context) *DcimRackReservationsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithHTTPClient(client *http.Client) *DcimRackReservationsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreated adds the created to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithCreated(created *string) *DcimRackReservationsListParams { + o.SetCreated(created) + return o +} + +// SetCreated adds the created to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetCreated(created *string) { + o.Created = created +} + +// WithGroup adds the group to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithGroup(group *string) *DcimRackReservationsListParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetGroup(group *string) { + o.Group = group +} + +// WithGroupID adds the groupID to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithGroupID(groupID *string) *DcimRackReservationsListParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetGroupID(groupID *string) { + o.GroupID = groupID +} + +// WithIDIn adds the iDIn to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithIDIn(iDIn *string) *DcimRackReservationsListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithLimit(limit *int64) *DcimRackReservationsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithOffset(offset *int64) *DcimRackReservationsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithQ(q *string) *DcimRackReservationsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetQ(q *string) { + o.Q = q +} + +// WithRackID adds the rackID to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithRackID(rackID *string) *DcimRackReservationsListParams { + o.SetRackID(rackID) + return o +} + +// SetRackID adds the rackId to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetRackID(rackID *string) { + o.RackID = rackID +} + +// WithSite adds the site to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithSite(site *string) *DcimRackReservationsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithSiteID(siteID *string) *DcimRackReservationsListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithTenant adds the tenant to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithTenant(tenant *string) *DcimRackReservationsListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithTenantID(tenantID *string) *DcimRackReservationsListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WithUser adds the user to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithUser(user *string) *DcimRackReservationsListParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetUser(user *string) { + o.User = user +} + +// WithUserID adds the userID to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithUserID(userID *string) *DcimRackReservationsListParams { + o.SetUserID(userID) + return o +} + +// SetUserID adds the userId to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetUserID(userID *string) { + o.UserID = userID +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackReservationsListParams) 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.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.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.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); 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.RackID != nil { + + // query param rack_id + var qrRackID string + if o.RackID != nil { + qrRackID = *o.RackID + } + qRackID := qrRackID + if qRackID != "" { + if err := r.SetQueryParam("rack_id", qRackID); 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.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.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.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.User != nil { + + // query param user + var qrUser string + if o.User != nil { + qrUser = *o.User + } + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + } + + if o.UserID != nil { + + // query param user_id + var qrUserID string + if o.UserID != nil { + qrUserID = *o.UserID + } + qUserID := qrUserID + if qUserID != "" { + if err := r.SetQueryParam("user_id", qUserID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_list_responses.go new file mode 100644 index 0000000..b6f13da --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRackReservationsListReader is a Reader for the DcimRackReservationsList structure. +type DcimRackReservationsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackReservationsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackReservationsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackReservationsListOK creates a DcimRackReservationsListOK with default headers values +func NewDcimRackReservationsListOK() *DcimRackReservationsListOK { + return &DcimRackReservationsListOK{} +} + +/*DcimRackReservationsListOK handles this case with default header values. + +DcimRackReservationsListOK dcim rack reservations list o k +*/ +type DcimRackReservationsListOK struct { + Payload *models.DcimRackReservationsListOKBody +} + +func (o *DcimRackReservationsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/rack-reservations/][%d] dcimRackReservationsListOK %+v", 200, o.Payload) +} + +func (o *DcimRackReservationsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimRackReservationsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_partial_update_parameters.go new file mode 100644 index 0000000..19718df --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRackReservationsPartialUpdateParams creates a new DcimRackReservationsPartialUpdateParams object +// with the default values initialized. +func NewDcimRackReservationsPartialUpdateParams() *DcimRackReservationsPartialUpdateParams { + var () + return &DcimRackReservationsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackReservationsPartialUpdateParamsWithTimeout creates a new DcimRackReservationsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackReservationsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimRackReservationsPartialUpdateParams { + var () + return &DcimRackReservationsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRackReservationsPartialUpdateParamsWithContext creates a new DcimRackReservationsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackReservationsPartialUpdateParamsWithContext(ctx context.Context) *DcimRackReservationsPartialUpdateParams { + var () + return &DcimRackReservationsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRackReservationsPartialUpdateParamsWithHTTPClient creates a new DcimRackReservationsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackReservationsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimRackReservationsPartialUpdateParams { + var () + return &DcimRackReservationsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRackReservationsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim rack reservations partial update operation typically these are written to a http.Request +*/ +type DcimRackReservationsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableRackReservation + /*ID + A unique integer value identifying this rack reservation. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimRackReservationsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) WithContext(ctx context.Context) *DcimRackReservationsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimRackReservationsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) WithData(data *models.WritableRackReservation) *DcimRackReservationsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) SetData(data *models.WritableRackReservation) { + o.Data = data +} + +// WithID adds the id to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) WithID(id int64) *DcimRackReservationsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackReservationsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_partial_update_responses.go new file mode 100644 index 0000000..20a059d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRackReservationsPartialUpdateReader is a Reader for the DcimRackReservationsPartialUpdate structure. +type DcimRackReservationsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackReservationsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackReservationsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackReservationsPartialUpdateOK creates a DcimRackReservationsPartialUpdateOK with default headers values +func NewDcimRackReservationsPartialUpdateOK() *DcimRackReservationsPartialUpdateOK { + return &DcimRackReservationsPartialUpdateOK{} +} + +/*DcimRackReservationsPartialUpdateOK handles this case with default header values. + +DcimRackReservationsPartialUpdateOK dcim rack reservations partial update o k +*/ +type DcimRackReservationsPartialUpdateOK struct { + Payload *models.WritableRackReservation +} + +func (o *DcimRackReservationsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/rack-reservations/{id}/][%d] dcimRackReservationsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRackReservationsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRackReservation) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_read_parameters.go new file mode 100644 index 0000000..c24f8dd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRackReservationsReadParams creates a new DcimRackReservationsReadParams object +// with the default values initialized. +func NewDcimRackReservationsReadParams() *DcimRackReservationsReadParams { + var () + return &DcimRackReservationsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackReservationsReadParamsWithTimeout creates a new DcimRackReservationsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackReservationsReadParamsWithTimeout(timeout time.Duration) *DcimRackReservationsReadParams { + var () + return &DcimRackReservationsReadParams{ + + timeout: timeout, + } +} + +// NewDcimRackReservationsReadParamsWithContext creates a new DcimRackReservationsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackReservationsReadParamsWithContext(ctx context.Context) *DcimRackReservationsReadParams { + var () + return &DcimRackReservationsReadParams{ + + Context: ctx, + } +} + +// NewDcimRackReservationsReadParamsWithHTTPClient creates a new DcimRackReservationsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackReservationsReadParamsWithHTTPClient(client *http.Client) *DcimRackReservationsReadParams { + var () + return &DcimRackReservationsReadParams{ + HTTPClient: client, + } +} + +/*DcimRackReservationsReadParams contains all the parameters to send to the API endpoint +for the dcim rack reservations read operation typically these are written to a http.Request +*/ +type DcimRackReservationsReadParams struct { + + /*ID + A unique integer value identifying this rack reservation. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack reservations read params +func (o *DcimRackReservationsReadParams) WithTimeout(timeout time.Duration) *DcimRackReservationsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack reservations read params +func (o *DcimRackReservationsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack reservations read params +func (o *DcimRackReservationsReadParams) WithContext(ctx context.Context) *DcimRackReservationsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack reservations read params +func (o *DcimRackReservationsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack reservations read params +func (o *DcimRackReservationsReadParams) WithHTTPClient(client *http.Client) *DcimRackReservationsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack reservations read params +func (o *DcimRackReservationsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim rack reservations read params +func (o *DcimRackReservationsReadParams) WithID(id int64) *DcimRackReservationsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack reservations read params +func (o *DcimRackReservationsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackReservationsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_read_responses.go new file mode 100644 index 0000000..77f0db2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRackReservationsReadReader is a Reader for the DcimRackReservationsRead structure. +type DcimRackReservationsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackReservationsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackReservationsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackReservationsReadOK creates a DcimRackReservationsReadOK with default headers values +func NewDcimRackReservationsReadOK() *DcimRackReservationsReadOK { + return &DcimRackReservationsReadOK{} +} + +/*DcimRackReservationsReadOK handles this case with default header values. + +DcimRackReservationsReadOK dcim rack reservations read o k +*/ +type DcimRackReservationsReadOK struct { + Payload *models.RackReservation +} + +func (o *DcimRackReservationsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/rack-reservations/{id}/][%d] dcimRackReservationsReadOK %+v", 200, o.Payload) +} + +func (o *DcimRackReservationsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RackReservation) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_update_parameters.go new file mode 100644 index 0000000..cbbf6c8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRackReservationsUpdateParams creates a new DcimRackReservationsUpdateParams object +// with the default values initialized. +func NewDcimRackReservationsUpdateParams() *DcimRackReservationsUpdateParams { + var () + return &DcimRackReservationsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackReservationsUpdateParamsWithTimeout creates a new DcimRackReservationsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackReservationsUpdateParamsWithTimeout(timeout time.Duration) *DcimRackReservationsUpdateParams { + var () + return &DcimRackReservationsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRackReservationsUpdateParamsWithContext creates a new DcimRackReservationsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackReservationsUpdateParamsWithContext(ctx context.Context) *DcimRackReservationsUpdateParams { + var () + return &DcimRackReservationsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRackReservationsUpdateParamsWithHTTPClient creates a new DcimRackReservationsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackReservationsUpdateParamsWithHTTPClient(client *http.Client) *DcimRackReservationsUpdateParams { + var () + return &DcimRackReservationsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRackReservationsUpdateParams contains all the parameters to send to the API endpoint +for the dcim rack reservations update operation typically these are written to a http.Request +*/ +type DcimRackReservationsUpdateParams struct { + + /*Data*/ + Data *models.WritableRackReservation + /*ID + A unique integer value identifying this rack reservation. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) WithTimeout(timeout time.Duration) *DcimRackReservationsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) WithContext(ctx context.Context) *DcimRackReservationsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) WithHTTPClient(client *http.Client) *DcimRackReservationsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) WithData(data *models.WritableRackReservation) *DcimRackReservationsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) SetData(data *models.WritableRackReservation) { + o.Data = data +} + +// WithID adds the id to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) WithID(id int64) *DcimRackReservationsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackReservationsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_update_responses.go new file mode 100644 index 0000000..2277550 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_reservations_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRackReservationsUpdateReader is a Reader for the DcimRackReservationsUpdate structure. +type DcimRackReservationsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackReservationsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackReservationsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackReservationsUpdateOK creates a DcimRackReservationsUpdateOK with default headers values +func NewDcimRackReservationsUpdateOK() *DcimRackReservationsUpdateOK { + return &DcimRackReservationsUpdateOK{} +} + +/*DcimRackReservationsUpdateOK handles this case with default header values. + +DcimRackReservationsUpdateOK dcim rack reservations update o k +*/ +type DcimRackReservationsUpdateOK struct { + Payload *models.WritableRackReservation +} + +func (o *DcimRackReservationsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/rack-reservations/{id}/][%d] dcimRackReservationsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRackReservationsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRackReservation) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_create_parameters.go new file mode 100644 index 0000000..6442cdb --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRackRolesCreateParams creates a new DcimRackRolesCreateParams object +// with the default values initialized. +func NewDcimRackRolesCreateParams() *DcimRackRolesCreateParams { + var () + return &DcimRackRolesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackRolesCreateParamsWithTimeout creates a new DcimRackRolesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackRolesCreateParamsWithTimeout(timeout time.Duration) *DcimRackRolesCreateParams { + var () + return &DcimRackRolesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimRackRolesCreateParamsWithContext creates a new DcimRackRolesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackRolesCreateParamsWithContext(ctx context.Context) *DcimRackRolesCreateParams { + var () + return &DcimRackRolesCreateParams{ + + Context: ctx, + } +} + +// NewDcimRackRolesCreateParamsWithHTTPClient creates a new DcimRackRolesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackRolesCreateParamsWithHTTPClient(client *http.Client) *DcimRackRolesCreateParams { + var () + return &DcimRackRolesCreateParams{ + HTTPClient: client, + } +} + +/*DcimRackRolesCreateParams contains all the parameters to send to the API endpoint +for the dcim rack roles create operation typically these are written to a http.Request +*/ +type DcimRackRolesCreateParams struct { + + /*Data*/ + Data *models.RackRole + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack roles create params +func (o *DcimRackRolesCreateParams) WithTimeout(timeout time.Duration) *DcimRackRolesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack roles create params +func (o *DcimRackRolesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack roles create params +func (o *DcimRackRolesCreateParams) WithContext(ctx context.Context) *DcimRackRolesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack roles create params +func (o *DcimRackRolesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack roles create params +func (o *DcimRackRolesCreateParams) WithHTTPClient(client *http.Client) *DcimRackRolesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack roles create params +func (o *DcimRackRolesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack roles create params +func (o *DcimRackRolesCreateParams) WithData(data *models.RackRole) *DcimRackRolesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack roles create params +func (o *DcimRackRolesCreateParams) SetData(data *models.RackRole) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackRolesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_create_responses.go new file mode 100644 index 0000000..a084688 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRackRolesCreateReader is a Reader for the DcimRackRolesCreate structure. +type DcimRackRolesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackRolesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimRackRolesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackRolesCreateCreated creates a DcimRackRolesCreateCreated with default headers values +func NewDcimRackRolesCreateCreated() *DcimRackRolesCreateCreated { + return &DcimRackRolesCreateCreated{} +} + +/*DcimRackRolesCreateCreated handles this case with default header values. + +DcimRackRolesCreateCreated dcim rack roles create created +*/ +type DcimRackRolesCreateCreated struct { + Payload *models.RackRole +} + +func (o *DcimRackRolesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/rack-roles/][%d] dcimRackRolesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimRackRolesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RackRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_delete_parameters.go new file mode 100644 index 0000000..cad9b03 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRackRolesDeleteParams creates a new DcimRackRolesDeleteParams object +// with the default values initialized. +func NewDcimRackRolesDeleteParams() *DcimRackRolesDeleteParams { + var () + return &DcimRackRolesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackRolesDeleteParamsWithTimeout creates a new DcimRackRolesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackRolesDeleteParamsWithTimeout(timeout time.Duration) *DcimRackRolesDeleteParams { + var () + return &DcimRackRolesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimRackRolesDeleteParamsWithContext creates a new DcimRackRolesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackRolesDeleteParamsWithContext(ctx context.Context) *DcimRackRolesDeleteParams { + var () + return &DcimRackRolesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimRackRolesDeleteParamsWithHTTPClient creates a new DcimRackRolesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackRolesDeleteParamsWithHTTPClient(client *http.Client) *DcimRackRolesDeleteParams { + var () + return &DcimRackRolesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimRackRolesDeleteParams contains all the parameters to send to the API endpoint +for the dcim rack roles delete operation typically these are written to a http.Request +*/ +type DcimRackRolesDeleteParams struct { + + /*ID + A unique integer value identifying this rack role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack roles delete params +func (o *DcimRackRolesDeleteParams) WithTimeout(timeout time.Duration) *DcimRackRolesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack roles delete params +func (o *DcimRackRolesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack roles delete params +func (o *DcimRackRolesDeleteParams) WithContext(ctx context.Context) *DcimRackRolesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack roles delete params +func (o *DcimRackRolesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack roles delete params +func (o *DcimRackRolesDeleteParams) WithHTTPClient(client *http.Client) *DcimRackRolesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack roles delete params +func (o *DcimRackRolesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim rack roles delete params +func (o *DcimRackRolesDeleteParams) WithID(id int64) *DcimRackRolesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack roles delete params +func (o *DcimRackRolesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackRolesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_delete_responses.go new file mode 100644 index 0000000..aa0e6c1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimRackRolesDeleteReader is a Reader for the DcimRackRolesDelete structure. +type DcimRackRolesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackRolesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimRackRolesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackRolesDeleteNoContent creates a DcimRackRolesDeleteNoContent with default headers values +func NewDcimRackRolesDeleteNoContent() *DcimRackRolesDeleteNoContent { + return &DcimRackRolesDeleteNoContent{} +} + +/*DcimRackRolesDeleteNoContent handles this case with default header values. + +DcimRackRolesDeleteNoContent dcim rack roles delete no content +*/ +type DcimRackRolesDeleteNoContent struct { +} + +func (o *DcimRackRolesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/rack-roles/{id}/][%d] dcimRackRolesDeleteNoContent ", 204) +} + +func (o *DcimRackRolesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_list_parameters.go new file mode 100644 index 0000000..60165da --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_list_parameters.go @@ -0,0 +1,282 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRackRolesListParams creates a new DcimRackRolesListParams object +// with the default values initialized. +func NewDcimRackRolesListParams() *DcimRackRolesListParams { + var () + return &DcimRackRolesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackRolesListParamsWithTimeout creates a new DcimRackRolesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackRolesListParamsWithTimeout(timeout time.Duration) *DcimRackRolesListParams { + var () + return &DcimRackRolesListParams{ + + timeout: timeout, + } +} + +// NewDcimRackRolesListParamsWithContext creates a new DcimRackRolesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackRolesListParamsWithContext(ctx context.Context) *DcimRackRolesListParams { + var () + return &DcimRackRolesListParams{ + + Context: ctx, + } +} + +// NewDcimRackRolesListParamsWithHTTPClient creates a new DcimRackRolesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackRolesListParamsWithHTTPClient(client *http.Client) *DcimRackRolesListParams { + var () + return &DcimRackRolesListParams{ + HTTPClient: client, + } +} + +/*DcimRackRolesListParams contains all the parameters to send to the API endpoint +for the dcim rack roles list operation typically these are written to a http.Request +*/ +type DcimRackRolesListParams struct { + + /*Color*/ + Color *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithTimeout(timeout time.Duration) *DcimRackRolesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithContext(ctx context.Context) *DcimRackRolesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithHTTPClient(client *http.Client) *DcimRackRolesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithColor adds the color to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithColor(color *string) *DcimRackRolesListParams { + o.SetColor(color) + return o +} + +// SetColor adds the color to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetColor(color *string) { + o.Color = color +} + +// WithLimit adds the limit to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithLimit(limit *int64) *DcimRackRolesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithName(name *string) *DcimRackRolesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithOffset(offset *int64) *DcimRackRolesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithSlug(slug *string) *DcimRackRolesListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackRolesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Color != nil { + + // query param color + var qrColor string + if o.Color != nil { + qrColor = *o.Color + } + qColor := qrColor + if qColor != "" { + if err := r.SetQueryParam("color", qColor); 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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_list_responses.go new file mode 100644 index 0000000..e11ebb3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRackRolesListReader is a Reader for the DcimRackRolesList structure. +type DcimRackRolesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackRolesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackRolesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackRolesListOK creates a DcimRackRolesListOK with default headers values +func NewDcimRackRolesListOK() *DcimRackRolesListOK { + return &DcimRackRolesListOK{} +} + +/*DcimRackRolesListOK handles this case with default header values. + +DcimRackRolesListOK dcim rack roles list o k +*/ +type DcimRackRolesListOK struct { + Payload *models.DcimRackRolesListOKBody +} + +func (o *DcimRackRolesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/rack-roles/][%d] dcimRackRolesListOK %+v", 200, o.Payload) +} + +func (o *DcimRackRolesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimRackRolesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_partial_update_parameters.go new file mode 100644 index 0000000..7723718 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRackRolesPartialUpdateParams creates a new DcimRackRolesPartialUpdateParams object +// with the default values initialized. +func NewDcimRackRolesPartialUpdateParams() *DcimRackRolesPartialUpdateParams { + var () + return &DcimRackRolesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackRolesPartialUpdateParamsWithTimeout creates a new DcimRackRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackRolesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimRackRolesPartialUpdateParams { + var () + return &DcimRackRolesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRackRolesPartialUpdateParamsWithContext creates a new DcimRackRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackRolesPartialUpdateParamsWithContext(ctx context.Context) *DcimRackRolesPartialUpdateParams { + var () + return &DcimRackRolesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRackRolesPartialUpdateParamsWithHTTPClient creates a new DcimRackRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackRolesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimRackRolesPartialUpdateParams { + var () + return &DcimRackRolesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRackRolesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim rack roles partial update operation typically these are written to a http.Request +*/ +type DcimRackRolesPartialUpdateParams struct { + + /*Data*/ + Data *models.RackRole + /*ID + A unique integer value identifying this rack role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimRackRolesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) WithContext(ctx context.Context) *DcimRackRolesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimRackRolesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) WithData(data *models.RackRole) *DcimRackRolesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) SetData(data *models.RackRole) { + o.Data = data +} + +// WithID adds the id to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) WithID(id int64) *DcimRackRolesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackRolesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_partial_update_responses.go new file mode 100644 index 0000000..e18388a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRackRolesPartialUpdateReader is a Reader for the DcimRackRolesPartialUpdate structure. +type DcimRackRolesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackRolesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackRolesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackRolesPartialUpdateOK creates a DcimRackRolesPartialUpdateOK with default headers values +func NewDcimRackRolesPartialUpdateOK() *DcimRackRolesPartialUpdateOK { + return &DcimRackRolesPartialUpdateOK{} +} + +/*DcimRackRolesPartialUpdateOK handles this case with default header values. + +DcimRackRolesPartialUpdateOK dcim rack roles partial update o k +*/ +type DcimRackRolesPartialUpdateOK struct { + Payload *models.RackRole +} + +func (o *DcimRackRolesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/rack-roles/{id}/][%d] dcimRackRolesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRackRolesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RackRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_read_parameters.go new file mode 100644 index 0000000..1a49f3f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRackRolesReadParams creates a new DcimRackRolesReadParams object +// with the default values initialized. +func NewDcimRackRolesReadParams() *DcimRackRolesReadParams { + var () + return &DcimRackRolesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackRolesReadParamsWithTimeout creates a new DcimRackRolesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackRolesReadParamsWithTimeout(timeout time.Duration) *DcimRackRolesReadParams { + var () + return &DcimRackRolesReadParams{ + + timeout: timeout, + } +} + +// NewDcimRackRolesReadParamsWithContext creates a new DcimRackRolesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackRolesReadParamsWithContext(ctx context.Context) *DcimRackRolesReadParams { + var () + return &DcimRackRolesReadParams{ + + Context: ctx, + } +} + +// NewDcimRackRolesReadParamsWithHTTPClient creates a new DcimRackRolesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackRolesReadParamsWithHTTPClient(client *http.Client) *DcimRackRolesReadParams { + var () + return &DcimRackRolesReadParams{ + HTTPClient: client, + } +} + +/*DcimRackRolesReadParams contains all the parameters to send to the API endpoint +for the dcim rack roles read operation typically these are written to a http.Request +*/ +type DcimRackRolesReadParams struct { + + /*ID + A unique integer value identifying this rack role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack roles read params +func (o *DcimRackRolesReadParams) WithTimeout(timeout time.Duration) *DcimRackRolesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack roles read params +func (o *DcimRackRolesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack roles read params +func (o *DcimRackRolesReadParams) WithContext(ctx context.Context) *DcimRackRolesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack roles read params +func (o *DcimRackRolesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack roles read params +func (o *DcimRackRolesReadParams) WithHTTPClient(client *http.Client) *DcimRackRolesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack roles read params +func (o *DcimRackRolesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim rack roles read params +func (o *DcimRackRolesReadParams) WithID(id int64) *DcimRackRolesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack roles read params +func (o *DcimRackRolesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackRolesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_read_responses.go new file mode 100644 index 0000000..a2ed230 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRackRolesReadReader is a Reader for the DcimRackRolesRead structure. +type DcimRackRolesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackRolesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackRolesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackRolesReadOK creates a DcimRackRolesReadOK with default headers values +func NewDcimRackRolesReadOK() *DcimRackRolesReadOK { + return &DcimRackRolesReadOK{} +} + +/*DcimRackRolesReadOK handles this case with default header values. + +DcimRackRolesReadOK dcim rack roles read o k +*/ +type DcimRackRolesReadOK struct { + Payload *models.RackRole +} + +func (o *DcimRackRolesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/rack-roles/{id}/][%d] dcimRackRolesReadOK %+v", 200, o.Payload) +} + +func (o *DcimRackRolesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RackRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_update_parameters.go new file mode 100644 index 0000000..5ac177d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRackRolesUpdateParams creates a new DcimRackRolesUpdateParams object +// with the default values initialized. +func NewDcimRackRolesUpdateParams() *DcimRackRolesUpdateParams { + var () + return &DcimRackRolesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackRolesUpdateParamsWithTimeout creates a new DcimRackRolesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackRolesUpdateParamsWithTimeout(timeout time.Duration) *DcimRackRolesUpdateParams { + var () + return &DcimRackRolesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRackRolesUpdateParamsWithContext creates a new DcimRackRolesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackRolesUpdateParamsWithContext(ctx context.Context) *DcimRackRolesUpdateParams { + var () + return &DcimRackRolesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRackRolesUpdateParamsWithHTTPClient creates a new DcimRackRolesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackRolesUpdateParamsWithHTTPClient(client *http.Client) *DcimRackRolesUpdateParams { + var () + return &DcimRackRolesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRackRolesUpdateParams contains all the parameters to send to the API endpoint +for the dcim rack roles update operation typically these are written to a http.Request +*/ +type DcimRackRolesUpdateParams struct { + + /*Data*/ + Data *models.RackRole + /*ID + A unique integer value identifying this rack role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) WithTimeout(timeout time.Duration) *DcimRackRolesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) WithContext(ctx context.Context) *DcimRackRolesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) WithHTTPClient(client *http.Client) *DcimRackRolesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) WithData(data *models.RackRole) *DcimRackRolesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) SetData(data *models.RackRole) { + o.Data = data +} + +// WithID adds the id to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) WithID(id int64) *DcimRackRolesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackRolesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_update_responses.go new file mode 100644 index 0000000..9d0c94f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_rack_roles_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRackRolesUpdateReader is a Reader for the DcimRackRolesUpdate structure. +type DcimRackRolesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackRolesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackRolesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRackRolesUpdateOK creates a DcimRackRolesUpdateOK with default headers values +func NewDcimRackRolesUpdateOK() *DcimRackRolesUpdateOK { + return &DcimRackRolesUpdateOK{} +} + +/*DcimRackRolesUpdateOK handles this case with default header values. + +DcimRackRolesUpdateOK dcim rack roles update o k +*/ +type DcimRackRolesUpdateOK struct { + Payload *models.RackRole +} + +func (o *DcimRackRolesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/rack-roles/{id}/][%d] dcimRackRolesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRackRolesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RackRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_create_parameters.go new file mode 100644 index 0000000..a319020 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRacksCreateParams creates a new DcimRacksCreateParams object +// with the default values initialized. +func NewDcimRacksCreateParams() *DcimRacksCreateParams { + var () + return &DcimRacksCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRacksCreateParamsWithTimeout creates a new DcimRacksCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRacksCreateParamsWithTimeout(timeout time.Duration) *DcimRacksCreateParams { + var () + return &DcimRacksCreateParams{ + + timeout: timeout, + } +} + +// NewDcimRacksCreateParamsWithContext creates a new DcimRacksCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRacksCreateParamsWithContext(ctx context.Context) *DcimRacksCreateParams { + var () + return &DcimRacksCreateParams{ + + Context: ctx, + } +} + +// NewDcimRacksCreateParamsWithHTTPClient creates a new DcimRacksCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRacksCreateParamsWithHTTPClient(client *http.Client) *DcimRacksCreateParams { + var () + return &DcimRacksCreateParams{ + HTTPClient: client, + } +} + +/*DcimRacksCreateParams contains all the parameters to send to the API endpoint +for the dcim racks create operation typically these are written to a http.Request +*/ +type DcimRacksCreateParams struct { + + /*Data*/ + Data *models.WritableRack + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim racks create params +func (o *DcimRacksCreateParams) WithTimeout(timeout time.Duration) *DcimRacksCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim racks create params +func (o *DcimRacksCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim racks create params +func (o *DcimRacksCreateParams) WithContext(ctx context.Context) *DcimRacksCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim racks create params +func (o *DcimRacksCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim racks create params +func (o *DcimRacksCreateParams) WithHTTPClient(client *http.Client) *DcimRacksCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim racks create params +func (o *DcimRacksCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim racks create params +func (o *DcimRacksCreateParams) WithData(data *models.WritableRack) *DcimRacksCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim racks create params +func (o *DcimRacksCreateParams) SetData(data *models.WritableRack) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRacksCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_create_responses.go new file mode 100644 index 0000000..cde955f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRacksCreateReader is a Reader for the DcimRacksCreate structure. +type DcimRacksCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRacksCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimRacksCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRacksCreateCreated creates a DcimRacksCreateCreated with default headers values +func NewDcimRacksCreateCreated() *DcimRacksCreateCreated { + return &DcimRacksCreateCreated{} +} + +/*DcimRacksCreateCreated handles this case with default header values. + +DcimRacksCreateCreated dcim racks create created +*/ +type DcimRacksCreateCreated struct { + Payload *models.WritableRack +} + +func (o *DcimRacksCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/racks/][%d] dcimRacksCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimRacksCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRack) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_delete_parameters.go new file mode 100644 index 0000000..d91063e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRacksDeleteParams creates a new DcimRacksDeleteParams object +// with the default values initialized. +func NewDcimRacksDeleteParams() *DcimRacksDeleteParams { + var () + return &DcimRacksDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRacksDeleteParamsWithTimeout creates a new DcimRacksDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRacksDeleteParamsWithTimeout(timeout time.Duration) *DcimRacksDeleteParams { + var () + return &DcimRacksDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimRacksDeleteParamsWithContext creates a new DcimRacksDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRacksDeleteParamsWithContext(ctx context.Context) *DcimRacksDeleteParams { + var () + return &DcimRacksDeleteParams{ + + Context: ctx, + } +} + +// NewDcimRacksDeleteParamsWithHTTPClient creates a new DcimRacksDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRacksDeleteParamsWithHTTPClient(client *http.Client) *DcimRacksDeleteParams { + var () + return &DcimRacksDeleteParams{ + HTTPClient: client, + } +} + +/*DcimRacksDeleteParams contains all the parameters to send to the API endpoint +for the dcim racks delete operation typically these are written to a http.Request +*/ +type DcimRacksDeleteParams struct { + + /*ID + A unique integer value identifying this rack. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim racks delete params +func (o *DcimRacksDeleteParams) WithTimeout(timeout time.Duration) *DcimRacksDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim racks delete params +func (o *DcimRacksDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim racks delete params +func (o *DcimRacksDeleteParams) WithContext(ctx context.Context) *DcimRacksDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim racks delete params +func (o *DcimRacksDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim racks delete params +func (o *DcimRacksDeleteParams) WithHTTPClient(client *http.Client) *DcimRacksDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim racks delete params +func (o *DcimRacksDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim racks delete params +func (o *DcimRacksDeleteParams) WithID(id int64) *DcimRacksDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim racks delete params +func (o *DcimRacksDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRacksDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_delete_responses.go new file mode 100644 index 0000000..29e1d80 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimRacksDeleteReader is a Reader for the DcimRacksDelete structure. +type DcimRacksDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRacksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimRacksDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRacksDeleteNoContent creates a DcimRacksDeleteNoContent with default headers values +func NewDcimRacksDeleteNoContent() *DcimRacksDeleteNoContent { + return &DcimRacksDeleteNoContent{} +} + +/*DcimRacksDeleteNoContent handles this case with default header values. + +DcimRacksDeleteNoContent dcim racks delete no content +*/ +type DcimRacksDeleteNoContent struct { +} + +func (o *DcimRacksDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/racks/{id}/][%d] dcimRacksDeleteNoContent ", 204) +} + +func (o *DcimRacksDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_list_parameters.go new file mode 100644 index 0000000..c28c053 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_list_parameters.go @@ -0,0 +1,691 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRacksListParams creates a new DcimRacksListParams object +// with the default values initialized. +func NewDcimRacksListParams() *DcimRacksListParams { + var () + return &DcimRacksListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRacksListParamsWithTimeout creates a new DcimRacksListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRacksListParamsWithTimeout(timeout time.Duration) *DcimRacksListParams { + var () + return &DcimRacksListParams{ + + timeout: timeout, + } +} + +// NewDcimRacksListParamsWithContext creates a new DcimRacksListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRacksListParamsWithContext(ctx context.Context) *DcimRacksListParams { + var () + return &DcimRacksListParams{ + + Context: ctx, + } +} + +// NewDcimRacksListParamsWithHTTPClient creates a new DcimRacksListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRacksListParamsWithHTTPClient(client *http.Client) *DcimRacksListParams { + var () + return &DcimRacksListParams{ + HTTPClient: client, + } +} + +/*DcimRacksListParams contains all the parameters to send to the API endpoint +for the dcim racks list operation typically these are written to a http.Request +*/ +type DcimRacksListParams struct { + + /*DescUnits*/ + DescUnits *string + /*FacilityID*/ + FacilityID *string + /*Group*/ + Group *string + /*GroupID*/ + GroupID *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Role*/ + Role *string + /*RoleID*/ + RoleID *string + /*Serial*/ + Serial *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + /*Type*/ + Type *string + /*UHeight*/ + UHeight *float64 + /*Width*/ + Width *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim racks list params +func (o *DcimRacksListParams) WithTimeout(timeout time.Duration) *DcimRacksListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim racks list params +func (o *DcimRacksListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim racks list params +func (o *DcimRacksListParams) WithContext(ctx context.Context) *DcimRacksListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim racks list params +func (o *DcimRacksListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim racks list params +func (o *DcimRacksListParams) WithHTTPClient(client *http.Client) *DcimRacksListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim racks list params +func (o *DcimRacksListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDescUnits adds the descUnits to the dcim racks list params +func (o *DcimRacksListParams) WithDescUnits(descUnits *string) *DcimRacksListParams { + o.SetDescUnits(descUnits) + return o +} + +// SetDescUnits adds the descUnits to the dcim racks list params +func (o *DcimRacksListParams) SetDescUnits(descUnits *string) { + o.DescUnits = descUnits +} + +// WithFacilityID adds the facilityID to the dcim racks list params +func (o *DcimRacksListParams) WithFacilityID(facilityID *string) *DcimRacksListParams { + o.SetFacilityID(facilityID) + return o +} + +// SetFacilityID adds the facilityId to the dcim racks list params +func (o *DcimRacksListParams) SetFacilityID(facilityID *string) { + o.FacilityID = facilityID +} + +// WithGroup adds the group to the dcim racks list params +func (o *DcimRacksListParams) WithGroup(group *string) *DcimRacksListParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the dcim racks list params +func (o *DcimRacksListParams) SetGroup(group *string) { + o.Group = group +} + +// WithGroupID adds the groupID to the dcim racks list params +func (o *DcimRacksListParams) WithGroupID(groupID *string) *DcimRacksListParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the dcim racks list params +func (o *DcimRacksListParams) SetGroupID(groupID *string) { + o.GroupID = groupID +} + +// WithIDIn adds the iDIn to the dcim racks list params +func (o *DcimRacksListParams) WithIDIn(iDIn *string) *DcimRacksListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the dcim racks list params +func (o *DcimRacksListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the dcim racks list params +func (o *DcimRacksListParams) WithLimit(limit *int64) *DcimRacksListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim racks list params +func (o *DcimRacksListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim racks list params +func (o *DcimRacksListParams) WithName(name *string) *DcimRacksListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim racks list params +func (o *DcimRacksListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim racks list params +func (o *DcimRacksListParams) WithOffset(offset *int64) *DcimRacksListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim racks list params +func (o *DcimRacksListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the dcim racks list params +func (o *DcimRacksListParams) WithQ(q *string) *DcimRacksListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim racks list params +func (o *DcimRacksListParams) SetQ(q *string) { + o.Q = q +} + +// WithRole adds the role to the dcim racks list params +func (o *DcimRacksListParams) WithRole(role *string) *DcimRacksListParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the dcim racks list params +func (o *DcimRacksListParams) SetRole(role *string) { + o.Role = role +} + +// WithRoleID adds the roleID to the dcim racks list params +func (o *DcimRacksListParams) WithRoleID(roleID *string) *DcimRacksListParams { + o.SetRoleID(roleID) + return o +} + +// SetRoleID adds the roleId to the dcim racks list params +func (o *DcimRacksListParams) SetRoleID(roleID *string) { + o.RoleID = roleID +} + +// WithSerial adds the serial to the dcim racks list params +func (o *DcimRacksListParams) WithSerial(serial *string) *DcimRacksListParams { + o.SetSerial(serial) + return o +} + +// SetSerial adds the serial to the dcim racks list params +func (o *DcimRacksListParams) SetSerial(serial *string) { + o.Serial = serial +} + +// WithSite adds the site to the dcim racks list params +func (o *DcimRacksListParams) WithSite(site *string) *DcimRacksListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the dcim racks list params +func (o *DcimRacksListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the dcim racks list params +func (o *DcimRacksListParams) WithSiteID(siteID *string) *DcimRacksListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the dcim racks list params +func (o *DcimRacksListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithTenant adds the tenant to the dcim racks list params +func (o *DcimRacksListParams) WithTenant(tenant *string) *DcimRacksListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the dcim racks list params +func (o *DcimRacksListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the dcim racks list params +func (o *DcimRacksListParams) WithTenantID(tenantID *string) *DcimRacksListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the dcim racks list params +func (o *DcimRacksListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WithType adds the typeVar to the dcim racks list params +func (o *DcimRacksListParams) WithType(typeVar *string) *DcimRacksListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the dcim racks list params +func (o *DcimRacksListParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WithUHeight adds the uHeight to the dcim racks list params +func (o *DcimRacksListParams) WithUHeight(uHeight *float64) *DcimRacksListParams { + o.SetUHeight(uHeight) + return o +} + +// SetUHeight adds the uHeight to the dcim racks list params +func (o *DcimRacksListParams) SetUHeight(uHeight *float64) { + o.UHeight = uHeight +} + +// WithWidth adds the width to the dcim racks list params +func (o *DcimRacksListParams) WithWidth(width *string) *DcimRacksListParams { + o.SetWidth(width) + return o +} + +// SetWidth adds the width to the dcim racks list params +func (o *DcimRacksListParams) SetWidth(width *string) { + o.Width = width +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRacksListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DescUnits != nil { + + // query param desc_units + var qrDescUnits string + if o.DescUnits != nil { + qrDescUnits = *o.DescUnits + } + qDescUnits := qrDescUnits + if qDescUnits != "" { + if err := r.SetQueryParam("desc_units", qDescUnits); err != nil { + return err + } + } + + } + + if o.FacilityID != nil { + + // query param facility_id + var qrFacilityID string + if o.FacilityID != nil { + qrFacilityID = *o.FacilityID + } + qFacilityID := qrFacilityID + if qFacilityID != "" { + if err := r.SetQueryParam("facility_id", qFacilityID); 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.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.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); 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.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.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.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.Serial != nil { + + // query param serial + var qrSerial string + if o.Serial != nil { + qrSerial = *o.Serial + } + qSerial := qrSerial + if qSerial != "" { + if err := r.SetQueryParam("serial", qSerial); 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.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.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.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.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if o.UHeight != nil { + + // query param u_height + var qrUHeight float64 + if o.UHeight != nil { + qrUHeight = *o.UHeight + } + qUHeight := swag.FormatFloat64(qrUHeight) + if qUHeight != "" { + if err := r.SetQueryParam("u_height", qUHeight); err != nil { + return err + } + } + + } + + if o.Width != nil { + + // query param width + var qrWidth string + if o.Width != nil { + qrWidth = *o.Width + } + qWidth := qrWidth + if qWidth != "" { + if err := r.SetQueryParam("width", qWidth); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_list_responses.go new file mode 100644 index 0000000..a430743 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRacksListReader is a Reader for the DcimRacksList structure. +type DcimRacksListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRacksListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRacksListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRacksListOK creates a DcimRacksListOK with default headers values +func NewDcimRacksListOK() *DcimRacksListOK { + return &DcimRacksListOK{} +} + +/*DcimRacksListOK handles this case with default header values. + +DcimRacksListOK dcim racks list o k +*/ +type DcimRacksListOK struct { + Payload *models.DcimRacksListOKBody +} + +func (o *DcimRacksListOK) Error() string { + return fmt.Sprintf("[GET /dcim/racks/][%d] dcimRacksListOK %+v", 200, o.Payload) +} + +func (o *DcimRacksListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimRacksListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_partial_update_parameters.go new file mode 100644 index 0000000..34da3d9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRacksPartialUpdateParams creates a new DcimRacksPartialUpdateParams object +// with the default values initialized. +func NewDcimRacksPartialUpdateParams() *DcimRacksPartialUpdateParams { + var () + return &DcimRacksPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRacksPartialUpdateParamsWithTimeout creates a new DcimRacksPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRacksPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimRacksPartialUpdateParams { + var () + return &DcimRacksPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRacksPartialUpdateParamsWithContext creates a new DcimRacksPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRacksPartialUpdateParamsWithContext(ctx context.Context) *DcimRacksPartialUpdateParams { + var () + return &DcimRacksPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRacksPartialUpdateParamsWithHTTPClient creates a new DcimRacksPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRacksPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimRacksPartialUpdateParams { + var () + return &DcimRacksPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRacksPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim racks partial update operation typically these are written to a http.Request +*/ +type DcimRacksPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableRack + /*ID + A unique integer value identifying this rack. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimRacksPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) WithContext(ctx context.Context) *DcimRacksPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimRacksPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) WithData(data *models.WritableRack) *DcimRacksPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) SetData(data *models.WritableRack) { + o.Data = data +} + +// WithID adds the id to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) WithID(id int64) *DcimRacksPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRacksPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_partial_update_responses.go new file mode 100644 index 0000000..ae7e1e3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRacksPartialUpdateReader is a Reader for the DcimRacksPartialUpdate structure. +type DcimRacksPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRacksPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRacksPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRacksPartialUpdateOK creates a DcimRacksPartialUpdateOK with default headers values +func NewDcimRacksPartialUpdateOK() *DcimRacksPartialUpdateOK { + return &DcimRacksPartialUpdateOK{} +} + +/*DcimRacksPartialUpdateOK handles this case with default header values. + +DcimRacksPartialUpdateOK dcim racks partial update o k +*/ +type DcimRacksPartialUpdateOK struct { + Payload *models.WritableRack +} + +func (o *DcimRacksPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/racks/{id}/][%d] dcimRacksPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRacksPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRack) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_read_parameters.go new file mode 100644 index 0000000..e112d47 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRacksReadParams creates a new DcimRacksReadParams object +// with the default values initialized. +func NewDcimRacksReadParams() *DcimRacksReadParams { + var () + return &DcimRacksReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRacksReadParamsWithTimeout creates a new DcimRacksReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRacksReadParamsWithTimeout(timeout time.Duration) *DcimRacksReadParams { + var () + return &DcimRacksReadParams{ + + timeout: timeout, + } +} + +// NewDcimRacksReadParamsWithContext creates a new DcimRacksReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRacksReadParamsWithContext(ctx context.Context) *DcimRacksReadParams { + var () + return &DcimRacksReadParams{ + + Context: ctx, + } +} + +// NewDcimRacksReadParamsWithHTTPClient creates a new DcimRacksReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRacksReadParamsWithHTTPClient(client *http.Client) *DcimRacksReadParams { + var () + return &DcimRacksReadParams{ + HTTPClient: client, + } +} + +/*DcimRacksReadParams contains all the parameters to send to the API endpoint +for the dcim racks read operation typically these are written to a http.Request +*/ +type DcimRacksReadParams struct { + + /*ID + A unique integer value identifying this rack. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim racks read params +func (o *DcimRacksReadParams) WithTimeout(timeout time.Duration) *DcimRacksReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim racks read params +func (o *DcimRacksReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim racks read params +func (o *DcimRacksReadParams) WithContext(ctx context.Context) *DcimRacksReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim racks read params +func (o *DcimRacksReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim racks read params +func (o *DcimRacksReadParams) WithHTTPClient(client *http.Client) *DcimRacksReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim racks read params +func (o *DcimRacksReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim racks read params +func (o *DcimRacksReadParams) WithID(id int64) *DcimRacksReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim racks read params +func (o *DcimRacksReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRacksReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_read_responses.go new file mode 100644 index 0000000..dc6d3a1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRacksReadReader is a Reader for the DcimRacksRead structure. +type DcimRacksReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRacksReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRacksReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRacksReadOK creates a DcimRacksReadOK with default headers values +func NewDcimRacksReadOK() *DcimRacksReadOK { + return &DcimRacksReadOK{} +} + +/*DcimRacksReadOK handles this case with default header values. + +DcimRacksReadOK dcim racks read o k +*/ +type DcimRacksReadOK struct { + Payload *models.Rack +} + +func (o *DcimRacksReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/racks/{id}/][%d] dcimRacksReadOK %+v", 200, o.Payload) +} + +func (o *DcimRacksReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Rack) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_units_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_units_parameters.go new file mode 100644 index 0000000..19d8b25 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_units_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRacksUnitsParams creates a new DcimRacksUnitsParams object +// with the default values initialized. +func NewDcimRacksUnitsParams() *DcimRacksUnitsParams { + var () + return &DcimRacksUnitsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRacksUnitsParamsWithTimeout creates a new DcimRacksUnitsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRacksUnitsParamsWithTimeout(timeout time.Duration) *DcimRacksUnitsParams { + var () + return &DcimRacksUnitsParams{ + + timeout: timeout, + } +} + +// NewDcimRacksUnitsParamsWithContext creates a new DcimRacksUnitsParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRacksUnitsParamsWithContext(ctx context.Context) *DcimRacksUnitsParams { + var () + return &DcimRacksUnitsParams{ + + Context: ctx, + } +} + +// NewDcimRacksUnitsParamsWithHTTPClient creates a new DcimRacksUnitsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRacksUnitsParamsWithHTTPClient(client *http.Client) *DcimRacksUnitsParams { + var () + return &DcimRacksUnitsParams{ + HTTPClient: client, + } +} + +/*DcimRacksUnitsParams contains all the parameters to send to the API endpoint +for the dcim racks units operation typically these are written to a http.Request +*/ +type DcimRacksUnitsParams struct { + + /*ID + A unique integer value identifying this rack. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim racks units params +func (o *DcimRacksUnitsParams) WithTimeout(timeout time.Duration) *DcimRacksUnitsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim racks units params +func (o *DcimRacksUnitsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim racks units params +func (o *DcimRacksUnitsParams) WithContext(ctx context.Context) *DcimRacksUnitsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim racks units params +func (o *DcimRacksUnitsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim racks units params +func (o *DcimRacksUnitsParams) WithHTTPClient(client *http.Client) *DcimRacksUnitsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim racks units params +func (o *DcimRacksUnitsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim racks units params +func (o *DcimRacksUnitsParams) WithID(id int64) *DcimRacksUnitsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim racks units params +func (o *DcimRacksUnitsParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRacksUnitsParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_units_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_units_responses.go new file mode 100644 index 0000000..c259e7a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_units_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRacksUnitsReader is a Reader for the DcimRacksUnits structure. +type DcimRacksUnitsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRacksUnitsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRacksUnitsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRacksUnitsOK creates a DcimRacksUnitsOK with default headers values +func NewDcimRacksUnitsOK() *DcimRacksUnitsOK { + return &DcimRacksUnitsOK{} +} + +/*DcimRacksUnitsOK handles this case with default header values. + +DcimRacksUnitsOK dcim racks units o k +*/ +type DcimRacksUnitsOK struct { + Payload *models.Rack +} + +func (o *DcimRacksUnitsOK) Error() string { + return fmt.Sprintf("[GET /dcim/racks/{id}/units/][%d] dcimRacksUnitsOK %+v", 200, o.Payload) +} + +func (o *DcimRacksUnitsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Rack) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_update_parameters.go new file mode 100644 index 0000000..f9c8225 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRacksUpdateParams creates a new DcimRacksUpdateParams object +// with the default values initialized. +func NewDcimRacksUpdateParams() *DcimRacksUpdateParams { + var () + return &DcimRacksUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRacksUpdateParamsWithTimeout creates a new DcimRacksUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRacksUpdateParamsWithTimeout(timeout time.Duration) *DcimRacksUpdateParams { + var () + return &DcimRacksUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRacksUpdateParamsWithContext creates a new DcimRacksUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRacksUpdateParamsWithContext(ctx context.Context) *DcimRacksUpdateParams { + var () + return &DcimRacksUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRacksUpdateParamsWithHTTPClient creates a new DcimRacksUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRacksUpdateParamsWithHTTPClient(client *http.Client) *DcimRacksUpdateParams { + var () + return &DcimRacksUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRacksUpdateParams contains all the parameters to send to the API endpoint +for the dcim racks update operation typically these are written to a http.Request +*/ +type DcimRacksUpdateParams struct { + + /*Data*/ + Data *models.WritableRack + /*ID + A unique integer value identifying this rack. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim racks update params +func (o *DcimRacksUpdateParams) WithTimeout(timeout time.Duration) *DcimRacksUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim racks update params +func (o *DcimRacksUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim racks update params +func (o *DcimRacksUpdateParams) WithContext(ctx context.Context) *DcimRacksUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim racks update params +func (o *DcimRacksUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim racks update params +func (o *DcimRacksUpdateParams) WithHTTPClient(client *http.Client) *DcimRacksUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim racks update params +func (o *DcimRacksUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim racks update params +func (o *DcimRacksUpdateParams) WithData(data *models.WritableRack) *DcimRacksUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim racks update params +func (o *DcimRacksUpdateParams) SetData(data *models.WritableRack) { + o.Data = data +} + +// WithID adds the id to the dcim racks update params +func (o *DcimRacksUpdateParams) WithID(id int64) *DcimRacksUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim racks update params +func (o *DcimRacksUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRacksUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_update_responses.go new file mode 100644 index 0000000..92f1eba --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_racks_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRacksUpdateReader is a Reader for the DcimRacksUpdate structure. +type DcimRacksUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRacksUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRacksUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRacksUpdateOK creates a DcimRacksUpdateOK with default headers values +func NewDcimRacksUpdateOK() *DcimRacksUpdateOK { + return &DcimRacksUpdateOK{} +} + +/*DcimRacksUpdateOK handles this case with default header values. + +DcimRacksUpdateOK dcim racks update o k +*/ +type DcimRacksUpdateOK struct { + Payload *models.WritableRack +} + +func (o *DcimRacksUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/racks/{id}/][%d] dcimRacksUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRacksUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRack) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_create_parameters.go new file mode 100644 index 0000000..e92d2bc --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRegionsCreateParams creates a new DcimRegionsCreateParams object +// with the default values initialized. +func NewDcimRegionsCreateParams() *DcimRegionsCreateParams { + var () + return &DcimRegionsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRegionsCreateParamsWithTimeout creates a new DcimRegionsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRegionsCreateParamsWithTimeout(timeout time.Duration) *DcimRegionsCreateParams { + var () + return &DcimRegionsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimRegionsCreateParamsWithContext creates a new DcimRegionsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRegionsCreateParamsWithContext(ctx context.Context) *DcimRegionsCreateParams { + var () + return &DcimRegionsCreateParams{ + + Context: ctx, + } +} + +// NewDcimRegionsCreateParamsWithHTTPClient creates a new DcimRegionsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRegionsCreateParamsWithHTTPClient(client *http.Client) *DcimRegionsCreateParams { + var () + return &DcimRegionsCreateParams{ + HTTPClient: client, + } +} + +/*DcimRegionsCreateParams contains all the parameters to send to the API endpoint +for the dcim regions create operation typically these are written to a http.Request +*/ +type DcimRegionsCreateParams struct { + + /*Data*/ + Data *models.WritableRegion + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim regions create params +func (o *DcimRegionsCreateParams) WithTimeout(timeout time.Duration) *DcimRegionsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim regions create params +func (o *DcimRegionsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim regions create params +func (o *DcimRegionsCreateParams) WithContext(ctx context.Context) *DcimRegionsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim regions create params +func (o *DcimRegionsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim regions create params +func (o *DcimRegionsCreateParams) WithHTTPClient(client *http.Client) *DcimRegionsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim regions create params +func (o *DcimRegionsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim regions create params +func (o *DcimRegionsCreateParams) WithData(data *models.WritableRegion) *DcimRegionsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim regions create params +func (o *DcimRegionsCreateParams) SetData(data *models.WritableRegion) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRegionsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_create_responses.go new file mode 100644 index 0000000..b9e91f6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRegionsCreateReader is a Reader for the DcimRegionsCreate structure. +type DcimRegionsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRegionsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimRegionsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRegionsCreateCreated creates a DcimRegionsCreateCreated with default headers values +func NewDcimRegionsCreateCreated() *DcimRegionsCreateCreated { + return &DcimRegionsCreateCreated{} +} + +/*DcimRegionsCreateCreated handles this case with default header values. + +DcimRegionsCreateCreated dcim regions create created +*/ +type DcimRegionsCreateCreated struct { + Payload *models.WritableRegion +} + +func (o *DcimRegionsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/regions/][%d] dcimRegionsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimRegionsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRegion) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_delete_parameters.go new file mode 100644 index 0000000..001cd00 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRegionsDeleteParams creates a new DcimRegionsDeleteParams object +// with the default values initialized. +func NewDcimRegionsDeleteParams() *DcimRegionsDeleteParams { + var () + return &DcimRegionsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRegionsDeleteParamsWithTimeout creates a new DcimRegionsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRegionsDeleteParamsWithTimeout(timeout time.Duration) *DcimRegionsDeleteParams { + var () + return &DcimRegionsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimRegionsDeleteParamsWithContext creates a new DcimRegionsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRegionsDeleteParamsWithContext(ctx context.Context) *DcimRegionsDeleteParams { + var () + return &DcimRegionsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimRegionsDeleteParamsWithHTTPClient creates a new DcimRegionsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRegionsDeleteParamsWithHTTPClient(client *http.Client) *DcimRegionsDeleteParams { + var () + return &DcimRegionsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimRegionsDeleteParams contains all the parameters to send to the API endpoint +for the dcim regions delete operation typically these are written to a http.Request +*/ +type DcimRegionsDeleteParams struct { + + /*ID + A unique integer value identifying this region. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim regions delete params +func (o *DcimRegionsDeleteParams) WithTimeout(timeout time.Duration) *DcimRegionsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim regions delete params +func (o *DcimRegionsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim regions delete params +func (o *DcimRegionsDeleteParams) WithContext(ctx context.Context) *DcimRegionsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim regions delete params +func (o *DcimRegionsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim regions delete params +func (o *DcimRegionsDeleteParams) WithHTTPClient(client *http.Client) *DcimRegionsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim regions delete params +func (o *DcimRegionsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim regions delete params +func (o *DcimRegionsDeleteParams) WithID(id int64) *DcimRegionsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim regions delete params +func (o *DcimRegionsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRegionsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_delete_responses.go new file mode 100644 index 0000000..e69b706 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimRegionsDeleteReader is a Reader for the DcimRegionsDelete structure. +type DcimRegionsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRegionsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimRegionsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRegionsDeleteNoContent creates a DcimRegionsDeleteNoContent with default headers values +func NewDcimRegionsDeleteNoContent() *DcimRegionsDeleteNoContent { + return &DcimRegionsDeleteNoContent{} +} + +/*DcimRegionsDeleteNoContent handles this case with default header values. + +DcimRegionsDeleteNoContent dcim regions delete no content +*/ +type DcimRegionsDeleteNoContent struct { +} + +func (o *DcimRegionsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/regions/{id}/][%d] dcimRegionsDeleteNoContent ", 204) +} + +func (o *DcimRegionsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_list_parameters.go new file mode 100644 index 0000000..af8bf62 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_list_parameters.go @@ -0,0 +1,340 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRegionsListParams creates a new DcimRegionsListParams object +// with the default values initialized. +func NewDcimRegionsListParams() *DcimRegionsListParams { + var () + return &DcimRegionsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRegionsListParamsWithTimeout creates a new DcimRegionsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRegionsListParamsWithTimeout(timeout time.Duration) *DcimRegionsListParams { + var () + return &DcimRegionsListParams{ + + timeout: timeout, + } +} + +// NewDcimRegionsListParamsWithContext creates a new DcimRegionsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRegionsListParamsWithContext(ctx context.Context) *DcimRegionsListParams { + var () + return &DcimRegionsListParams{ + + Context: ctx, + } +} + +// NewDcimRegionsListParamsWithHTTPClient creates a new DcimRegionsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRegionsListParamsWithHTTPClient(client *http.Client) *DcimRegionsListParams { + var () + return &DcimRegionsListParams{ + HTTPClient: client, + } +} + +/*DcimRegionsListParams contains all the parameters to send to the API endpoint +for the dcim regions list operation typically these are written to a http.Request +*/ +type DcimRegionsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Parent*/ + Parent *string + /*ParentID*/ + ParentID *string + /*Q*/ + Q *string + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim regions list params +func (o *DcimRegionsListParams) WithTimeout(timeout time.Duration) *DcimRegionsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim regions list params +func (o *DcimRegionsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim regions list params +func (o *DcimRegionsListParams) WithContext(ctx context.Context) *DcimRegionsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim regions list params +func (o *DcimRegionsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim regions list params +func (o *DcimRegionsListParams) WithHTTPClient(client *http.Client) *DcimRegionsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim regions list params +func (o *DcimRegionsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the dcim regions list params +func (o *DcimRegionsListParams) WithLimit(limit *int64) *DcimRegionsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim regions list params +func (o *DcimRegionsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim regions list params +func (o *DcimRegionsListParams) WithName(name *string) *DcimRegionsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim regions list params +func (o *DcimRegionsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim regions list params +func (o *DcimRegionsListParams) WithOffset(offset *int64) *DcimRegionsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim regions list params +func (o *DcimRegionsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithParent adds the parent to the dcim regions list params +func (o *DcimRegionsListParams) WithParent(parent *string) *DcimRegionsListParams { + o.SetParent(parent) + return o +} + +// SetParent adds the parent to the dcim regions list params +func (o *DcimRegionsListParams) SetParent(parent *string) { + o.Parent = parent +} + +// WithParentID adds the parentID to the dcim regions list params +func (o *DcimRegionsListParams) WithParentID(parentID *string) *DcimRegionsListParams { + o.SetParentID(parentID) + return o +} + +// SetParentID adds the parentId to the dcim regions list params +func (o *DcimRegionsListParams) SetParentID(parentID *string) { + o.ParentID = parentID +} + +// WithQ adds the q to the dcim regions list params +func (o *DcimRegionsListParams) WithQ(q *string) *DcimRegionsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim regions list params +func (o *DcimRegionsListParams) SetQ(q *string) { + o.Q = q +} + +// WithSlug adds the slug to the dcim regions list params +func (o *DcimRegionsListParams) WithSlug(slug *string) *DcimRegionsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the dcim regions list params +func (o *DcimRegionsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRegionsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_list_responses.go new file mode 100644 index 0000000..c28c76c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRegionsListReader is a Reader for the DcimRegionsList structure. +type DcimRegionsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRegionsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRegionsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRegionsListOK creates a DcimRegionsListOK with default headers values +func NewDcimRegionsListOK() *DcimRegionsListOK { + return &DcimRegionsListOK{} +} + +/*DcimRegionsListOK handles this case with default header values. + +DcimRegionsListOK dcim regions list o k +*/ +type DcimRegionsListOK struct { + Payload *models.DcimRegionsListOKBody +} + +func (o *DcimRegionsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/regions/][%d] dcimRegionsListOK %+v", 200, o.Payload) +} + +func (o *DcimRegionsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimRegionsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_partial_update_parameters.go new file mode 100644 index 0000000..2746650 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRegionsPartialUpdateParams creates a new DcimRegionsPartialUpdateParams object +// with the default values initialized. +func NewDcimRegionsPartialUpdateParams() *DcimRegionsPartialUpdateParams { + var () + return &DcimRegionsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRegionsPartialUpdateParamsWithTimeout creates a new DcimRegionsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRegionsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimRegionsPartialUpdateParams { + var () + return &DcimRegionsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRegionsPartialUpdateParamsWithContext creates a new DcimRegionsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRegionsPartialUpdateParamsWithContext(ctx context.Context) *DcimRegionsPartialUpdateParams { + var () + return &DcimRegionsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRegionsPartialUpdateParamsWithHTTPClient creates a new DcimRegionsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRegionsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimRegionsPartialUpdateParams { + var () + return &DcimRegionsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRegionsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim regions partial update operation typically these are written to a http.Request +*/ +type DcimRegionsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableRegion + /*ID + A unique integer value identifying this region. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimRegionsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) WithContext(ctx context.Context) *DcimRegionsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimRegionsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) WithData(data *models.WritableRegion) *DcimRegionsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) SetData(data *models.WritableRegion) { + o.Data = data +} + +// WithID adds the id to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) WithID(id int64) *DcimRegionsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRegionsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_partial_update_responses.go new file mode 100644 index 0000000..fe2817d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRegionsPartialUpdateReader is a Reader for the DcimRegionsPartialUpdate structure. +type DcimRegionsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRegionsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRegionsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRegionsPartialUpdateOK creates a DcimRegionsPartialUpdateOK with default headers values +func NewDcimRegionsPartialUpdateOK() *DcimRegionsPartialUpdateOK { + return &DcimRegionsPartialUpdateOK{} +} + +/*DcimRegionsPartialUpdateOK handles this case with default header values. + +DcimRegionsPartialUpdateOK dcim regions partial update o k +*/ +type DcimRegionsPartialUpdateOK struct { + Payload *models.WritableRegion +} + +func (o *DcimRegionsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/regions/{id}/][%d] dcimRegionsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRegionsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRegion) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_read_parameters.go new file mode 100644 index 0000000..090efe6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRegionsReadParams creates a new DcimRegionsReadParams object +// with the default values initialized. +func NewDcimRegionsReadParams() *DcimRegionsReadParams { + var () + return &DcimRegionsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRegionsReadParamsWithTimeout creates a new DcimRegionsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRegionsReadParamsWithTimeout(timeout time.Duration) *DcimRegionsReadParams { + var () + return &DcimRegionsReadParams{ + + timeout: timeout, + } +} + +// NewDcimRegionsReadParamsWithContext creates a new DcimRegionsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRegionsReadParamsWithContext(ctx context.Context) *DcimRegionsReadParams { + var () + return &DcimRegionsReadParams{ + + Context: ctx, + } +} + +// NewDcimRegionsReadParamsWithHTTPClient creates a new DcimRegionsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRegionsReadParamsWithHTTPClient(client *http.Client) *DcimRegionsReadParams { + var () + return &DcimRegionsReadParams{ + HTTPClient: client, + } +} + +/*DcimRegionsReadParams contains all the parameters to send to the API endpoint +for the dcim regions read operation typically these are written to a http.Request +*/ +type DcimRegionsReadParams struct { + + /*ID + A unique integer value identifying this region. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim regions read params +func (o *DcimRegionsReadParams) WithTimeout(timeout time.Duration) *DcimRegionsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim regions read params +func (o *DcimRegionsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim regions read params +func (o *DcimRegionsReadParams) WithContext(ctx context.Context) *DcimRegionsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim regions read params +func (o *DcimRegionsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim regions read params +func (o *DcimRegionsReadParams) WithHTTPClient(client *http.Client) *DcimRegionsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim regions read params +func (o *DcimRegionsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim regions read params +func (o *DcimRegionsReadParams) WithID(id int64) *DcimRegionsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim regions read params +func (o *DcimRegionsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRegionsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_read_responses.go new file mode 100644 index 0000000..48ef939 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRegionsReadReader is a Reader for the DcimRegionsRead structure. +type DcimRegionsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRegionsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRegionsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRegionsReadOK creates a DcimRegionsReadOK with default headers values +func NewDcimRegionsReadOK() *DcimRegionsReadOK { + return &DcimRegionsReadOK{} +} + +/*DcimRegionsReadOK handles this case with default header values. + +DcimRegionsReadOK dcim regions read o k +*/ +type DcimRegionsReadOK struct { + Payload *models.Region +} + +func (o *DcimRegionsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/regions/{id}/][%d] dcimRegionsReadOK %+v", 200, o.Payload) +} + +func (o *DcimRegionsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Region) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_update_parameters.go new file mode 100644 index 0000000..18d5648 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRegionsUpdateParams creates a new DcimRegionsUpdateParams object +// with the default values initialized. +func NewDcimRegionsUpdateParams() *DcimRegionsUpdateParams { + var () + return &DcimRegionsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRegionsUpdateParamsWithTimeout creates a new DcimRegionsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRegionsUpdateParamsWithTimeout(timeout time.Duration) *DcimRegionsUpdateParams { + var () + return &DcimRegionsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRegionsUpdateParamsWithContext creates a new DcimRegionsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRegionsUpdateParamsWithContext(ctx context.Context) *DcimRegionsUpdateParams { + var () + return &DcimRegionsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRegionsUpdateParamsWithHTTPClient creates a new DcimRegionsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRegionsUpdateParamsWithHTTPClient(client *http.Client) *DcimRegionsUpdateParams { + var () + return &DcimRegionsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRegionsUpdateParams contains all the parameters to send to the API endpoint +for the dcim regions update operation typically these are written to a http.Request +*/ +type DcimRegionsUpdateParams struct { + + /*Data*/ + Data *models.WritableRegion + /*ID + A unique integer value identifying this region. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim regions update params +func (o *DcimRegionsUpdateParams) WithTimeout(timeout time.Duration) *DcimRegionsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim regions update params +func (o *DcimRegionsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim regions update params +func (o *DcimRegionsUpdateParams) WithContext(ctx context.Context) *DcimRegionsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim regions update params +func (o *DcimRegionsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim regions update params +func (o *DcimRegionsUpdateParams) WithHTTPClient(client *http.Client) *DcimRegionsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim regions update params +func (o *DcimRegionsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim regions update params +func (o *DcimRegionsUpdateParams) WithData(data *models.WritableRegion) *DcimRegionsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim regions update params +func (o *DcimRegionsUpdateParams) SetData(data *models.WritableRegion) { + o.Data = data +} + +// WithID adds the id to the dcim regions update params +func (o *DcimRegionsUpdateParams) WithID(id int64) *DcimRegionsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim regions update params +func (o *DcimRegionsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRegionsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_update_responses.go new file mode 100644 index 0000000..6c6f377 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_regions_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRegionsUpdateReader is a Reader for the DcimRegionsUpdate structure. +type DcimRegionsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRegionsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRegionsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRegionsUpdateOK creates a DcimRegionsUpdateOK with default headers values +func NewDcimRegionsUpdateOK() *DcimRegionsUpdateOK { + return &DcimRegionsUpdateOK{} +} + +/*DcimRegionsUpdateOK handles this case with default header values. + +DcimRegionsUpdateOK dcim regions update o k +*/ +type DcimRegionsUpdateOK struct { + Payload *models.WritableRegion +} + +func (o *DcimRegionsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/regions/{id}/][%d] dcimRegionsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRegionsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRegion) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_create_parameters.go new file mode 100644 index 0000000..1af9f16 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimSitesCreateParams creates a new DcimSitesCreateParams object +// with the default values initialized. +func NewDcimSitesCreateParams() *DcimSitesCreateParams { + var () + return &DcimSitesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimSitesCreateParamsWithTimeout creates a new DcimSitesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimSitesCreateParamsWithTimeout(timeout time.Duration) *DcimSitesCreateParams { + var () + return &DcimSitesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimSitesCreateParamsWithContext creates a new DcimSitesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimSitesCreateParamsWithContext(ctx context.Context) *DcimSitesCreateParams { + var () + return &DcimSitesCreateParams{ + + Context: ctx, + } +} + +// NewDcimSitesCreateParamsWithHTTPClient creates a new DcimSitesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimSitesCreateParamsWithHTTPClient(client *http.Client) *DcimSitesCreateParams { + var () + return &DcimSitesCreateParams{ + HTTPClient: client, + } +} + +/*DcimSitesCreateParams contains all the parameters to send to the API endpoint +for the dcim sites create operation typically these are written to a http.Request +*/ +type DcimSitesCreateParams struct { + + /*Data*/ + Data *models.WritableSite + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim sites create params +func (o *DcimSitesCreateParams) WithTimeout(timeout time.Duration) *DcimSitesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim sites create params +func (o *DcimSitesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim sites create params +func (o *DcimSitesCreateParams) WithContext(ctx context.Context) *DcimSitesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim sites create params +func (o *DcimSitesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim sites create params +func (o *DcimSitesCreateParams) WithHTTPClient(client *http.Client) *DcimSitesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim sites create params +func (o *DcimSitesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim sites create params +func (o *DcimSitesCreateParams) WithData(data *models.WritableSite) *DcimSitesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim sites create params +func (o *DcimSitesCreateParams) SetData(data *models.WritableSite) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimSitesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_create_responses.go new file mode 100644 index 0000000..9090ff9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimSitesCreateReader is a Reader for the DcimSitesCreate structure. +type DcimSitesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimSitesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimSitesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimSitesCreateCreated creates a DcimSitesCreateCreated with default headers values +func NewDcimSitesCreateCreated() *DcimSitesCreateCreated { + return &DcimSitesCreateCreated{} +} + +/*DcimSitesCreateCreated handles this case with default header values. + +DcimSitesCreateCreated dcim sites create created +*/ +type DcimSitesCreateCreated struct { + Payload *models.WritableSite +} + +func (o *DcimSitesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/sites/][%d] dcimSitesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimSitesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableSite) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_delete_parameters.go new file mode 100644 index 0000000..a486741 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimSitesDeleteParams creates a new DcimSitesDeleteParams object +// with the default values initialized. +func NewDcimSitesDeleteParams() *DcimSitesDeleteParams { + var () + return &DcimSitesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimSitesDeleteParamsWithTimeout creates a new DcimSitesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimSitesDeleteParamsWithTimeout(timeout time.Duration) *DcimSitesDeleteParams { + var () + return &DcimSitesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimSitesDeleteParamsWithContext creates a new DcimSitesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimSitesDeleteParamsWithContext(ctx context.Context) *DcimSitesDeleteParams { + var () + return &DcimSitesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimSitesDeleteParamsWithHTTPClient creates a new DcimSitesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimSitesDeleteParamsWithHTTPClient(client *http.Client) *DcimSitesDeleteParams { + var () + return &DcimSitesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimSitesDeleteParams contains all the parameters to send to the API endpoint +for the dcim sites delete operation typically these are written to a http.Request +*/ +type DcimSitesDeleteParams struct { + + /*ID + A unique integer value identifying this site. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim sites delete params +func (o *DcimSitesDeleteParams) WithTimeout(timeout time.Duration) *DcimSitesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim sites delete params +func (o *DcimSitesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim sites delete params +func (o *DcimSitesDeleteParams) WithContext(ctx context.Context) *DcimSitesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim sites delete params +func (o *DcimSitesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim sites delete params +func (o *DcimSitesDeleteParams) WithHTTPClient(client *http.Client) *DcimSitesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim sites delete params +func (o *DcimSitesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim sites delete params +func (o *DcimSitesDeleteParams) WithID(id int64) *DcimSitesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim sites delete params +func (o *DcimSitesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimSitesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_delete_responses.go new file mode 100644 index 0000000..93c0bf9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimSitesDeleteReader is a Reader for the DcimSitesDelete structure. +type DcimSitesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimSitesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimSitesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimSitesDeleteNoContent creates a DcimSitesDeleteNoContent with default headers values +func NewDcimSitesDeleteNoContent() *DcimSitesDeleteNoContent { + return &DcimSitesDeleteNoContent{} +} + +/*DcimSitesDeleteNoContent handles this case with default header values. + +DcimSitesDeleteNoContent dcim sites delete no content +*/ +type DcimSitesDeleteNoContent struct { +} + +func (o *DcimSitesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/sites/{id}/][%d] dcimSitesDeleteNoContent ", 204) +} + +func (o *DcimSitesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_graphs_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_graphs_parameters.go new file mode 100644 index 0000000..29f2590 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_graphs_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimSitesGraphsParams creates a new DcimSitesGraphsParams object +// with the default values initialized. +func NewDcimSitesGraphsParams() *DcimSitesGraphsParams { + var () + return &DcimSitesGraphsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimSitesGraphsParamsWithTimeout creates a new DcimSitesGraphsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimSitesGraphsParamsWithTimeout(timeout time.Duration) *DcimSitesGraphsParams { + var () + return &DcimSitesGraphsParams{ + + timeout: timeout, + } +} + +// NewDcimSitesGraphsParamsWithContext creates a new DcimSitesGraphsParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimSitesGraphsParamsWithContext(ctx context.Context) *DcimSitesGraphsParams { + var () + return &DcimSitesGraphsParams{ + + Context: ctx, + } +} + +// NewDcimSitesGraphsParamsWithHTTPClient creates a new DcimSitesGraphsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimSitesGraphsParamsWithHTTPClient(client *http.Client) *DcimSitesGraphsParams { + var () + return &DcimSitesGraphsParams{ + HTTPClient: client, + } +} + +/*DcimSitesGraphsParams contains all the parameters to send to the API endpoint +for the dcim sites graphs operation typically these are written to a http.Request +*/ +type DcimSitesGraphsParams struct { + + /*ID + A unique integer value identifying this site. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim sites graphs params +func (o *DcimSitesGraphsParams) WithTimeout(timeout time.Duration) *DcimSitesGraphsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim sites graphs params +func (o *DcimSitesGraphsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim sites graphs params +func (o *DcimSitesGraphsParams) WithContext(ctx context.Context) *DcimSitesGraphsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim sites graphs params +func (o *DcimSitesGraphsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim sites graphs params +func (o *DcimSitesGraphsParams) WithHTTPClient(client *http.Client) *DcimSitesGraphsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim sites graphs params +func (o *DcimSitesGraphsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim sites graphs params +func (o *DcimSitesGraphsParams) WithID(id int64) *DcimSitesGraphsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim sites graphs params +func (o *DcimSitesGraphsParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimSitesGraphsParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_graphs_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_graphs_responses.go new file mode 100644 index 0000000..1120bcb --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_graphs_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimSitesGraphsReader is a Reader for the DcimSitesGraphs structure. +type DcimSitesGraphsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimSitesGraphsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimSitesGraphsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimSitesGraphsOK creates a DcimSitesGraphsOK with default headers values +func NewDcimSitesGraphsOK() *DcimSitesGraphsOK { + return &DcimSitesGraphsOK{} +} + +/*DcimSitesGraphsOK handles this case with default header values. + +DcimSitesGraphsOK dcim sites graphs o k +*/ +type DcimSitesGraphsOK struct { + Payload *models.Site +} + +func (o *DcimSitesGraphsOK) Error() string { + return fmt.Sprintf("[GET /dcim/sites/{id}/graphs/][%d] dcimSitesGraphsOK %+v", 200, o.Payload) +} + +func (o *DcimSitesGraphsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Site) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_list_parameters.go new file mode 100644 index 0000000..0257a56 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_list_parameters.go @@ -0,0 +1,604 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimSitesListParams creates a new DcimSitesListParams object +// with the default values initialized. +func NewDcimSitesListParams() *DcimSitesListParams { + var () + return &DcimSitesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimSitesListParamsWithTimeout creates a new DcimSitesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimSitesListParamsWithTimeout(timeout time.Duration) *DcimSitesListParams { + var () + return &DcimSitesListParams{ + + timeout: timeout, + } +} + +// NewDcimSitesListParamsWithContext creates a new DcimSitesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimSitesListParamsWithContext(ctx context.Context) *DcimSitesListParams { + var () + return &DcimSitesListParams{ + + Context: ctx, + } +} + +// NewDcimSitesListParamsWithHTTPClient creates a new DcimSitesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimSitesListParamsWithHTTPClient(client *http.Client) *DcimSitesListParams { + var () + return &DcimSitesListParams{ + HTTPClient: client, + } +} + +/*DcimSitesListParams contains all the parameters to send to the API endpoint +for the dcim sites list operation typically these are written to a http.Request +*/ +type DcimSitesListParams struct { + + /*Asn*/ + Asn *float64 + /*ContactEmail*/ + ContactEmail *string + /*ContactName*/ + ContactName *string + /*ContactPhone*/ + ContactPhone *string + /*Facility*/ + Facility *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Region*/ + Region *string + /*RegionID*/ + RegionID *string + /*Slug*/ + Slug *string + /*Status*/ + Status *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim sites list params +func (o *DcimSitesListParams) WithTimeout(timeout time.Duration) *DcimSitesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim sites list params +func (o *DcimSitesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim sites list params +func (o *DcimSitesListParams) WithContext(ctx context.Context) *DcimSitesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim sites list params +func (o *DcimSitesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim sites list params +func (o *DcimSitesListParams) WithHTTPClient(client *http.Client) *DcimSitesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim sites list params +func (o *DcimSitesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAsn adds the asn to the dcim sites list params +func (o *DcimSitesListParams) WithAsn(asn *float64) *DcimSitesListParams { + o.SetAsn(asn) + return o +} + +// SetAsn adds the asn to the dcim sites list params +func (o *DcimSitesListParams) SetAsn(asn *float64) { + o.Asn = asn +} + +// WithContactEmail adds the contactEmail to the dcim sites list params +func (o *DcimSitesListParams) WithContactEmail(contactEmail *string) *DcimSitesListParams { + o.SetContactEmail(contactEmail) + return o +} + +// SetContactEmail adds the contactEmail to the dcim sites list params +func (o *DcimSitesListParams) SetContactEmail(contactEmail *string) { + o.ContactEmail = contactEmail +} + +// WithContactName adds the contactName to the dcim sites list params +func (o *DcimSitesListParams) WithContactName(contactName *string) *DcimSitesListParams { + o.SetContactName(contactName) + return o +} + +// SetContactName adds the contactName to the dcim sites list params +func (o *DcimSitesListParams) SetContactName(contactName *string) { + o.ContactName = contactName +} + +// WithContactPhone adds the contactPhone to the dcim sites list params +func (o *DcimSitesListParams) WithContactPhone(contactPhone *string) *DcimSitesListParams { + o.SetContactPhone(contactPhone) + return o +} + +// SetContactPhone adds the contactPhone to the dcim sites list params +func (o *DcimSitesListParams) SetContactPhone(contactPhone *string) { + o.ContactPhone = contactPhone +} + +// WithFacility adds the facility to the dcim sites list params +func (o *DcimSitesListParams) WithFacility(facility *string) *DcimSitesListParams { + o.SetFacility(facility) + return o +} + +// SetFacility adds the facility to the dcim sites list params +func (o *DcimSitesListParams) SetFacility(facility *string) { + o.Facility = facility +} + +// WithIDIn adds the iDIn to the dcim sites list params +func (o *DcimSitesListParams) WithIDIn(iDIn *string) *DcimSitesListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the dcim sites list params +func (o *DcimSitesListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the dcim sites list params +func (o *DcimSitesListParams) WithLimit(limit *int64) *DcimSitesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim sites list params +func (o *DcimSitesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim sites list params +func (o *DcimSitesListParams) WithName(name *string) *DcimSitesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim sites list params +func (o *DcimSitesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim sites list params +func (o *DcimSitesListParams) WithOffset(offset *int64) *DcimSitesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim sites list params +func (o *DcimSitesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the dcim sites list params +func (o *DcimSitesListParams) WithQ(q *string) *DcimSitesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim sites list params +func (o *DcimSitesListParams) SetQ(q *string) { + o.Q = q +} + +// WithRegion adds the region to the dcim sites list params +func (o *DcimSitesListParams) WithRegion(region *string) *DcimSitesListParams { + o.SetRegion(region) + return o +} + +// SetRegion adds the region to the dcim sites list params +func (o *DcimSitesListParams) SetRegion(region *string) { + o.Region = region +} + +// WithRegionID adds the regionID to the dcim sites list params +func (o *DcimSitesListParams) WithRegionID(regionID *string) *DcimSitesListParams { + o.SetRegionID(regionID) + return o +} + +// SetRegionID adds the regionId to the dcim sites list params +func (o *DcimSitesListParams) SetRegionID(regionID *string) { + o.RegionID = regionID +} + +// WithSlug adds the slug to the dcim sites list params +func (o *DcimSitesListParams) WithSlug(slug *string) *DcimSitesListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the dcim sites list params +func (o *DcimSitesListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WithStatus adds the status to the dcim sites list params +func (o *DcimSitesListParams) WithStatus(status *string) *DcimSitesListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the dcim sites list params +func (o *DcimSitesListParams) SetStatus(status *string) { + o.Status = status +} + +// WithTenant adds the tenant to the dcim sites list params +func (o *DcimSitesListParams) WithTenant(tenant *string) *DcimSitesListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the dcim sites list params +func (o *DcimSitesListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the dcim sites list params +func (o *DcimSitesListParams) WithTenantID(tenantID *string) *DcimSitesListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the dcim sites list params +func (o *DcimSitesListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimSitesListParams) 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 float64 + if o.Asn != nil { + qrAsn = *o.Asn + } + qAsn := swag.FormatFloat64(qrAsn) + if qAsn != "" { + if err := r.SetQueryParam("asn", qAsn); err != nil { + return err + } + } + + } + + if o.ContactEmail != nil { + + // query param contact_email + var qrContactEmail string + if o.ContactEmail != nil { + qrContactEmail = *o.ContactEmail + } + qContactEmail := qrContactEmail + if qContactEmail != "" { + if err := r.SetQueryParam("contact_email", qContactEmail); err != nil { + return err + } + } + + } + + if o.ContactName != nil { + + // query param contact_name + var qrContactName string + if o.ContactName != nil { + qrContactName = *o.ContactName + } + qContactName := qrContactName + if qContactName != "" { + if err := r.SetQueryParam("contact_name", qContactName); err != nil { + return err + } + } + + } + + if o.ContactPhone != nil { + + // query param contact_phone + var qrContactPhone string + if o.ContactPhone != nil { + qrContactPhone = *o.ContactPhone + } + qContactPhone := qrContactPhone + if qContactPhone != "" { + if err := r.SetQueryParam("contact_phone", qContactPhone); err != nil { + return err + } + } + + } + + if o.Facility != nil { + + // query param facility + var qrFacility string + if o.Facility != nil { + qrFacility = *o.Facility + } + qFacility := qrFacility + if qFacility != "" { + if err := r.SetQueryParam("facility", qFacility); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); 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.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.Region != nil { + + // query param region + var qrRegion string + if o.Region != nil { + qrRegion = *o.Region + } + qRegion := qrRegion + if qRegion != "" { + if err := r.SetQueryParam("region", qRegion); err != nil { + return err + } + } + + } + + if o.RegionID != nil { + + // query param region_id + var qrRegionID string + if o.RegionID != nil { + qrRegionID = *o.RegionID + } + qRegionID := qrRegionID + if qRegionID != "" { + if err := r.SetQueryParam("region_id", qRegionID); 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.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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_list_responses.go new file mode 100644 index 0000000..eb32561 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimSitesListReader is a Reader for the DcimSitesList structure. +type DcimSitesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimSitesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimSitesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimSitesListOK creates a DcimSitesListOK with default headers values +func NewDcimSitesListOK() *DcimSitesListOK { + return &DcimSitesListOK{} +} + +/*DcimSitesListOK handles this case with default header values. + +DcimSitesListOK dcim sites list o k +*/ +type DcimSitesListOK struct { + Payload *models.DcimSitesListOKBody +} + +func (o *DcimSitesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/sites/][%d] dcimSitesListOK %+v", 200, o.Payload) +} + +func (o *DcimSitesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimSitesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_partial_update_parameters.go new file mode 100644 index 0000000..d5dc8db --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimSitesPartialUpdateParams creates a new DcimSitesPartialUpdateParams object +// with the default values initialized. +func NewDcimSitesPartialUpdateParams() *DcimSitesPartialUpdateParams { + var () + return &DcimSitesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimSitesPartialUpdateParamsWithTimeout creates a new DcimSitesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimSitesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimSitesPartialUpdateParams { + var () + return &DcimSitesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimSitesPartialUpdateParamsWithContext creates a new DcimSitesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimSitesPartialUpdateParamsWithContext(ctx context.Context) *DcimSitesPartialUpdateParams { + var () + return &DcimSitesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimSitesPartialUpdateParamsWithHTTPClient creates a new DcimSitesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimSitesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimSitesPartialUpdateParams { + var () + return &DcimSitesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimSitesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim sites partial update operation typically these are written to a http.Request +*/ +type DcimSitesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableSite + /*ID + A unique integer value identifying this site. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimSitesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) WithContext(ctx context.Context) *DcimSitesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimSitesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) WithData(data *models.WritableSite) *DcimSitesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) SetData(data *models.WritableSite) { + o.Data = data +} + +// WithID adds the id to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) WithID(id int64) *DcimSitesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimSitesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_partial_update_responses.go new file mode 100644 index 0000000..dedc6ab --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimSitesPartialUpdateReader is a Reader for the DcimSitesPartialUpdate structure. +type DcimSitesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimSitesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimSitesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimSitesPartialUpdateOK creates a DcimSitesPartialUpdateOK with default headers values +func NewDcimSitesPartialUpdateOK() *DcimSitesPartialUpdateOK { + return &DcimSitesPartialUpdateOK{} +} + +/*DcimSitesPartialUpdateOK handles this case with default header values. + +DcimSitesPartialUpdateOK dcim sites partial update o k +*/ +type DcimSitesPartialUpdateOK struct { + Payload *models.WritableSite +} + +func (o *DcimSitesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/sites/{id}/][%d] dcimSitesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimSitesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableSite) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_read_parameters.go new file mode 100644 index 0000000..a2c977b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimSitesReadParams creates a new DcimSitesReadParams object +// with the default values initialized. +func NewDcimSitesReadParams() *DcimSitesReadParams { + var () + return &DcimSitesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimSitesReadParamsWithTimeout creates a new DcimSitesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimSitesReadParamsWithTimeout(timeout time.Duration) *DcimSitesReadParams { + var () + return &DcimSitesReadParams{ + + timeout: timeout, + } +} + +// NewDcimSitesReadParamsWithContext creates a new DcimSitesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimSitesReadParamsWithContext(ctx context.Context) *DcimSitesReadParams { + var () + return &DcimSitesReadParams{ + + Context: ctx, + } +} + +// NewDcimSitesReadParamsWithHTTPClient creates a new DcimSitesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimSitesReadParamsWithHTTPClient(client *http.Client) *DcimSitesReadParams { + var () + return &DcimSitesReadParams{ + HTTPClient: client, + } +} + +/*DcimSitesReadParams contains all the parameters to send to the API endpoint +for the dcim sites read operation typically these are written to a http.Request +*/ +type DcimSitesReadParams struct { + + /*ID + A unique integer value identifying this site. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim sites read params +func (o *DcimSitesReadParams) WithTimeout(timeout time.Duration) *DcimSitesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim sites read params +func (o *DcimSitesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim sites read params +func (o *DcimSitesReadParams) WithContext(ctx context.Context) *DcimSitesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim sites read params +func (o *DcimSitesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim sites read params +func (o *DcimSitesReadParams) WithHTTPClient(client *http.Client) *DcimSitesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim sites read params +func (o *DcimSitesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim sites read params +func (o *DcimSitesReadParams) WithID(id int64) *DcimSitesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim sites read params +func (o *DcimSitesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimSitesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_read_responses.go new file mode 100644 index 0000000..9802b56 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimSitesReadReader is a Reader for the DcimSitesRead structure. +type DcimSitesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimSitesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimSitesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimSitesReadOK creates a DcimSitesReadOK with default headers values +func NewDcimSitesReadOK() *DcimSitesReadOK { + return &DcimSitesReadOK{} +} + +/*DcimSitesReadOK handles this case with default header values. + +DcimSitesReadOK dcim sites read o k +*/ +type DcimSitesReadOK struct { + Payload *models.Site +} + +func (o *DcimSitesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/sites/{id}/][%d] dcimSitesReadOK %+v", 200, o.Payload) +} + +func (o *DcimSitesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Site) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_update_parameters.go new file mode 100644 index 0000000..d029bf4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimSitesUpdateParams creates a new DcimSitesUpdateParams object +// with the default values initialized. +func NewDcimSitesUpdateParams() *DcimSitesUpdateParams { + var () + return &DcimSitesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimSitesUpdateParamsWithTimeout creates a new DcimSitesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimSitesUpdateParamsWithTimeout(timeout time.Duration) *DcimSitesUpdateParams { + var () + return &DcimSitesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimSitesUpdateParamsWithContext creates a new DcimSitesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimSitesUpdateParamsWithContext(ctx context.Context) *DcimSitesUpdateParams { + var () + return &DcimSitesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimSitesUpdateParamsWithHTTPClient creates a new DcimSitesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimSitesUpdateParamsWithHTTPClient(client *http.Client) *DcimSitesUpdateParams { + var () + return &DcimSitesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimSitesUpdateParams contains all the parameters to send to the API endpoint +for the dcim sites update operation typically these are written to a http.Request +*/ +type DcimSitesUpdateParams struct { + + /*Data*/ + Data *models.WritableSite + /*ID + A unique integer value identifying this site. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim sites update params +func (o *DcimSitesUpdateParams) WithTimeout(timeout time.Duration) *DcimSitesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim sites update params +func (o *DcimSitesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim sites update params +func (o *DcimSitesUpdateParams) WithContext(ctx context.Context) *DcimSitesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim sites update params +func (o *DcimSitesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim sites update params +func (o *DcimSitesUpdateParams) WithHTTPClient(client *http.Client) *DcimSitesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim sites update params +func (o *DcimSitesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim sites update params +func (o *DcimSitesUpdateParams) WithData(data *models.WritableSite) *DcimSitesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim sites update params +func (o *DcimSitesUpdateParams) SetData(data *models.WritableSite) { + o.Data = data +} + +// WithID adds the id to the dcim sites update params +func (o *DcimSitesUpdateParams) WithID(id int64) *DcimSitesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim sites update params +func (o *DcimSitesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimSitesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_update_responses.go new file mode 100644 index 0000000..5859372 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_sites_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimSitesUpdateReader is a Reader for the DcimSitesUpdate structure. +type DcimSitesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimSitesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimSitesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimSitesUpdateOK creates a DcimSitesUpdateOK with default headers values +func NewDcimSitesUpdateOK() *DcimSitesUpdateOK { + return &DcimSitesUpdateOK{} +} + +/*DcimSitesUpdateOK handles this case with default header values. + +DcimSitesUpdateOK dcim sites update o k +*/ +type DcimSitesUpdateOK struct { + Payload *models.WritableSite +} + +func (o *DcimSitesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/sites/{id}/][%d] dcimSitesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimSitesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableSite) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_create_parameters.go new file mode 100644 index 0000000..ad68090 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimVirtualChassisCreateParams creates a new DcimVirtualChassisCreateParams object +// with the default values initialized. +func NewDcimVirtualChassisCreateParams() *DcimVirtualChassisCreateParams { + var () + return &DcimVirtualChassisCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimVirtualChassisCreateParamsWithTimeout creates a new DcimVirtualChassisCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimVirtualChassisCreateParamsWithTimeout(timeout time.Duration) *DcimVirtualChassisCreateParams { + var () + return &DcimVirtualChassisCreateParams{ + + timeout: timeout, + } +} + +// NewDcimVirtualChassisCreateParamsWithContext creates a new DcimVirtualChassisCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimVirtualChassisCreateParamsWithContext(ctx context.Context) *DcimVirtualChassisCreateParams { + var () + return &DcimVirtualChassisCreateParams{ + + Context: ctx, + } +} + +// NewDcimVirtualChassisCreateParamsWithHTTPClient creates a new DcimVirtualChassisCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimVirtualChassisCreateParamsWithHTTPClient(client *http.Client) *DcimVirtualChassisCreateParams { + var () + return &DcimVirtualChassisCreateParams{ + HTTPClient: client, + } +} + +/*DcimVirtualChassisCreateParams contains all the parameters to send to the API endpoint +for the dcim virtual chassis create operation typically these are written to a http.Request +*/ +type DcimVirtualChassisCreateParams struct { + + /*Data*/ + Data *models.WritableVirtualChassis + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim virtual chassis create params +func (o *DcimVirtualChassisCreateParams) WithTimeout(timeout time.Duration) *DcimVirtualChassisCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim virtual chassis create params +func (o *DcimVirtualChassisCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim virtual chassis create params +func (o *DcimVirtualChassisCreateParams) WithContext(ctx context.Context) *DcimVirtualChassisCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim virtual chassis create params +func (o *DcimVirtualChassisCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim virtual chassis create params +func (o *DcimVirtualChassisCreateParams) WithHTTPClient(client *http.Client) *DcimVirtualChassisCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim virtual chassis create params +func (o *DcimVirtualChassisCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim virtual chassis create params +func (o *DcimVirtualChassisCreateParams) WithData(data *models.WritableVirtualChassis) *DcimVirtualChassisCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim virtual chassis create params +func (o *DcimVirtualChassisCreateParams) SetData(data *models.WritableVirtualChassis) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimVirtualChassisCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_create_responses.go new file mode 100644 index 0000000..4ce8a55 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimVirtualChassisCreateReader is a Reader for the DcimVirtualChassisCreate structure. +type DcimVirtualChassisCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimVirtualChassisCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimVirtualChassisCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimVirtualChassisCreateCreated creates a DcimVirtualChassisCreateCreated with default headers values +func NewDcimVirtualChassisCreateCreated() *DcimVirtualChassisCreateCreated { + return &DcimVirtualChassisCreateCreated{} +} + +/*DcimVirtualChassisCreateCreated handles this case with default header values. + +DcimVirtualChassisCreateCreated dcim virtual chassis create created +*/ +type DcimVirtualChassisCreateCreated struct { + Payload *models.WritableVirtualChassis +} + +func (o *DcimVirtualChassisCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/virtual-chassis/][%d] dcimVirtualChassisCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimVirtualChassisCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVirtualChassis) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_delete_parameters.go new file mode 100644 index 0000000..5040b2a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimVirtualChassisDeleteParams creates a new DcimVirtualChassisDeleteParams object +// with the default values initialized. +func NewDcimVirtualChassisDeleteParams() *DcimVirtualChassisDeleteParams { + var () + return &DcimVirtualChassisDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimVirtualChassisDeleteParamsWithTimeout creates a new DcimVirtualChassisDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimVirtualChassisDeleteParamsWithTimeout(timeout time.Duration) *DcimVirtualChassisDeleteParams { + var () + return &DcimVirtualChassisDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimVirtualChassisDeleteParamsWithContext creates a new DcimVirtualChassisDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimVirtualChassisDeleteParamsWithContext(ctx context.Context) *DcimVirtualChassisDeleteParams { + var () + return &DcimVirtualChassisDeleteParams{ + + Context: ctx, + } +} + +// NewDcimVirtualChassisDeleteParamsWithHTTPClient creates a new DcimVirtualChassisDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimVirtualChassisDeleteParamsWithHTTPClient(client *http.Client) *DcimVirtualChassisDeleteParams { + var () + return &DcimVirtualChassisDeleteParams{ + HTTPClient: client, + } +} + +/*DcimVirtualChassisDeleteParams contains all the parameters to send to the API endpoint +for the dcim virtual chassis delete operation typically these are written to a http.Request +*/ +type DcimVirtualChassisDeleteParams struct { + + /*ID + A unique integer value identifying this virtual chassis. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim virtual chassis delete params +func (o *DcimVirtualChassisDeleteParams) WithTimeout(timeout time.Duration) *DcimVirtualChassisDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim virtual chassis delete params +func (o *DcimVirtualChassisDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim virtual chassis delete params +func (o *DcimVirtualChassisDeleteParams) WithContext(ctx context.Context) *DcimVirtualChassisDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim virtual chassis delete params +func (o *DcimVirtualChassisDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim virtual chassis delete params +func (o *DcimVirtualChassisDeleteParams) WithHTTPClient(client *http.Client) *DcimVirtualChassisDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim virtual chassis delete params +func (o *DcimVirtualChassisDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim virtual chassis delete params +func (o *DcimVirtualChassisDeleteParams) WithID(id int64) *DcimVirtualChassisDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim virtual chassis delete params +func (o *DcimVirtualChassisDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimVirtualChassisDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_delete_responses.go new file mode 100644 index 0000000..83795c1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimVirtualChassisDeleteReader is a Reader for the DcimVirtualChassisDelete structure. +type DcimVirtualChassisDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimVirtualChassisDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimVirtualChassisDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimVirtualChassisDeleteNoContent creates a DcimVirtualChassisDeleteNoContent with default headers values +func NewDcimVirtualChassisDeleteNoContent() *DcimVirtualChassisDeleteNoContent { + return &DcimVirtualChassisDeleteNoContent{} +} + +/*DcimVirtualChassisDeleteNoContent handles this case with default header values. + +DcimVirtualChassisDeleteNoContent dcim virtual chassis delete no content +*/ +type DcimVirtualChassisDeleteNoContent struct { +} + +func (o *DcimVirtualChassisDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/virtual-chassis/{id}/][%d] dcimVirtualChassisDeleteNoContent ", 204) +} + +func (o *DcimVirtualChassisDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_list_parameters.go new file mode 100644 index 0000000..58115c4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_list_parameters.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimVirtualChassisListParams creates a new DcimVirtualChassisListParams object +// with the default values initialized. +func NewDcimVirtualChassisListParams() *DcimVirtualChassisListParams { + var () + return &DcimVirtualChassisListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimVirtualChassisListParamsWithTimeout creates a new DcimVirtualChassisListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimVirtualChassisListParamsWithTimeout(timeout time.Duration) *DcimVirtualChassisListParams { + var () + return &DcimVirtualChassisListParams{ + + timeout: timeout, + } +} + +// NewDcimVirtualChassisListParamsWithContext creates a new DcimVirtualChassisListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimVirtualChassisListParamsWithContext(ctx context.Context) *DcimVirtualChassisListParams { + var () + return &DcimVirtualChassisListParams{ + + Context: ctx, + } +} + +// NewDcimVirtualChassisListParamsWithHTTPClient creates a new DcimVirtualChassisListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimVirtualChassisListParamsWithHTTPClient(client *http.Client) *DcimVirtualChassisListParams { + var () + return &DcimVirtualChassisListParams{ + HTTPClient: client, + } +} + +/*DcimVirtualChassisListParams contains all the parameters to send to the API endpoint +for the dcim virtual chassis list operation typically these are written to a http.Request +*/ +type DcimVirtualChassisListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) WithTimeout(timeout time.Duration) *DcimVirtualChassisListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) WithContext(ctx context.Context) *DcimVirtualChassisListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) WithHTTPClient(client *http.Client) *DcimVirtualChassisListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) WithLimit(limit *int64) *DcimVirtualChassisListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) WithOffset(offset *int64) *DcimVirtualChassisListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimVirtualChassisListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_list_responses.go new file mode 100644 index 0000000..9e74783 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimVirtualChassisListReader is a Reader for the DcimVirtualChassisList structure. +type DcimVirtualChassisListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimVirtualChassisListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimVirtualChassisListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimVirtualChassisListOK creates a DcimVirtualChassisListOK with default headers values +func NewDcimVirtualChassisListOK() *DcimVirtualChassisListOK { + return &DcimVirtualChassisListOK{} +} + +/*DcimVirtualChassisListOK handles this case with default header values. + +DcimVirtualChassisListOK dcim virtual chassis list o k +*/ +type DcimVirtualChassisListOK struct { + Payload *models.DcimVirtualChassisListOKBody +} + +func (o *DcimVirtualChassisListOK) Error() string { + return fmt.Sprintf("[GET /dcim/virtual-chassis/][%d] dcimVirtualChassisListOK %+v", 200, o.Payload) +} + +func (o *DcimVirtualChassisListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimVirtualChassisListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_partial_update_parameters.go new file mode 100644 index 0000000..3a80e24 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimVirtualChassisPartialUpdateParams creates a new DcimVirtualChassisPartialUpdateParams object +// with the default values initialized. +func NewDcimVirtualChassisPartialUpdateParams() *DcimVirtualChassisPartialUpdateParams { + var () + return &DcimVirtualChassisPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimVirtualChassisPartialUpdateParamsWithTimeout creates a new DcimVirtualChassisPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimVirtualChassisPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimVirtualChassisPartialUpdateParams { + var () + return &DcimVirtualChassisPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimVirtualChassisPartialUpdateParamsWithContext creates a new DcimVirtualChassisPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimVirtualChassisPartialUpdateParamsWithContext(ctx context.Context) *DcimVirtualChassisPartialUpdateParams { + var () + return &DcimVirtualChassisPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimVirtualChassisPartialUpdateParamsWithHTTPClient creates a new DcimVirtualChassisPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimVirtualChassisPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimVirtualChassisPartialUpdateParams { + var () + return &DcimVirtualChassisPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimVirtualChassisPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim virtual chassis partial update operation typically these are written to a http.Request +*/ +type DcimVirtualChassisPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableVirtualChassis + /*ID + A unique integer value identifying this virtual chassis. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimVirtualChassisPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) WithContext(ctx context.Context) *DcimVirtualChassisPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimVirtualChassisPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) WithData(data *models.WritableVirtualChassis) *DcimVirtualChassisPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) SetData(data *models.WritableVirtualChassis) { + o.Data = data +} + +// WithID adds the id to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) WithID(id int64) *DcimVirtualChassisPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimVirtualChassisPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_partial_update_responses.go new file mode 100644 index 0000000..632af09 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimVirtualChassisPartialUpdateReader is a Reader for the DcimVirtualChassisPartialUpdate structure. +type DcimVirtualChassisPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimVirtualChassisPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimVirtualChassisPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimVirtualChassisPartialUpdateOK creates a DcimVirtualChassisPartialUpdateOK with default headers values +func NewDcimVirtualChassisPartialUpdateOK() *DcimVirtualChassisPartialUpdateOK { + return &DcimVirtualChassisPartialUpdateOK{} +} + +/*DcimVirtualChassisPartialUpdateOK handles this case with default header values. + +DcimVirtualChassisPartialUpdateOK dcim virtual chassis partial update o k +*/ +type DcimVirtualChassisPartialUpdateOK struct { + Payload *models.WritableVirtualChassis +} + +func (o *DcimVirtualChassisPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/virtual-chassis/{id}/][%d] dcimVirtualChassisPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimVirtualChassisPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVirtualChassis) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_read_parameters.go new file mode 100644 index 0000000..b991ae0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimVirtualChassisReadParams creates a new DcimVirtualChassisReadParams object +// with the default values initialized. +func NewDcimVirtualChassisReadParams() *DcimVirtualChassisReadParams { + var () + return &DcimVirtualChassisReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimVirtualChassisReadParamsWithTimeout creates a new DcimVirtualChassisReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimVirtualChassisReadParamsWithTimeout(timeout time.Duration) *DcimVirtualChassisReadParams { + var () + return &DcimVirtualChassisReadParams{ + + timeout: timeout, + } +} + +// NewDcimVirtualChassisReadParamsWithContext creates a new DcimVirtualChassisReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimVirtualChassisReadParamsWithContext(ctx context.Context) *DcimVirtualChassisReadParams { + var () + return &DcimVirtualChassisReadParams{ + + Context: ctx, + } +} + +// NewDcimVirtualChassisReadParamsWithHTTPClient creates a new DcimVirtualChassisReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimVirtualChassisReadParamsWithHTTPClient(client *http.Client) *DcimVirtualChassisReadParams { + var () + return &DcimVirtualChassisReadParams{ + HTTPClient: client, + } +} + +/*DcimVirtualChassisReadParams contains all the parameters to send to the API endpoint +for the dcim virtual chassis read operation typically these are written to a http.Request +*/ +type DcimVirtualChassisReadParams struct { + + /*ID + A unique integer value identifying this virtual chassis. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim virtual chassis read params +func (o *DcimVirtualChassisReadParams) WithTimeout(timeout time.Duration) *DcimVirtualChassisReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim virtual chassis read params +func (o *DcimVirtualChassisReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim virtual chassis read params +func (o *DcimVirtualChassisReadParams) WithContext(ctx context.Context) *DcimVirtualChassisReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim virtual chassis read params +func (o *DcimVirtualChassisReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim virtual chassis read params +func (o *DcimVirtualChassisReadParams) WithHTTPClient(client *http.Client) *DcimVirtualChassisReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim virtual chassis read params +func (o *DcimVirtualChassisReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim virtual chassis read params +func (o *DcimVirtualChassisReadParams) WithID(id int64) *DcimVirtualChassisReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim virtual chassis read params +func (o *DcimVirtualChassisReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimVirtualChassisReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_read_responses.go new file mode 100644 index 0000000..916f219 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimVirtualChassisReadReader is a Reader for the DcimVirtualChassisRead structure. +type DcimVirtualChassisReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimVirtualChassisReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimVirtualChassisReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimVirtualChassisReadOK creates a DcimVirtualChassisReadOK with default headers values +func NewDcimVirtualChassisReadOK() *DcimVirtualChassisReadOK { + return &DcimVirtualChassisReadOK{} +} + +/*DcimVirtualChassisReadOK handles this case with default header values. + +DcimVirtualChassisReadOK dcim virtual chassis read o k +*/ +type DcimVirtualChassisReadOK struct { + Payload *models.VirtualChassis +} + +func (o *DcimVirtualChassisReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/virtual-chassis/{id}/][%d] dcimVirtualChassisReadOK %+v", 200, o.Payload) +} + +func (o *DcimVirtualChassisReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VirtualChassis) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_update_parameters.go new file mode 100644 index 0000000..659351a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimVirtualChassisUpdateParams creates a new DcimVirtualChassisUpdateParams object +// with the default values initialized. +func NewDcimVirtualChassisUpdateParams() *DcimVirtualChassisUpdateParams { + var () + return &DcimVirtualChassisUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimVirtualChassisUpdateParamsWithTimeout creates a new DcimVirtualChassisUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimVirtualChassisUpdateParamsWithTimeout(timeout time.Duration) *DcimVirtualChassisUpdateParams { + var () + return &DcimVirtualChassisUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimVirtualChassisUpdateParamsWithContext creates a new DcimVirtualChassisUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimVirtualChassisUpdateParamsWithContext(ctx context.Context) *DcimVirtualChassisUpdateParams { + var () + return &DcimVirtualChassisUpdateParams{ + + Context: ctx, + } +} + +// NewDcimVirtualChassisUpdateParamsWithHTTPClient creates a new DcimVirtualChassisUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimVirtualChassisUpdateParamsWithHTTPClient(client *http.Client) *DcimVirtualChassisUpdateParams { + var () + return &DcimVirtualChassisUpdateParams{ + HTTPClient: client, + } +} + +/*DcimVirtualChassisUpdateParams contains all the parameters to send to the API endpoint +for the dcim virtual chassis update operation typically these are written to a http.Request +*/ +type DcimVirtualChassisUpdateParams struct { + + /*Data*/ + Data *models.WritableVirtualChassis + /*ID + A unique integer value identifying this virtual chassis. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) WithTimeout(timeout time.Duration) *DcimVirtualChassisUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) WithContext(ctx context.Context) *DcimVirtualChassisUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) WithHTTPClient(client *http.Client) *DcimVirtualChassisUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) WithData(data *models.WritableVirtualChassis) *DcimVirtualChassisUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) SetData(data *models.WritableVirtualChassis) { + o.Data = data +} + +// WithID adds the id to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) WithID(id int64) *DcimVirtualChassisUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimVirtualChassisUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_update_responses.go new file mode 100644 index 0000000..b6ef92f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/dcim/dcim_virtual_chassis_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 dcim + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimVirtualChassisUpdateReader is a Reader for the DcimVirtualChassisUpdate structure. +type DcimVirtualChassisUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimVirtualChassisUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimVirtualChassisUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimVirtualChassisUpdateOK creates a DcimVirtualChassisUpdateOK with default headers values +func NewDcimVirtualChassisUpdateOK() *DcimVirtualChassisUpdateOK { + return &DcimVirtualChassisUpdateOK{} +} + +/*DcimVirtualChassisUpdateOK handles this case with default header values. + +DcimVirtualChassisUpdateOK dcim virtual chassis update o k +*/ +type DcimVirtualChassisUpdateOK struct { + Payload *models.WritableVirtualChassis +} + +func (o *DcimVirtualChassisUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/virtual-chassis/{id}/][%d] dcimVirtualChassisUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimVirtualChassisUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVirtualChassis) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_choices_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_choices_list_parameters.go new file mode 100644 index 0000000..5451036 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_choices_list_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasChoicesListParams creates a new ExtrasChoicesListParams object +// with the default values initialized. +func NewExtrasChoicesListParams() *ExtrasChoicesListParams { + + return &ExtrasChoicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasChoicesListParamsWithTimeout creates a new ExtrasChoicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasChoicesListParamsWithTimeout(timeout time.Duration) *ExtrasChoicesListParams { + + return &ExtrasChoicesListParams{ + + timeout: timeout, + } +} + +// NewExtrasChoicesListParamsWithContext creates a new ExtrasChoicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasChoicesListParamsWithContext(ctx context.Context) *ExtrasChoicesListParams { + + return &ExtrasChoicesListParams{ + + Context: ctx, + } +} + +// NewExtrasChoicesListParamsWithHTTPClient creates a new ExtrasChoicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasChoicesListParamsWithHTTPClient(client *http.Client) *ExtrasChoicesListParams { + + return &ExtrasChoicesListParams{ + HTTPClient: client, + } +} + +/*ExtrasChoicesListParams contains all the parameters to send to the API endpoint +for the extras choices list operation typically these are written to a http.Request +*/ +type ExtrasChoicesListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras choices list params +func (o *ExtrasChoicesListParams) WithTimeout(timeout time.Duration) *ExtrasChoicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras choices list params +func (o *ExtrasChoicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras choices list params +func (o *ExtrasChoicesListParams) WithContext(ctx context.Context) *ExtrasChoicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras choices list params +func (o *ExtrasChoicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras choices list params +func (o *ExtrasChoicesListParams) WithHTTPClient(client *http.Client) *ExtrasChoicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras choices list params +func (o *ExtrasChoicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasChoicesListParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_choices_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_choices_list_responses.go new file mode 100644 index 0000000..c4305ab --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_choices_list_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasChoicesListReader is a Reader for the ExtrasChoicesList structure. +type ExtrasChoicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasChoicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasChoicesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasChoicesListOK creates a ExtrasChoicesListOK with default headers values +func NewExtrasChoicesListOK() *ExtrasChoicesListOK { + return &ExtrasChoicesListOK{} +} + +/*ExtrasChoicesListOK handles this case with default header values. + +ExtrasChoicesListOK extras choices list o k +*/ +type ExtrasChoicesListOK struct { +} + +func (o *ExtrasChoicesListOK) Error() string { + return fmt.Sprintf("[GET /extras/_choices/][%d] extrasChoicesListOK ", 200) +} + +func (o *ExtrasChoicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_choices_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_choices_read_parameters.go new file mode 100644 index 0000000..8ccd7a6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_choices_read_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasChoicesReadParams creates a new ExtrasChoicesReadParams object +// with the default values initialized. +func NewExtrasChoicesReadParams() *ExtrasChoicesReadParams { + var () + return &ExtrasChoicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasChoicesReadParamsWithTimeout creates a new ExtrasChoicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasChoicesReadParamsWithTimeout(timeout time.Duration) *ExtrasChoicesReadParams { + var () + return &ExtrasChoicesReadParams{ + + timeout: timeout, + } +} + +// NewExtrasChoicesReadParamsWithContext creates a new ExtrasChoicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasChoicesReadParamsWithContext(ctx context.Context) *ExtrasChoicesReadParams { + var () + return &ExtrasChoicesReadParams{ + + Context: ctx, + } +} + +// NewExtrasChoicesReadParamsWithHTTPClient creates a new ExtrasChoicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasChoicesReadParamsWithHTTPClient(client *http.Client) *ExtrasChoicesReadParams { + var () + return &ExtrasChoicesReadParams{ + HTTPClient: client, + } +} + +/*ExtrasChoicesReadParams contains all the parameters to send to the API endpoint +for the extras choices read operation typically these are written to a http.Request +*/ +type ExtrasChoicesReadParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras choices read params +func (o *ExtrasChoicesReadParams) WithTimeout(timeout time.Duration) *ExtrasChoicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras choices read params +func (o *ExtrasChoicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras choices read params +func (o *ExtrasChoicesReadParams) WithContext(ctx context.Context) *ExtrasChoicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras choices read params +func (o *ExtrasChoicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras choices read params +func (o *ExtrasChoicesReadParams) WithHTTPClient(client *http.Client) *ExtrasChoicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras choices read params +func (o *ExtrasChoicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras choices read params +func (o *ExtrasChoicesReadParams) WithID(id string) *ExtrasChoicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras choices read params +func (o *ExtrasChoicesReadParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasChoicesReadParams) 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", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_choices_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_choices_read_responses.go new file mode 100644 index 0000000..52513cb --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_choices_read_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasChoicesReadReader is a Reader for the ExtrasChoicesRead structure. +type ExtrasChoicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasChoicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasChoicesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasChoicesReadOK creates a ExtrasChoicesReadOK with default headers values +func NewExtrasChoicesReadOK() *ExtrasChoicesReadOK { + return &ExtrasChoicesReadOK{} +} + +/*ExtrasChoicesReadOK handles this case with default header values. + +ExtrasChoicesReadOK extras choices read o k +*/ +type ExtrasChoicesReadOK struct { +} + +func (o *ExtrasChoicesReadOK) Error() string { + return fmt.Sprintf("[GET /extras/_choices/{id}/][%d] extrasChoicesReadOK ", 200) +} + +func (o *ExtrasChoicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_client.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_client.go new file mode 100644 index 0000000..b13df41 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_client.go @@ -0,0 +1,885 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new extras API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for extras API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +ExtrasChoicesList extras choices list API +*/ +func (a *Client) ExtrasChoicesList(params *ExtrasChoicesListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasChoicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasChoicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras__choices_list", + Method: "GET", + PathPattern: "/extras/_choices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasChoicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasChoicesListOK), nil + +} + +/* +ExtrasChoicesRead extras choices read API +*/ +func (a *Client) ExtrasChoicesRead(params *ExtrasChoicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasChoicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasChoicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras__choices_read", + Method: "GET", + PathPattern: "/extras/_choices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasChoicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasChoicesReadOK), nil + +} + +/* +ExtrasExportTemplatesCreate extras export templates create API +*/ +func (a *Client) ExtrasExportTemplatesCreate(params *ExtrasExportTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasExportTemplatesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasExportTemplatesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_export-templates_create", + Method: "POST", + PathPattern: "/extras/export-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasExportTemplatesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasExportTemplatesCreateCreated), nil + +} + +/* +ExtrasExportTemplatesDelete extras export templates delete API +*/ +func (a *Client) ExtrasExportTemplatesDelete(params *ExtrasExportTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasExportTemplatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasExportTemplatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_export-templates_delete", + Method: "DELETE", + PathPattern: "/extras/export-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasExportTemplatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasExportTemplatesDeleteNoContent), nil + +} + +/* +ExtrasExportTemplatesList extras export templates list API +*/ +func (a *Client) ExtrasExportTemplatesList(params *ExtrasExportTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasExportTemplatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasExportTemplatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_export-templates_list", + Method: "GET", + PathPattern: "/extras/export-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasExportTemplatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasExportTemplatesListOK), nil + +} + +/* +ExtrasExportTemplatesPartialUpdate extras export templates partial update API +*/ +func (a *Client) ExtrasExportTemplatesPartialUpdate(params *ExtrasExportTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasExportTemplatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasExportTemplatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_export-templates_partial_update", + Method: "PATCH", + PathPattern: "/extras/export-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasExportTemplatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasExportTemplatesPartialUpdateOK), nil + +} + +/* +ExtrasExportTemplatesRead extras export templates read API +*/ +func (a *Client) ExtrasExportTemplatesRead(params *ExtrasExportTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasExportTemplatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasExportTemplatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_export-templates_read", + Method: "GET", + PathPattern: "/extras/export-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasExportTemplatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasExportTemplatesReadOK), nil + +} + +/* +ExtrasExportTemplatesUpdate extras export templates update API +*/ +func (a *Client) ExtrasExportTemplatesUpdate(params *ExtrasExportTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasExportTemplatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasExportTemplatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_export-templates_update", + Method: "PUT", + PathPattern: "/extras/export-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasExportTemplatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasExportTemplatesUpdateOK), nil + +} + +/* +ExtrasGraphsCreate extras graphs create API +*/ +func (a *Client) ExtrasGraphsCreate(params *ExtrasGraphsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasGraphsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasGraphsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_graphs_create", + Method: "POST", + PathPattern: "/extras/graphs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasGraphsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasGraphsCreateCreated), nil + +} + +/* +ExtrasGraphsDelete extras graphs delete API +*/ +func (a *Client) ExtrasGraphsDelete(params *ExtrasGraphsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasGraphsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasGraphsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_graphs_delete", + Method: "DELETE", + PathPattern: "/extras/graphs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasGraphsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasGraphsDeleteNoContent), nil + +} + +/* +ExtrasGraphsList extras graphs list API +*/ +func (a *Client) ExtrasGraphsList(params *ExtrasGraphsListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasGraphsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasGraphsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_graphs_list", + Method: "GET", + PathPattern: "/extras/graphs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasGraphsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasGraphsListOK), nil + +} + +/* +ExtrasGraphsPartialUpdate extras graphs partial update API +*/ +func (a *Client) ExtrasGraphsPartialUpdate(params *ExtrasGraphsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasGraphsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasGraphsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_graphs_partial_update", + Method: "PATCH", + PathPattern: "/extras/graphs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasGraphsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasGraphsPartialUpdateOK), nil + +} + +/* +ExtrasGraphsRead extras graphs read API +*/ +func (a *Client) ExtrasGraphsRead(params *ExtrasGraphsReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasGraphsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasGraphsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_graphs_read", + Method: "GET", + PathPattern: "/extras/graphs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasGraphsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasGraphsReadOK), nil + +} + +/* +ExtrasGraphsUpdate extras graphs update API +*/ +func (a *Client) ExtrasGraphsUpdate(params *ExtrasGraphsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasGraphsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasGraphsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_graphs_update", + Method: "PUT", + PathPattern: "/extras/graphs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasGraphsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasGraphsUpdateOK), nil + +} + +/* +ExtrasImageAttachmentsCreate extras image attachments create API +*/ +func (a *Client) ExtrasImageAttachmentsCreate(params *ExtrasImageAttachmentsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasImageAttachmentsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasImageAttachmentsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_image-attachments_create", + Method: "POST", + PathPattern: "/extras/image-attachments/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasImageAttachmentsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasImageAttachmentsCreateCreated), nil + +} + +/* +ExtrasImageAttachmentsDelete extras image attachments delete API +*/ +func (a *Client) ExtrasImageAttachmentsDelete(params *ExtrasImageAttachmentsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasImageAttachmentsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasImageAttachmentsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_image-attachments_delete", + Method: "DELETE", + PathPattern: "/extras/image-attachments/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasImageAttachmentsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasImageAttachmentsDeleteNoContent), nil + +} + +/* +ExtrasImageAttachmentsList extras image attachments list API +*/ +func (a *Client) ExtrasImageAttachmentsList(params *ExtrasImageAttachmentsListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasImageAttachmentsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasImageAttachmentsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_image-attachments_list", + Method: "GET", + PathPattern: "/extras/image-attachments/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasImageAttachmentsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasImageAttachmentsListOK), nil + +} + +/* +ExtrasImageAttachmentsPartialUpdate extras image attachments partial update API +*/ +func (a *Client) ExtrasImageAttachmentsPartialUpdate(params *ExtrasImageAttachmentsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasImageAttachmentsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasImageAttachmentsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_image-attachments_partial_update", + Method: "PATCH", + PathPattern: "/extras/image-attachments/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasImageAttachmentsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasImageAttachmentsPartialUpdateOK), nil + +} + +/* +ExtrasImageAttachmentsRead extras image attachments read API +*/ +func (a *Client) ExtrasImageAttachmentsRead(params *ExtrasImageAttachmentsReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasImageAttachmentsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasImageAttachmentsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_image-attachments_read", + Method: "GET", + PathPattern: "/extras/image-attachments/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasImageAttachmentsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasImageAttachmentsReadOK), nil + +} + +/* +ExtrasImageAttachmentsUpdate extras image attachments update API +*/ +func (a *Client) ExtrasImageAttachmentsUpdate(params *ExtrasImageAttachmentsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasImageAttachmentsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasImageAttachmentsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_image-attachments_update", + Method: "PUT", + PathPattern: "/extras/image-attachments/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasImageAttachmentsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasImageAttachmentsUpdateOK), nil + +} + +/* +ExtrasRecentActivityList List all UserActions to provide a log of recent activity. +*/ +func (a *Client) ExtrasRecentActivityList(params *ExtrasRecentActivityListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasRecentActivityListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasRecentActivityListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_recent-activity_list", + Method: "GET", + PathPattern: "/extras/recent-activity/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasRecentActivityListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasRecentActivityListOK), nil + +} + +/* +ExtrasRecentActivityRead List all UserActions to provide a log of recent activity. +*/ +func (a *Client) ExtrasRecentActivityRead(params *ExtrasRecentActivityReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasRecentActivityReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasRecentActivityReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_recent-activity_read", + Method: "GET", + PathPattern: "/extras/recent-activity/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasRecentActivityReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasRecentActivityReadOK), nil + +} + +/* +ExtrasTopologyMapsCreate extras topology maps create API +*/ +func (a *Client) ExtrasTopologyMapsCreate(params *ExtrasTopologyMapsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTopologyMapsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTopologyMapsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_topology-maps_create", + Method: "POST", + PathPattern: "/extras/topology-maps/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTopologyMapsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTopologyMapsCreateCreated), nil + +} + +/* +ExtrasTopologyMapsDelete extras topology maps delete API +*/ +func (a *Client) ExtrasTopologyMapsDelete(params *ExtrasTopologyMapsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTopologyMapsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTopologyMapsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_topology-maps_delete", + Method: "DELETE", + PathPattern: "/extras/topology-maps/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTopologyMapsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTopologyMapsDeleteNoContent), nil + +} + +/* +ExtrasTopologyMapsList extras topology maps list API +*/ +func (a *Client) ExtrasTopologyMapsList(params *ExtrasTopologyMapsListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTopologyMapsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTopologyMapsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_topology-maps_list", + Method: "GET", + PathPattern: "/extras/topology-maps/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTopologyMapsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTopologyMapsListOK), nil + +} + +/* +ExtrasTopologyMapsPartialUpdate extras topology maps partial update API +*/ +func (a *Client) ExtrasTopologyMapsPartialUpdate(params *ExtrasTopologyMapsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTopologyMapsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTopologyMapsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_topology-maps_partial_update", + Method: "PATCH", + PathPattern: "/extras/topology-maps/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTopologyMapsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTopologyMapsPartialUpdateOK), nil + +} + +/* +ExtrasTopologyMapsRead extras topology maps read API +*/ +func (a *Client) ExtrasTopologyMapsRead(params *ExtrasTopologyMapsReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTopologyMapsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTopologyMapsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_topology-maps_read", + Method: "GET", + PathPattern: "/extras/topology-maps/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTopologyMapsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTopologyMapsReadOK), nil + +} + +/* +ExtrasTopologyMapsRender extras topology maps render API +*/ +func (a *Client) ExtrasTopologyMapsRender(params *ExtrasTopologyMapsRenderParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTopologyMapsRenderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTopologyMapsRenderParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_topology-maps_render", + Method: "GET", + PathPattern: "/extras/topology-maps/{id}/render/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTopologyMapsRenderReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTopologyMapsRenderOK), nil + +} + +/* +ExtrasTopologyMapsUpdate extras topology maps update API +*/ +func (a *Client) ExtrasTopologyMapsUpdate(params *ExtrasTopologyMapsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTopologyMapsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTopologyMapsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_topology-maps_update", + Method: "PUT", + PathPattern: "/extras/topology-maps/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTopologyMapsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTopologyMapsUpdateOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_create_parameters.go new file mode 100644 index 0000000..1ae7566 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasExportTemplatesCreateParams creates a new ExtrasExportTemplatesCreateParams object +// with the default values initialized. +func NewExtrasExportTemplatesCreateParams() *ExtrasExportTemplatesCreateParams { + var () + return &ExtrasExportTemplatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasExportTemplatesCreateParamsWithTimeout creates a new ExtrasExportTemplatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasExportTemplatesCreateParamsWithTimeout(timeout time.Duration) *ExtrasExportTemplatesCreateParams { + var () + return &ExtrasExportTemplatesCreateParams{ + + timeout: timeout, + } +} + +// NewExtrasExportTemplatesCreateParamsWithContext creates a new ExtrasExportTemplatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasExportTemplatesCreateParamsWithContext(ctx context.Context) *ExtrasExportTemplatesCreateParams { + var () + return &ExtrasExportTemplatesCreateParams{ + + Context: ctx, + } +} + +// NewExtrasExportTemplatesCreateParamsWithHTTPClient creates a new ExtrasExportTemplatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasExportTemplatesCreateParamsWithHTTPClient(client *http.Client) *ExtrasExportTemplatesCreateParams { + var () + return &ExtrasExportTemplatesCreateParams{ + HTTPClient: client, + } +} + +/*ExtrasExportTemplatesCreateParams contains all the parameters to send to the API endpoint +for the extras export templates create operation typically these are written to a http.Request +*/ +type ExtrasExportTemplatesCreateParams struct { + + /*Data*/ + Data *models.ExportTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras export templates create params +func (o *ExtrasExportTemplatesCreateParams) WithTimeout(timeout time.Duration) *ExtrasExportTemplatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras export templates create params +func (o *ExtrasExportTemplatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras export templates create params +func (o *ExtrasExportTemplatesCreateParams) WithContext(ctx context.Context) *ExtrasExportTemplatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras export templates create params +func (o *ExtrasExportTemplatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras export templates create params +func (o *ExtrasExportTemplatesCreateParams) WithHTTPClient(client *http.Client) *ExtrasExportTemplatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras export templates create params +func (o *ExtrasExportTemplatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras export templates create params +func (o *ExtrasExportTemplatesCreateParams) WithData(data *models.ExportTemplate) *ExtrasExportTemplatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras export templates create params +func (o *ExtrasExportTemplatesCreateParams) SetData(data *models.ExportTemplate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasExportTemplatesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_create_responses.go new file mode 100644 index 0000000..cab6205 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasExportTemplatesCreateReader is a Reader for the ExtrasExportTemplatesCreate structure. +type ExtrasExportTemplatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasExportTemplatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewExtrasExportTemplatesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasExportTemplatesCreateCreated creates a ExtrasExportTemplatesCreateCreated with default headers values +func NewExtrasExportTemplatesCreateCreated() *ExtrasExportTemplatesCreateCreated { + return &ExtrasExportTemplatesCreateCreated{} +} + +/*ExtrasExportTemplatesCreateCreated handles this case with default header values. + +ExtrasExportTemplatesCreateCreated extras export templates create created +*/ +type ExtrasExportTemplatesCreateCreated struct { + Payload *models.ExportTemplate +} + +func (o *ExtrasExportTemplatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /extras/export-templates/][%d] extrasExportTemplatesCreateCreated %+v", 201, o.Payload) +} + +func (o *ExtrasExportTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExportTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_delete_parameters.go new file mode 100644 index 0000000..eed6f13 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasExportTemplatesDeleteParams creates a new ExtrasExportTemplatesDeleteParams object +// with the default values initialized. +func NewExtrasExportTemplatesDeleteParams() *ExtrasExportTemplatesDeleteParams { + var () + return &ExtrasExportTemplatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasExportTemplatesDeleteParamsWithTimeout creates a new ExtrasExportTemplatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasExportTemplatesDeleteParamsWithTimeout(timeout time.Duration) *ExtrasExportTemplatesDeleteParams { + var () + return &ExtrasExportTemplatesDeleteParams{ + + timeout: timeout, + } +} + +// NewExtrasExportTemplatesDeleteParamsWithContext creates a new ExtrasExportTemplatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasExportTemplatesDeleteParamsWithContext(ctx context.Context) *ExtrasExportTemplatesDeleteParams { + var () + return &ExtrasExportTemplatesDeleteParams{ + + Context: ctx, + } +} + +// NewExtrasExportTemplatesDeleteParamsWithHTTPClient creates a new ExtrasExportTemplatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasExportTemplatesDeleteParamsWithHTTPClient(client *http.Client) *ExtrasExportTemplatesDeleteParams { + var () + return &ExtrasExportTemplatesDeleteParams{ + HTTPClient: client, + } +} + +/*ExtrasExportTemplatesDeleteParams contains all the parameters to send to the API endpoint +for the extras export templates delete operation typically these are written to a http.Request +*/ +type ExtrasExportTemplatesDeleteParams struct { + + /*ID + A unique integer value identifying this export template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras export templates delete params +func (o *ExtrasExportTemplatesDeleteParams) WithTimeout(timeout time.Duration) *ExtrasExportTemplatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras export templates delete params +func (o *ExtrasExportTemplatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras export templates delete params +func (o *ExtrasExportTemplatesDeleteParams) WithContext(ctx context.Context) *ExtrasExportTemplatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras export templates delete params +func (o *ExtrasExportTemplatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras export templates delete params +func (o *ExtrasExportTemplatesDeleteParams) WithHTTPClient(client *http.Client) *ExtrasExportTemplatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras export templates delete params +func (o *ExtrasExportTemplatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras export templates delete params +func (o *ExtrasExportTemplatesDeleteParams) WithID(id int64) *ExtrasExportTemplatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras export templates delete params +func (o *ExtrasExportTemplatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasExportTemplatesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_delete_responses.go new file mode 100644 index 0000000..b8e60bb --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasExportTemplatesDeleteReader is a Reader for the ExtrasExportTemplatesDelete structure. +type ExtrasExportTemplatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasExportTemplatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewExtrasExportTemplatesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasExportTemplatesDeleteNoContent creates a ExtrasExportTemplatesDeleteNoContent with default headers values +func NewExtrasExportTemplatesDeleteNoContent() *ExtrasExportTemplatesDeleteNoContent { + return &ExtrasExportTemplatesDeleteNoContent{} +} + +/*ExtrasExportTemplatesDeleteNoContent handles this case with default header values. + +ExtrasExportTemplatesDeleteNoContent extras export templates delete no content +*/ +type ExtrasExportTemplatesDeleteNoContent struct { +} + +func (o *ExtrasExportTemplatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /extras/export-templates/{id}/][%d] extrasExportTemplatesDeleteNoContent ", 204) +} + +func (o *ExtrasExportTemplatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_list_parameters.go new file mode 100644 index 0000000..cdd7e6b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_list_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasExportTemplatesListParams creates a new ExtrasExportTemplatesListParams object +// with the default values initialized. +func NewExtrasExportTemplatesListParams() *ExtrasExportTemplatesListParams { + var () + return &ExtrasExportTemplatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasExportTemplatesListParamsWithTimeout creates a new ExtrasExportTemplatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasExportTemplatesListParamsWithTimeout(timeout time.Duration) *ExtrasExportTemplatesListParams { + var () + return &ExtrasExportTemplatesListParams{ + + timeout: timeout, + } +} + +// NewExtrasExportTemplatesListParamsWithContext creates a new ExtrasExportTemplatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasExportTemplatesListParamsWithContext(ctx context.Context) *ExtrasExportTemplatesListParams { + var () + return &ExtrasExportTemplatesListParams{ + + Context: ctx, + } +} + +// NewExtrasExportTemplatesListParamsWithHTTPClient creates a new ExtrasExportTemplatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasExportTemplatesListParamsWithHTTPClient(client *http.Client) *ExtrasExportTemplatesListParams { + var () + return &ExtrasExportTemplatesListParams{ + HTTPClient: client, + } +} + +/*ExtrasExportTemplatesListParams contains all the parameters to send to the API endpoint +for the extras export templates list operation typically these are written to a http.Request +*/ +type ExtrasExportTemplatesListParams struct { + + /*ContentType*/ + ContentType *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithTimeout(timeout time.Duration) *ExtrasExportTemplatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithContext(ctx context.Context) *ExtrasExportTemplatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithHTTPClient(client *http.Client) *ExtrasExportTemplatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithContentType adds the contentType to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithContentType(contentType *string) *ExtrasExportTemplatesListParams { + o.SetContentType(contentType) + return o +} + +// SetContentType adds the contentType to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetContentType(contentType *string) { + o.ContentType = contentType +} + +// WithLimit adds the limit to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithLimit(limit *int64) *ExtrasExportTemplatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithName(name *string) *ExtrasExportTemplatesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithOffset(offset *int64) *ExtrasExportTemplatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasExportTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_list_responses.go new file mode 100644 index 0000000..f75b54e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasExportTemplatesListReader is a Reader for the ExtrasExportTemplatesList structure. +type ExtrasExportTemplatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasExportTemplatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasExportTemplatesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasExportTemplatesListOK creates a ExtrasExportTemplatesListOK with default headers values +func NewExtrasExportTemplatesListOK() *ExtrasExportTemplatesListOK { + return &ExtrasExportTemplatesListOK{} +} + +/*ExtrasExportTemplatesListOK handles this case with default header values. + +ExtrasExportTemplatesListOK extras export templates list o k +*/ +type ExtrasExportTemplatesListOK struct { + Payload *models.ExtrasExportTemplatesListOKBody +} + +func (o *ExtrasExportTemplatesListOK) Error() string { + return fmt.Sprintf("[GET /extras/export-templates/][%d] extrasExportTemplatesListOK %+v", 200, o.Payload) +} + +func (o *ExtrasExportTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExtrasExportTemplatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_partial_update_parameters.go new file mode 100644 index 0000000..558cdde --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasExportTemplatesPartialUpdateParams creates a new ExtrasExportTemplatesPartialUpdateParams object +// with the default values initialized. +func NewExtrasExportTemplatesPartialUpdateParams() *ExtrasExportTemplatesPartialUpdateParams { + var () + return &ExtrasExportTemplatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasExportTemplatesPartialUpdateParamsWithTimeout creates a new ExtrasExportTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasExportTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *ExtrasExportTemplatesPartialUpdateParams { + var () + return &ExtrasExportTemplatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasExportTemplatesPartialUpdateParamsWithContext creates a new ExtrasExportTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasExportTemplatesPartialUpdateParamsWithContext(ctx context.Context) *ExtrasExportTemplatesPartialUpdateParams { + var () + return &ExtrasExportTemplatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasExportTemplatesPartialUpdateParamsWithHTTPClient creates a new ExtrasExportTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasExportTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *ExtrasExportTemplatesPartialUpdateParams { + var () + return &ExtrasExportTemplatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasExportTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the extras export templates partial update operation typically these are written to a http.Request +*/ +type ExtrasExportTemplatesPartialUpdateParams struct { + + /*Data*/ + Data *models.ExportTemplate + /*ID + A unique integer value identifying this export template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *ExtrasExportTemplatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) WithContext(ctx context.Context) *ExtrasExportTemplatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *ExtrasExportTemplatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) WithData(data *models.ExportTemplate) *ExtrasExportTemplatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) SetData(data *models.ExportTemplate) { + o.Data = data +} + +// WithID adds the id to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) WithID(id int64) *ExtrasExportTemplatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasExportTemplatesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_partial_update_responses.go new file mode 100644 index 0000000..31a4c6d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasExportTemplatesPartialUpdateReader is a Reader for the ExtrasExportTemplatesPartialUpdate structure. +type ExtrasExportTemplatesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasExportTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasExportTemplatesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasExportTemplatesPartialUpdateOK creates a ExtrasExportTemplatesPartialUpdateOK with default headers values +func NewExtrasExportTemplatesPartialUpdateOK() *ExtrasExportTemplatesPartialUpdateOK { + return &ExtrasExportTemplatesPartialUpdateOK{} +} + +/*ExtrasExportTemplatesPartialUpdateOK handles this case with default header values. + +ExtrasExportTemplatesPartialUpdateOK extras export templates partial update o k +*/ +type ExtrasExportTemplatesPartialUpdateOK struct { + Payload *models.ExportTemplate +} + +func (o *ExtrasExportTemplatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /extras/export-templates/{id}/][%d] extrasExportTemplatesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasExportTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExportTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_read_parameters.go new file mode 100644 index 0000000..cb93b03 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasExportTemplatesReadParams creates a new ExtrasExportTemplatesReadParams object +// with the default values initialized. +func NewExtrasExportTemplatesReadParams() *ExtrasExportTemplatesReadParams { + var () + return &ExtrasExportTemplatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasExportTemplatesReadParamsWithTimeout creates a new ExtrasExportTemplatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasExportTemplatesReadParamsWithTimeout(timeout time.Duration) *ExtrasExportTemplatesReadParams { + var () + return &ExtrasExportTemplatesReadParams{ + + timeout: timeout, + } +} + +// NewExtrasExportTemplatesReadParamsWithContext creates a new ExtrasExportTemplatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasExportTemplatesReadParamsWithContext(ctx context.Context) *ExtrasExportTemplatesReadParams { + var () + return &ExtrasExportTemplatesReadParams{ + + Context: ctx, + } +} + +// NewExtrasExportTemplatesReadParamsWithHTTPClient creates a new ExtrasExportTemplatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasExportTemplatesReadParamsWithHTTPClient(client *http.Client) *ExtrasExportTemplatesReadParams { + var () + return &ExtrasExportTemplatesReadParams{ + HTTPClient: client, + } +} + +/*ExtrasExportTemplatesReadParams contains all the parameters to send to the API endpoint +for the extras export templates read operation typically these are written to a http.Request +*/ +type ExtrasExportTemplatesReadParams struct { + + /*ID + A unique integer value identifying this export template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras export templates read params +func (o *ExtrasExportTemplatesReadParams) WithTimeout(timeout time.Duration) *ExtrasExportTemplatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras export templates read params +func (o *ExtrasExportTemplatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras export templates read params +func (o *ExtrasExportTemplatesReadParams) WithContext(ctx context.Context) *ExtrasExportTemplatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras export templates read params +func (o *ExtrasExportTemplatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras export templates read params +func (o *ExtrasExportTemplatesReadParams) WithHTTPClient(client *http.Client) *ExtrasExportTemplatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras export templates read params +func (o *ExtrasExportTemplatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras export templates read params +func (o *ExtrasExportTemplatesReadParams) WithID(id int64) *ExtrasExportTemplatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras export templates read params +func (o *ExtrasExportTemplatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasExportTemplatesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_read_responses.go new file mode 100644 index 0000000..1aab460 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasExportTemplatesReadReader is a Reader for the ExtrasExportTemplatesRead structure. +type ExtrasExportTemplatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasExportTemplatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasExportTemplatesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasExportTemplatesReadOK creates a ExtrasExportTemplatesReadOK with default headers values +func NewExtrasExportTemplatesReadOK() *ExtrasExportTemplatesReadOK { + return &ExtrasExportTemplatesReadOK{} +} + +/*ExtrasExportTemplatesReadOK handles this case with default header values. + +ExtrasExportTemplatesReadOK extras export templates read o k +*/ +type ExtrasExportTemplatesReadOK struct { + Payload *models.ExportTemplate +} + +func (o *ExtrasExportTemplatesReadOK) Error() string { + return fmt.Sprintf("[GET /extras/export-templates/{id}/][%d] extrasExportTemplatesReadOK %+v", 200, o.Payload) +} + +func (o *ExtrasExportTemplatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExportTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_update_parameters.go new file mode 100644 index 0000000..5ce990e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasExportTemplatesUpdateParams creates a new ExtrasExportTemplatesUpdateParams object +// with the default values initialized. +func NewExtrasExportTemplatesUpdateParams() *ExtrasExportTemplatesUpdateParams { + var () + return &ExtrasExportTemplatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasExportTemplatesUpdateParamsWithTimeout creates a new ExtrasExportTemplatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasExportTemplatesUpdateParamsWithTimeout(timeout time.Duration) *ExtrasExportTemplatesUpdateParams { + var () + return &ExtrasExportTemplatesUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasExportTemplatesUpdateParamsWithContext creates a new ExtrasExportTemplatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasExportTemplatesUpdateParamsWithContext(ctx context.Context) *ExtrasExportTemplatesUpdateParams { + var () + return &ExtrasExportTemplatesUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasExportTemplatesUpdateParamsWithHTTPClient creates a new ExtrasExportTemplatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasExportTemplatesUpdateParamsWithHTTPClient(client *http.Client) *ExtrasExportTemplatesUpdateParams { + var () + return &ExtrasExportTemplatesUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasExportTemplatesUpdateParams contains all the parameters to send to the API endpoint +for the extras export templates update operation typically these are written to a http.Request +*/ +type ExtrasExportTemplatesUpdateParams struct { + + /*Data*/ + Data *models.ExportTemplate + /*ID + A unique integer value identifying this export template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) WithTimeout(timeout time.Duration) *ExtrasExportTemplatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) WithContext(ctx context.Context) *ExtrasExportTemplatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) WithHTTPClient(client *http.Client) *ExtrasExportTemplatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) WithData(data *models.ExportTemplate) *ExtrasExportTemplatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) SetData(data *models.ExportTemplate) { + o.Data = data +} + +// WithID adds the id to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) WithID(id int64) *ExtrasExportTemplatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasExportTemplatesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_update_responses.go new file mode 100644 index 0000000..aae72f3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_export_templates_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasExportTemplatesUpdateReader is a Reader for the ExtrasExportTemplatesUpdate structure. +type ExtrasExportTemplatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasExportTemplatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasExportTemplatesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasExportTemplatesUpdateOK creates a ExtrasExportTemplatesUpdateOK with default headers values +func NewExtrasExportTemplatesUpdateOK() *ExtrasExportTemplatesUpdateOK { + return &ExtrasExportTemplatesUpdateOK{} +} + +/*ExtrasExportTemplatesUpdateOK handles this case with default header values. + +ExtrasExportTemplatesUpdateOK extras export templates update o k +*/ +type ExtrasExportTemplatesUpdateOK struct { + Payload *models.ExportTemplate +} + +func (o *ExtrasExportTemplatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /extras/export-templates/{id}/][%d] extrasExportTemplatesUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasExportTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExportTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_create_parameters.go new file mode 100644 index 0000000..7289ea4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasGraphsCreateParams creates a new ExtrasGraphsCreateParams object +// with the default values initialized. +func NewExtrasGraphsCreateParams() *ExtrasGraphsCreateParams { + var () + return &ExtrasGraphsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasGraphsCreateParamsWithTimeout creates a new ExtrasGraphsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasGraphsCreateParamsWithTimeout(timeout time.Duration) *ExtrasGraphsCreateParams { + var () + return &ExtrasGraphsCreateParams{ + + timeout: timeout, + } +} + +// NewExtrasGraphsCreateParamsWithContext creates a new ExtrasGraphsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasGraphsCreateParamsWithContext(ctx context.Context) *ExtrasGraphsCreateParams { + var () + return &ExtrasGraphsCreateParams{ + + Context: ctx, + } +} + +// NewExtrasGraphsCreateParamsWithHTTPClient creates a new ExtrasGraphsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasGraphsCreateParamsWithHTTPClient(client *http.Client) *ExtrasGraphsCreateParams { + var () + return &ExtrasGraphsCreateParams{ + HTTPClient: client, + } +} + +/*ExtrasGraphsCreateParams contains all the parameters to send to the API endpoint +for the extras graphs create operation typically these are written to a http.Request +*/ +type ExtrasGraphsCreateParams struct { + + /*Data*/ + Data *models.WritableGraph + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras graphs create params +func (o *ExtrasGraphsCreateParams) WithTimeout(timeout time.Duration) *ExtrasGraphsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras graphs create params +func (o *ExtrasGraphsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras graphs create params +func (o *ExtrasGraphsCreateParams) WithContext(ctx context.Context) *ExtrasGraphsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras graphs create params +func (o *ExtrasGraphsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras graphs create params +func (o *ExtrasGraphsCreateParams) WithHTTPClient(client *http.Client) *ExtrasGraphsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras graphs create params +func (o *ExtrasGraphsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras graphs create params +func (o *ExtrasGraphsCreateParams) WithData(data *models.WritableGraph) *ExtrasGraphsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras graphs create params +func (o *ExtrasGraphsCreateParams) SetData(data *models.WritableGraph) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasGraphsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_create_responses.go new file mode 100644 index 0000000..8b635f2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasGraphsCreateReader is a Reader for the ExtrasGraphsCreate structure. +type ExtrasGraphsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasGraphsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewExtrasGraphsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasGraphsCreateCreated creates a ExtrasGraphsCreateCreated with default headers values +func NewExtrasGraphsCreateCreated() *ExtrasGraphsCreateCreated { + return &ExtrasGraphsCreateCreated{} +} + +/*ExtrasGraphsCreateCreated handles this case with default header values. + +ExtrasGraphsCreateCreated extras graphs create created +*/ +type ExtrasGraphsCreateCreated struct { + Payload *models.WritableGraph +} + +func (o *ExtrasGraphsCreateCreated) Error() string { + return fmt.Sprintf("[POST /extras/graphs/][%d] extrasGraphsCreateCreated %+v", 201, o.Payload) +} + +func (o *ExtrasGraphsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableGraph) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_delete_parameters.go new file mode 100644 index 0000000..bb969f3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasGraphsDeleteParams creates a new ExtrasGraphsDeleteParams object +// with the default values initialized. +func NewExtrasGraphsDeleteParams() *ExtrasGraphsDeleteParams { + var () + return &ExtrasGraphsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasGraphsDeleteParamsWithTimeout creates a new ExtrasGraphsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasGraphsDeleteParamsWithTimeout(timeout time.Duration) *ExtrasGraphsDeleteParams { + var () + return &ExtrasGraphsDeleteParams{ + + timeout: timeout, + } +} + +// NewExtrasGraphsDeleteParamsWithContext creates a new ExtrasGraphsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasGraphsDeleteParamsWithContext(ctx context.Context) *ExtrasGraphsDeleteParams { + var () + return &ExtrasGraphsDeleteParams{ + + Context: ctx, + } +} + +// NewExtrasGraphsDeleteParamsWithHTTPClient creates a new ExtrasGraphsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasGraphsDeleteParamsWithHTTPClient(client *http.Client) *ExtrasGraphsDeleteParams { + var () + return &ExtrasGraphsDeleteParams{ + HTTPClient: client, + } +} + +/*ExtrasGraphsDeleteParams contains all the parameters to send to the API endpoint +for the extras graphs delete operation typically these are written to a http.Request +*/ +type ExtrasGraphsDeleteParams struct { + + /*ID + A unique integer value identifying this graph. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras graphs delete params +func (o *ExtrasGraphsDeleteParams) WithTimeout(timeout time.Duration) *ExtrasGraphsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras graphs delete params +func (o *ExtrasGraphsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras graphs delete params +func (o *ExtrasGraphsDeleteParams) WithContext(ctx context.Context) *ExtrasGraphsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras graphs delete params +func (o *ExtrasGraphsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras graphs delete params +func (o *ExtrasGraphsDeleteParams) WithHTTPClient(client *http.Client) *ExtrasGraphsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras graphs delete params +func (o *ExtrasGraphsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras graphs delete params +func (o *ExtrasGraphsDeleteParams) WithID(id int64) *ExtrasGraphsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras graphs delete params +func (o *ExtrasGraphsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasGraphsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_delete_responses.go new file mode 100644 index 0000000..3033d7d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasGraphsDeleteReader is a Reader for the ExtrasGraphsDelete structure. +type ExtrasGraphsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasGraphsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewExtrasGraphsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasGraphsDeleteNoContent creates a ExtrasGraphsDeleteNoContent with default headers values +func NewExtrasGraphsDeleteNoContent() *ExtrasGraphsDeleteNoContent { + return &ExtrasGraphsDeleteNoContent{} +} + +/*ExtrasGraphsDeleteNoContent handles this case with default header values. + +ExtrasGraphsDeleteNoContent extras graphs delete no content +*/ +type ExtrasGraphsDeleteNoContent struct { +} + +func (o *ExtrasGraphsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /extras/graphs/{id}/][%d] extrasGraphsDeleteNoContent ", 204) +} + +func (o *ExtrasGraphsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_list_parameters.go new file mode 100644 index 0000000..1e58184 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_list_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasGraphsListParams creates a new ExtrasGraphsListParams object +// with the default values initialized. +func NewExtrasGraphsListParams() *ExtrasGraphsListParams { + var () + return &ExtrasGraphsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasGraphsListParamsWithTimeout creates a new ExtrasGraphsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasGraphsListParamsWithTimeout(timeout time.Duration) *ExtrasGraphsListParams { + var () + return &ExtrasGraphsListParams{ + + timeout: timeout, + } +} + +// NewExtrasGraphsListParamsWithContext creates a new ExtrasGraphsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasGraphsListParamsWithContext(ctx context.Context) *ExtrasGraphsListParams { + var () + return &ExtrasGraphsListParams{ + + Context: ctx, + } +} + +// NewExtrasGraphsListParamsWithHTTPClient creates a new ExtrasGraphsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasGraphsListParamsWithHTTPClient(client *http.Client) *ExtrasGraphsListParams { + var () + return &ExtrasGraphsListParams{ + HTTPClient: client, + } +} + +/*ExtrasGraphsListParams contains all the parameters to send to the API endpoint +for the extras graphs list operation typically these are written to a http.Request +*/ +type ExtrasGraphsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Type*/ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras graphs list params +func (o *ExtrasGraphsListParams) WithTimeout(timeout time.Duration) *ExtrasGraphsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras graphs list params +func (o *ExtrasGraphsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras graphs list params +func (o *ExtrasGraphsListParams) WithContext(ctx context.Context) *ExtrasGraphsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras graphs list params +func (o *ExtrasGraphsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras graphs list params +func (o *ExtrasGraphsListParams) WithHTTPClient(client *http.Client) *ExtrasGraphsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras graphs list params +func (o *ExtrasGraphsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the extras graphs list params +func (o *ExtrasGraphsListParams) WithLimit(limit *int64) *ExtrasGraphsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the extras graphs list params +func (o *ExtrasGraphsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the extras graphs list params +func (o *ExtrasGraphsListParams) WithName(name *string) *ExtrasGraphsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the extras graphs list params +func (o *ExtrasGraphsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the extras graphs list params +func (o *ExtrasGraphsListParams) WithOffset(offset *int64) *ExtrasGraphsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the extras graphs list params +func (o *ExtrasGraphsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithType adds the typeVar to the extras graphs list params +func (o *ExtrasGraphsListParams) WithType(typeVar *string) *ExtrasGraphsListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the extras graphs list params +func (o *ExtrasGraphsListParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasGraphsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_list_responses.go new file mode 100644 index 0000000..193d5b4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasGraphsListReader is a Reader for the ExtrasGraphsList structure. +type ExtrasGraphsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasGraphsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasGraphsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasGraphsListOK creates a ExtrasGraphsListOK with default headers values +func NewExtrasGraphsListOK() *ExtrasGraphsListOK { + return &ExtrasGraphsListOK{} +} + +/*ExtrasGraphsListOK handles this case with default header values. + +ExtrasGraphsListOK extras graphs list o k +*/ +type ExtrasGraphsListOK struct { + Payload *models.ExtrasGraphsListOKBody +} + +func (o *ExtrasGraphsListOK) Error() string { + return fmt.Sprintf("[GET /extras/graphs/][%d] extrasGraphsListOK %+v", 200, o.Payload) +} + +func (o *ExtrasGraphsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExtrasGraphsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_partial_update_parameters.go new file mode 100644 index 0000000..6af233d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasGraphsPartialUpdateParams creates a new ExtrasGraphsPartialUpdateParams object +// with the default values initialized. +func NewExtrasGraphsPartialUpdateParams() *ExtrasGraphsPartialUpdateParams { + var () + return &ExtrasGraphsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasGraphsPartialUpdateParamsWithTimeout creates a new ExtrasGraphsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasGraphsPartialUpdateParamsWithTimeout(timeout time.Duration) *ExtrasGraphsPartialUpdateParams { + var () + return &ExtrasGraphsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasGraphsPartialUpdateParamsWithContext creates a new ExtrasGraphsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasGraphsPartialUpdateParamsWithContext(ctx context.Context) *ExtrasGraphsPartialUpdateParams { + var () + return &ExtrasGraphsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasGraphsPartialUpdateParamsWithHTTPClient creates a new ExtrasGraphsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasGraphsPartialUpdateParamsWithHTTPClient(client *http.Client) *ExtrasGraphsPartialUpdateParams { + var () + return &ExtrasGraphsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasGraphsPartialUpdateParams contains all the parameters to send to the API endpoint +for the extras graphs partial update operation typically these are written to a http.Request +*/ +type ExtrasGraphsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableGraph + /*ID + A unique integer value identifying this graph. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) WithTimeout(timeout time.Duration) *ExtrasGraphsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) WithContext(ctx context.Context) *ExtrasGraphsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) WithHTTPClient(client *http.Client) *ExtrasGraphsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) WithData(data *models.WritableGraph) *ExtrasGraphsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) SetData(data *models.WritableGraph) { + o.Data = data +} + +// WithID adds the id to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) WithID(id int64) *ExtrasGraphsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasGraphsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_partial_update_responses.go new file mode 100644 index 0000000..c69cd4a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasGraphsPartialUpdateReader is a Reader for the ExtrasGraphsPartialUpdate structure. +type ExtrasGraphsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasGraphsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasGraphsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasGraphsPartialUpdateOK creates a ExtrasGraphsPartialUpdateOK with default headers values +func NewExtrasGraphsPartialUpdateOK() *ExtrasGraphsPartialUpdateOK { + return &ExtrasGraphsPartialUpdateOK{} +} + +/*ExtrasGraphsPartialUpdateOK handles this case with default header values. + +ExtrasGraphsPartialUpdateOK extras graphs partial update o k +*/ +type ExtrasGraphsPartialUpdateOK struct { + Payload *models.WritableGraph +} + +func (o *ExtrasGraphsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /extras/graphs/{id}/][%d] extrasGraphsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasGraphsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableGraph) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_read_parameters.go new file mode 100644 index 0000000..d01b844 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasGraphsReadParams creates a new ExtrasGraphsReadParams object +// with the default values initialized. +func NewExtrasGraphsReadParams() *ExtrasGraphsReadParams { + var () + return &ExtrasGraphsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasGraphsReadParamsWithTimeout creates a new ExtrasGraphsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasGraphsReadParamsWithTimeout(timeout time.Duration) *ExtrasGraphsReadParams { + var () + return &ExtrasGraphsReadParams{ + + timeout: timeout, + } +} + +// NewExtrasGraphsReadParamsWithContext creates a new ExtrasGraphsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasGraphsReadParamsWithContext(ctx context.Context) *ExtrasGraphsReadParams { + var () + return &ExtrasGraphsReadParams{ + + Context: ctx, + } +} + +// NewExtrasGraphsReadParamsWithHTTPClient creates a new ExtrasGraphsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasGraphsReadParamsWithHTTPClient(client *http.Client) *ExtrasGraphsReadParams { + var () + return &ExtrasGraphsReadParams{ + HTTPClient: client, + } +} + +/*ExtrasGraphsReadParams contains all the parameters to send to the API endpoint +for the extras graphs read operation typically these are written to a http.Request +*/ +type ExtrasGraphsReadParams struct { + + /*ID + A unique integer value identifying this graph. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras graphs read params +func (o *ExtrasGraphsReadParams) WithTimeout(timeout time.Duration) *ExtrasGraphsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras graphs read params +func (o *ExtrasGraphsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras graphs read params +func (o *ExtrasGraphsReadParams) WithContext(ctx context.Context) *ExtrasGraphsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras graphs read params +func (o *ExtrasGraphsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras graphs read params +func (o *ExtrasGraphsReadParams) WithHTTPClient(client *http.Client) *ExtrasGraphsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras graphs read params +func (o *ExtrasGraphsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras graphs read params +func (o *ExtrasGraphsReadParams) WithID(id int64) *ExtrasGraphsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras graphs read params +func (o *ExtrasGraphsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasGraphsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_read_responses.go new file mode 100644 index 0000000..be6ad49 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasGraphsReadReader is a Reader for the ExtrasGraphsRead structure. +type ExtrasGraphsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasGraphsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasGraphsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasGraphsReadOK creates a ExtrasGraphsReadOK with default headers values +func NewExtrasGraphsReadOK() *ExtrasGraphsReadOK { + return &ExtrasGraphsReadOK{} +} + +/*ExtrasGraphsReadOK handles this case with default header values. + +ExtrasGraphsReadOK extras graphs read o k +*/ +type ExtrasGraphsReadOK struct { + Payload *models.Graph +} + +func (o *ExtrasGraphsReadOK) Error() string { + return fmt.Sprintf("[GET /extras/graphs/{id}/][%d] extrasGraphsReadOK %+v", 200, o.Payload) +} + +func (o *ExtrasGraphsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Graph) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_update_parameters.go new file mode 100644 index 0000000..e7979ba --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasGraphsUpdateParams creates a new ExtrasGraphsUpdateParams object +// with the default values initialized. +func NewExtrasGraphsUpdateParams() *ExtrasGraphsUpdateParams { + var () + return &ExtrasGraphsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasGraphsUpdateParamsWithTimeout creates a new ExtrasGraphsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasGraphsUpdateParamsWithTimeout(timeout time.Duration) *ExtrasGraphsUpdateParams { + var () + return &ExtrasGraphsUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasGraphsUpdateParamsWithContext creates a new ExtrasGraphsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasGraphsUpdateParamsWithContext(ctx context.Context) *ExtrasGraphsUpdateParams { + var () + return &ExtrasGraphsUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasGraphsUpdateParamsWithHTTPClient creates a new ExtrasGraphsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasGraphsUpdateParamsWithHTTPClient(client *http.Client) *ExtrasGraphsUpdateParams { + var () + return &ExtrasGraphsUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasGraphsUpdateParams contains all the parameters to send to the API endpoint +for the extras graphs update operation typically these are written to a http.Request +*/ +type ExtrasGraphsUpdateParams struct { + + /*Data*/ + Data *models.WritableGraph + /*ID + A unique integer value identifying this graph. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) WithTimeout(timeout time.Duration) *ExtrasGraphsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) WithContext(ctx context.Context) *ExtrasGraphsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) WithHTTPClient(client *http.Client) *ExtrasGraphsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) WithData(data *models.WritableGraph) *ExtrasGraphsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) SetData(data *models.WritableGraph) { + o.Data = data +} + +// WithID adds the id to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) WithID(id int64) *ExtrasGraphsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasGraphsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_update_responses.go new file mode 100644 index 0000000..b35e3e0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_graphs_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasGraphsUpdateReader is a Reader for the ExtrasGraphsUpdate structure. +type ExtrasGraphsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasGraphsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasGraphsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasGraphsUpdateOK creates a ExtrasGraphsUpdateOK with default headers values +func NewExtrasGraphsUpdateOK() *ExtrasGraphsUpdateOK { + return &ExtrasGraphsUpdateOK{} +} + +/*ExtrasGraphsUpdateOK handles this case with default header values. + +ExtrasGraphsUpdateOK extras graphs update o k +*/ +type ExtrasGraphsUpdateOK struct { + Payload *models.WritableGraph +} + +func (o *ExtrasGraphsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /extras/graphs/{id}/][%d] extrasGraphsUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasGraphsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableGraph) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_create_parameters.go new file mode 100644 index 0000000..bf1ba48 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasImageAttachmentsCreateParams creates a new ExtrasImageAttachmentsCreateParams object +// with the default values initialized. +func NewExtrasImageAttachmentsCreateParams() *ExtrasImageAttachmentsCreateParams { + var () + return &ExtrasImageAttachmentsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasImageAttachmentsCreateParamsWithTimeout creates a new ExtrasImageAttachmentsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasImageAttachmentsCreateParamsWithTimeout(timeout time.Duration) *ExtrasImageAttachmentsCreateParams { + var () + return &ExtrasImageAttachmentsCreateParams{ + + timeout: timeout, + } +} + +// NewExtrasImageAttachmentsCreateParamsWithContext creates a new ExtrasImageAttachmentsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasImageAttachmentsCreateParamsWithContext(ctx context.Context) *ExtrasImageAttachmentsCreateParams { + var () + return &ExtrasImageAttachmentsCreateParams{ + + Context: ctx, + } +} + +// NewExtrasImageAttachmentsCreateParamsWithHTTPClient creates a new ExtrasImageAttachmentsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasImageAttachmentsCreateParamsWithHTTPClient(client *http.Client) *ExtrasImageAttachmentsCreateParams { + var () + return &ExtrasImageAttachmentsCreateParams{ + HTTPClient: client, + } +} + +/*ExtrasImageAttachmentsCreateParams contains all the parameters to send to the API endpoint +for the extras image attachments create operation typically these are written to a http.Request +*/ +type ExtrasImageAttachmentsCreateParams struct { + + /*Data*/ + Data *models.WritableImageAttachment + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras image attachments create params +func (o *ExtrasImageAttachmentsCreateParams) WithTimeout(timeout time.Duration) *ExtrasImageAttachmentsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras image attachments create params +func (o *ExtrasImageAttachmentsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras image attachments create params +func (o *ExtrasImageAttachmentsCreateParams) WithContext(ctx context.Context) *ExtrasImageAttachmentsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras image attachments create params +func (o *ExtrasImageAttachmentsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras image attachments create params +func (o *ExtrasImageAttachmentsCreateParams) WithHTTPClient(client *http.Client) *ExtrasImageAttachmentsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras image attachments create params +func (o *ExtrasImageAttachmentsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras image attachments create params +func (o *ExtrasImageAttachmentsCreateParams) WithData(data *models.WritableImageAttachment) *ExtrasImageAttachmentsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras image attachments create params +func (o *ExtrasImageAttachmentsCreateParams) SetData(data *models.WritableImageAttachment) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasImageAttachmentsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_create_responses.go new file mode 100644 index 0000000..844cd7e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasImageAttachmentsCreateReader is a Reader for the ExtrasImageAttachmentsCreate structure. +type ExtrasImageAttachmentsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasImageAttachmentsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewExtrasImageAttachmentsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasImageAttachmentsCreateCreated creates a ExtrasImageAttachmentsCreateCreated with default headers values +func NewExtrasImageAttachmentsCreateCreated() *ExtrasImageAttachmentsCreateCreated { + return &ExtrasImageAttachmentsCreateCreated{} +} + +/*ExtrasImageAttachmentsCreateCreated handles this case with default header values. + +ExtrasImageAttachmentsCreateCreated extras image attachments create created +*/ +type ExtrasImageAttachmentsCreateCreated struct { + Payload *models.WritableImageAttachment +} + +func (o *ExtrasImageAttachmentsCreateCreated) Error() string { + return fmt.Sprintf("[POST /extras/image-attachments/][%d] extrasImageAttachmentsCreateCreated %+v", 201, o.Payload) +} + +func (o *ExtrasImageAttachmentsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableImageAttachment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_delete_parameters.go new file mode 100644 index 0000000..11046c6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasImageAttachmentsDeleteParams creates a new ExtrasImageAttachmentsDeleteParams object +// with the default values initialized. +func NewExtrasImageAttachmentsDeleteParams() *ExtrasImageAttachmentsDeleteParams { + var () + return &ExtrasImageAttachmentsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasImageAttachmentsDeleteParamsWithTimeout creates a new ExtrasImageAttachmentsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasImageAttachmentsDeleteParamsWithTimeout(timeout time.Duration) *ExtrasImageAttachmentsDeleteParams { + var () + return &ExtrasImageAttachmentsDeleteParams{ + + timeout: timeout, + } +} + +// NewExtrasImageAttachmentsDeleteParamsWithContext creates a new ExtrasImageAttachmentsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasImageAttachmentsDeleteParamsWithContext(ctx context.Context) *ExtrasImageAttachmentsDeleteParams { + var () + return &ExtrasImageAttachmentsDeleteParams{ + + Context: ctx, + } +} + +// NewExtrasImageAttachmentsDeleteParamsWithHTTPClient creates a new ExtrasImageAttachmentsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasImageAttachmentsDeleteParamsWithHTTPClient(client *http.Client) *ExtrasImageAttachmentsDeleteParams { + var () + return &ExtrasImageAttachmentsDeleteParams{ + HTTPClient: client, + } +} + +/*ExtrasImageAttachmentsDeleteParams contains all the parameters to send to the API endpoint +for the extras image attachments delete operation typically these are written to a http.Request +*/ +type ExtrasImageAttachmentsDeleteParams struct { + + /*ID + A unique integer value identifying this image attachment. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras image attachments delete params +func (o *ExtrasImageAttachmentsDeleteParams) WithTimeout(timeout time.Duration) *ExtrasImageAttachmentsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras image attachments delete params +func (o *ExtrasImageAttachmentsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras image attachments delete params +func (o *ExtrasImageAttachmentsDeleteParams) WithContext(ctx context.Context) *ExtrasImageAttachmentsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras image attachments delete params +func (o *ExtrasImageAttachmentsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras image attachments delete params +func (o *ExtrasImageAttachmentsDeleteParams) WithHTTPClient(client *http.Client) *ExtrasImageAttachmentsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras image attachments delete params +func (o *ExtrasImageAttachmentsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras image attachments delete params +func (o *ExtrasImageAttachmentsDeleteParams) WithID(id int64) *ExtrasImageAttachmentsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras image attachments delete params +func (o *ExtrasImageAttachmentsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasImageAttachmentsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_delete_responses.go new file mode 100644 index 0000000..97c2ea0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasImageAttachmentsDeleteReader is a Reader for the ExtrasImageAttachmentsDelete structure. +type ExtrasImageAttachmentsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasImageAttachmentsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewExtrasImageAttachmentsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasImageAttachmentsDeleteNoContent creates a ExtrasImageAttachmentsDeleteNoContent with default headers values +func NewExtrasImageAttachmentsDeleteNoContent() *ExtrasImageAttachmentsDeleteNoContent { + return &ExtrasImageAttachmentsDeleteNoContent{} +} + +/*ExtrasImageAttachmentsDeleteNoContent handles this case with default header values. + +ExtrasImageAttachmentsDeleteNoContent extras image attachments delete no content +*/ +type ExtrasImageAttachmentsDeleteNoContent struct { +} + +func (o *ExtrasImageAttachmentsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /extras/image-attachments/{id}/][%d] extrasImageAttachmentsDeleteNoContent ", 204) +} + +func (o *ExtrasImageAttachmentsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_list_parameters.go new file mode 100644 index 0000000..93db4f9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_list_parameters.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasImageAttachmentsListParams creates a new ExtrasImageAttachmentsListParams object +// with the default values initialized. +func NewExtrasImageAttachmentsListParams() *ExtrasImageAttachmentsListParams { + var () + return &ExtrasImageAttachmentsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasImageAttachmentsListParamsWithTimeout creates a new ExtrasImageAttachmentsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasImageAttachmentsListParamsWithTimeout(timeout time.Duration) *ExtrasImageAttachmentsListParams { + var () + return &ExtrasImageAttachmentsListParams{ + + timeout: timeout, + } +} + +// NewExtrasImageAttachmentsListParamsWithContext creates a new ExtrasImageAttachmentsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasImageAttachmentsListParamsWithContext(ctx context.Context) *ExtrasImageAttachmentsListParams { + var () + return &ExtrasImageAttachmentsListParams{ + + Context: ctx, + } +} + +// NewExtrasImageAttachmentsListParamsWithHTTPClient creates a new ExtrasImageAttachmentsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasImageAttachmentsListParamsWithHTTPClient(client *http.Client) *ExtrasImageAttachmentsListParams { + var () + return &ExtrasImageAttachmentsListParams{ + HTTPClient: client, + } +} + +/*ExtrasImageAttachmentsListParams contains all the parameters to send to the API endpoint +for the extras image attachments list operation typically these are written to a http.Request +*/ +type ExtrasImageAttachmentsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) WithTimeout(timeout time.Duration) *ExtrasImageAttachmentsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) WithContext(ctx context.Context) *ExtrasImageAttachmentsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) WithHTTPClient(client *http.Client) *ExtrasImageAttachmentsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) WithLimit(limit *int64) *ExtrasImageAttachmentsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) WithOffset(offset *int64) *ExtrasImageAttachmentsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasImageAttachmentsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_list_responses.go new file mode 100644 index 0000000..4448134 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasImageAttachmentsListReader is a Reader for the ExtrasImageAttachmentsList structure. +type ExtrasImageAttachmentsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasImageAttachmentsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasImageAttachmentsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasImageAttachmentsListOK creates a ExtrasImageAttachmentsListOK with default headers values +func NewExtrasImageAttachmentsListOK() *ExtrasImageAttachmentsListOK { + return &ExtrasImageAttachmentsListOK{} +} + +/*ExtrasImageAttachmentsListOK handles this case with default header values. + +ExtrasImageAttachmentsListOK extras image attachments list o k +*/ +type ExtrasImageAttachmentsListOK struct { + Payload *models.ExtrasImageAttachmentsListOKBody +} + +func (o *ExtrasImageAttachmentsListOK) Error() string { + return fmt.Sprintf("[GET /extras/image-attachments/][%d] extrasImageAttachmentsListOK %+v", 200, o.Payload) +} + +func (o *ExtrasImageAttachmentsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExtrasImageAttachmentsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_partial_update_parameters.go new file mode 100644 index 0000000..ff257c2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasImageAttachmentsPartialUpdateParams creates a new ExtrasImageAttachmentsPartialUpdateParams object +// with the default values initialized. +func NewExtrasImageAttachmentsPartialUpdateParams() *ExtrasImageAttachmentsPartialUpdateParams { + var () + return &ExtrasImageAttachmentsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasImageAttachmentsPartialUpdateParamsWithTimeout creates a new ExtrasImageAttachmentsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasImageAttachmentsPartialUpdateParamsWithTimeout(timeout time.Duration) *ExtrasImageAttachmentsPartialUpdateParams { + var () + return &ExtrasImageAttachmentsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasImageAttachmentsPartialUpdateParamsWithContext creates a new ExtrasImageAttachmentsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasImageAttachmentsPartialUpdateParamsWithContext(ctx context.Context) *ExtrasImageAttachmentsPartialUpdateParams { + var () + return &ExtrasImageAttachmentsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasImageAttachmentsPartialUpdateParamsWithHTTPClient creates a new ExtrasImageAttachmentsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasImageAttachmentsPartialUpdateParamsWithHTTPClient(client *http.Client) *ExtrasImageAttachmentsPartialUpdateParams { + var () + return &ExtrasImageAttachmentsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasImageAttachmentsPartialUpdateParams contains all the parameters to send to the API endpoint +for the extras image attachments partial update operation typically these are written to a http.Request +*/ +type ExtrasImageAttachmentsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableImageAttachment + /*ID + A unique integer value identifying this image attachment. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) WithTimeout(timeout time.Duration) *ExtrasImageAttachmentsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) WithContext(ctx context.Context) *ExtrasImageAttachmentsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) WithHTTPClient(client *http.Client) *ExtrasImageAttachmentsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) WithData(data *models.WritableImageAttachment) *ExtrasImageAttachmentsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) SetData(data *models.WritableImageAttachment) { + o.Data = data +} + +// WithID adds the id to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) WithID(id int64) *ExtrasImageAttachmentsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasImageAttachmentsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_partial_update_responses.go new file mode 100644 index 0000000..241f597 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasImageAttachmentsPartialUpdateReader is a Reader for the ExtrasImageAttachmentsPartialUpdate structure. +type ExtrasImageAttachmentsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasImageAttachmentsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasImageAttachmentsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasImageAttachmentsPartialUpdateOK creates a ExtrasImageAttachmentsPartialUpdateOK with default headers values +func NewExtrasImageAttachmentsPartialUpdateOK() *ExtrasImageAttachmentsPartialUpdateOK { + return &ExtrasImageAttachmentsPartialUpdateOK{} +} + +/*ExtrasImageAttachmentsPartialUpdateOK handles this case with default header values. + +ExtrasImageAttachmentsPartialUpdateOK extras image attachments partial update o k +*/ +type ExtrasImageAttachmentsPartialUpdateOK struct { + Payload *models.WritableImageAttachment +} + +func (o *ExtrasImageAttachmentsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /extras/image-attachments/{id}/][%d] extrasImageAttachmentsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasImageAttachmentsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableImageAttachment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_read_parameters.go new file mode 100644 index 0000000..57fab5b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasImageAttachmentsReadParams creates a new ExtrasImageAttachmentsReadParams object +// with the default values initialized. +func NewExtrasImageAttachmentsReadParams() *ExtrasImageAttachmentsReadParams { + var () + return &ExtrasImageAttachmentsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasImageAttachmentsReadParamsWithTimeout creates a new ExtrasImageAttachmentsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasImageAttachmentsReadParamsWithTimeout(timeout time.Duration) *ExtrasImageAttachmentsReadParams { + var () + return &ExtrasImageAttachmentsReadParams{ + + timeout: timeout, + } +} + +// NewExtrasImageAttachmentsReadParamsWithContext creates a new ExtrasImageAttachmentsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasImageAttachmentsReadParamsWithContext(ctx context.Context) *ExtrasImageAttachmentsReadParams { + var () + return &ExtrasImageAttachmentsReadParams{ + + Context: ctx, + } +} + +// NewExtrasImageAttachmentsReadParamsWithHTTPClient creates a new ExtrasImageAttachmentsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasImageAttachmentsReadParamsWithHTTPClient(client *http.Client) *ExtrasImageAttachmentsReadParams { + var () + return &ExtrasImageAttachmentsReadParams{ + HTTPClient: client, + } +} + +/*ExtrasImageAttachmentsReadParams contains all the parameters to send to the API endpoint +for the extras image attachments read operation typically these are written to a http.Request +*/ +type ExtrasImageAttachmentsReadParams struct { + + /*ID + A unique integer value identifying this image attachment. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras image attachments read params +func (o *ExtrasImageAttachmentsReadParams) WithTimeout(timeout time.Duration) *ExtrasImageAttachmentsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras image attachments read params +func (o *ExtrasImageAttachmentsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras image attachments read params +func (o *ExtrasImageAttachmentsReadParams) WithContext(ctx context.Context) *ExtrasImageAttachmentsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras image attachments read params +func (o *ExtrasImageAttachmentsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras image attachments read params +func (o *ExtrasImageAttachmentsReadParams) WithHTTPClient(client *http.Client) *ExtrasImageAttachmentsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras image attachments read params +func (o *ExtrasImageAttachmentsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras image attachments read params +func (o *ExtrasImageAttachmentsReadParams) WithID(id int64) *ExtrasImageAttachmentsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras image attachments read params +func (o *ExtrasImageAttachmentsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasImageAttachmentsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_read_responses.go new file mode 100644 index 0000000..5c57259 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasImageAttachmentsReadReader is a Reader for the ExtrasImageAttachmentsRead structure. +type ExtrasImageAttachmentsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasImageAttachmentsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasImageAttachmentsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasImageAttachmentsReadOK creates a ExtrasImageAttachmentsReadOK with default headers values +func NewExtrasImageAttachmentsReadOK() *ExtrasImageAttachmentsReadOK { + return &ExtrasImageAttachmentsReadOK{} +} + +/*ExtrasImageAttachmentsReadOK handles this case with default header values. + +ExtrasImageAttachmentsReadOK extras image attachments read o k +*/ +type ExtrasImageAttachmentsReadOK struct { + Payload *models.ImageAttachment +} + +func (o *ExtrasImageAttachmentsReadOK) Error() string { + return fmt.Sprintf("[GET /extras/image-attachments/{id}/][%d] extrasImageAttachmentsReadOK %+v", 200, o.Payload) +} + +func (o *ExtrasImageAttachmentsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ImageAttachment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_update_parameters.go new file mode 100644 index 0000000..2e68d13 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasImageAttachmentsUpdateParams creates a new ExtrasImageAttachmentsUpdateParams object +// with the default values initialized. +func NewExtrasImageAttachmentsUpdateParams() *ExtrasImageAttachmentsUpdateParams { + var () + return &ExtrasImageAttachmentsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasImageAttachmentsUpdateParamsWithTimeout creates a new ExtrasImageAttachmentsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasImageAttachmentsUpdateParamsWithTimeout(timeout time.Duration) *ExtrasImageAttachmentsUpdateParams { + var () + return &ExtrasImageAttachmentsUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasImageAttachmentsUpdateParamsWithContext creates a new ExtrasImageAttachmentsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasImageAttachmentsUpdateParamsWithContext(ctx context.Context) *ExtrasImageAttachmentsUpdateParams { + var () + return &ExtrasImageAttachmentsUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasImageAttachmentsUpdateParamsWithHTTPClient creates a new ExtrasImageAttachmentsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasImageAttachmentsUpdateParamsWithHTTPClient(client *http.Client) *ExtrasImageAttachmentsUpdateParams { + var () + return &ExtrasImageAttachmentsUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasImageAttachmentsUpdateParams contains all the parameters to send to the API endpoint +for the extras image attachments update operation typically these are written to a http.Request +*/ +type ExtrasImageAttachmentsUpdateParams struct { + + /*Data*/ + Data *models.WritableImageAttachment + /*ID + A unique integer value identifying this image attachment. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) WithTimeout(timeout time.Duration) *ExtrasImageAttachmentsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) WithContext(ctx context.Context) *ExtrasImageAttachmentsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) WithHTTPClient(client *http.Client) *ExtrasImageAttachmentsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) WithData(data *models.WritableImageAttachment) *ExtrasImageAttachmentsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) SetData(data *models.WritableImageAttachment) { + o.Data = data +} + +// WithID adds the id to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) WithID(id int64) *ExtrasImageAttachmentsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasImageAttachmentsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_update_responses.go new file mode 100644 index 0000000..bfd348d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_image_attachments_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasImageAttachmentsUpdateReader is a Reader for the ExtrasImageAttachmentsUpdate structure. +type ExtrasImageAttachmentsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasImageAttachmentsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasImageAttachmentsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasImageAttachmentsUpdateOK creates a ExtrasImageAttachmentsUpdateOK with default headers values +func NewExtrasImageAttachmentsUpdateOK() *ExtrasImageAttachmentsUpdateOK { + return &ExtrasImageAttachmentsUpdateOK{} +} + +/*ExtrasImageAttachmentsUpdateOK handles this case with default header values. + +ExtrasImageAttachmentsUpdateOK extras image attachments update o k +*/ +type ExtrasImageAttachmentsUpdateOK struct { + Payload *models.WritableImageAttachment +} + +func (o *ExtrasImageAttachmentsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /extras/image-attachments/{id}/][%d] extrasImageAttachmentsUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasImageAttachmentsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableImageAttachment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_recent_activity_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_recent_activity_list_parameters.go new file mode 100644 index 0000000..151f40a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_recent_activity_list_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasRecentActivityListParams creates a new ExtrasRecentActivityListParams object +// with the default values initialized. +func NewExtrasRecentActivityListParams() *ExtrasRecentActivityListParams { + var () + return &ExtrasRecentActivityListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasRecentActivityListParamsWithTimeout creates a new ExtrasRecentActivityListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasRecentActivityListParamsWithTimeout(timeout time.Duration) *ExtrasRecentActivityListParams { + var () + return &ExtrasRecentActivityListParams{ + + timeout: timeout, + } +} + +// NewExtrasRecentActivityListParamsWithContext creates a new ExtrasRecentActivityListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasRecentActivityListParamsWithContext(ctx context.Context) *ExtrasRecentActivityListParams { + var () + return &ExtrasRecentActivityListParams{ + + Context: ctx, + } +} + +// NewExtrasRecentActivityListParamsWithHTTPClient creates a new ExtrasRecentActivityListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasRecentActivityListParamsWithHTTPClient(client *http.Client) *ExtrasRecentActivityListParams { + var () + return &ExtrasRecentActivityListParams{ + HTTPClient: client, + } +} + +/*ExtrasRecentActivityListParams contains all the parameters to send to the API endpoint +for the extras recent activity list operation typically these are written to a http.Request +*/ +type ExtrasRecentActivityListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*User*/ + User *string + /*Username*/ + Username *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) WithTimeout(timeout time.Duration) *ExtrasRecentActivityListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) WithContext(ctx context.Context) *ExtrasRecentActivityListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) WithHTTPClient(client *http.Client) *ExtrasRecentActivityListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) WithLimit(limit *int64) *ExtrasRecentActivityListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) WithOffset(offset *int64) *ExtrasRecentActivityListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithUser adds the user to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) WithUser(user *string) *ExtrasRecentActivityListParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) SetUser(user *string) { + o.User = user +} + +// WithUsername adds the username to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) WithUsername(username *string) *ExtrasRecentActivityListParams { + o.SetUsername(username) + return o +} + +// SetUsername adds the username to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) SetUsername(username *string) { + o.Username = username +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasRecentActivityListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.User != nil { + + // query param user + var qrUser string + if o.User != nil { + qrUser = *o.User + } + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + } + + if o.Username != nil { + + // query param username + var qrUsername string + if o.Username != nil { + qrUsername = *o.Username + } + qUsername := qrUsername + if qUsername != "" { + if err := r.SetQueryParam("username", qUsername); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_recent_activity_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_recent_activity_list_responses.go new file mode 100644 index 0000000..39b2e3c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_recent_activity_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasRecentActivityListReader is a Reader for the ExtrasRecentActivityList structure. +type ExtrasRecentActivityListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasRecentActivityListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasRecentActivityListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasRecentActivityListOK creates a ExtrasRecentActivityListOK with default headers values +func NewExtrasRecentActivityListOK() *ExtrasRecentActivityListOK { + return &ExtrasRecentActivityListOK{} +} + +/*ExtrasRecentActivityListOK handles this case with default header values. + +ExtrasRecentActivityListOK extras recent activity list o k +*/ +type ExtrasRecentActivityListOK struct { + Payload *models.ExtrasRecentActivityListOKBody +} + +func (o *ExtrasRecentActivityListOK) Error() string { + return fmt.Sprintf("[GET /extras/recent-activity/][%d] extrasRecentActivityListOK %+v", 200, o.Payload) +} + +func (o *ExtrasRecentActivityListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExtrasRecentActivityListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_recent_activity_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_recent_activity_read_parameters.go new file mode 100644 index 0000000..036a5df --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_recent_activity_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasRecentActivityReadParams creates a new ExtrasRecentActivityReadParams object +// with the default values initialized. +func NewExtrasRecentActivityReadParams() *ExtrasRecentActivityReadParams { + var () + return &ExtrasRecentActivityReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasRecentActivityReadParamsWithTimeout creates a new ExtrasRecentActivityReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasRecentActivityReadParamsWithTimeout(timeout time.Duration) *ExtrasRecentActivityReadParams { + var () + return &ExtrasRecentActivityReadParams{ + + timeout: timeout, + } +} + +// NewExtrasRecentActivityReadParamsWithContext creates a new ExtrasRecentActivityReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasRecentActivityReadParamsWithContext(ctx context.Context) *ExtrasRecentActivityReadParams { + var () + return &ExtrasRecentActivityReadParams{ + + Context: ctx, + } +} + +// NewExtrasRecentActivityReadParamsWithHTTPClient creates a new ExtrasRecentActivityReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasRecentActivityReadParamsWithHTTPClient(client *http.Client) *ExtrasRecentActivityReadParams { + var () + return &ExtrasRecentActivityReadParams{ + HTTPClient: client, + } +} + +/*ExtrasRecentActivityReadParams contains all the parameters to send to the API endpoint +for the extras recent activity read operation typically these are written to a http.Request +*/ +type ExtrasRecentActivityReadParams struct { + + /*ID + A unique integer value identifying this user action. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras recent activity read params +func (o *ExtrasRecentActivityReadParams) WithTimeout(timeout time.Duration) *ExtrasRecentActivityReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras recent activity read params +func (o *ExtrasRecentActivityReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras recent activity read params +func (o *ExtrasRecentActivityReadParams) WithContext(ctx context.Context) *ExtrasRecentActivityReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras recent activity read params +func (o *ExtrasRecentActivityReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras recent activity read params +func (o *ExtrasRecentActivityReadParams) WithHTTPClient(client *http.Client) *ExtrasRecentActivityReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras recent activity read params +func (o *ExtrasRecentActivityReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras recent activity read params +func (o *ExtrasRecentActivityReadParams) WithID(id int64) *ExtrasRecentActivityReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras recent activity read params +func (o *ExtrasRecentActivityReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasRecentActivityReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_recent_activity_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_recent_activity_read_responses.go new file mode 100644 index 0000000..9efb16a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_recent_activity_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasRecentActivityReadReader is a Reader for the ExtrasRecentActivityRead structure. +type ExtrasRecentActivityReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasRecentActivityReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasRecentActivityReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasRecentActivityReadOK creates a ExtrasRecentActivityReadOK with default headers values +func NewExtrasRecentActivityReadOK() *ExtrasRecentActivityReadOK { + return &ExtrasRecentActivityReadOK{} +} + +/*ExtrasRecentActivityReadOK handles this case with default header values. + +ExtrasRecentActivityReadOK extras recent activity read o k +*/ +type ExtrasRecentActivityReadOK struct { + Payload *models.UserAction +} + +func (o *ExtrasRecentActivityReadOK) Error() string { + return fmt.Sprintf("[GET /extras/recent-activity/{id}/][%d] extrasRecentActivityReadOK %+v", 200, o.Payload) +} + +func (o *ExtrasRecentActivityReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.UserAction) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_create_parameters.go new file mode 100644 index 0000000..0935c06 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasTopologyMapsCreateParams creates a new ExtrasTopologyMapsCreateParams object +// with the default values initialized. +func NewExtrasTopologyMapsCreateParams() *ExtrasTopologyMapsCreateParams { + var () + return &ExtrasTopologyMapsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTopologyMapsCreateParamsWithTimeout creates a new ExtrasTopologyMapsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTopologyMapsCreateParamsWithTimeout(timeout time.Duration) *ExtrasTopologyMapsCreateParams { + var () + return &ExtrasTopologyMapsCreateParams{ + + timeout: timeout, + } +} + +// NewExtrasTopologyMapsCreateParamsWithContext creates a new ExtrasTopologyMapsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTopologyMapsCreateParamsWithContext(ctx context.Context) *ExtrasTopologyMapsCreateParams { + var () + return &ExtrasTopologyMapsCreateParams{ + + Context: ctx, + } +} + +// NewExtrasTopologyMapsCreateParamsWithHTTPClient creates a new ExtrasTopologyMapsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTopologyMapsCreateParamsWithHTTPClient(client *http.Client) *ExtrasTopologyMapsCreateParams { + var () + return &ExtrasTopologyMapsCreateParams{ + HTTPClient: client, + } +} + +/*ExtrasTopologyMapsCreateParams contains all the parameters to send to the API endpoint +for the extras topology maps create operation typically these are written to a http.Request +*/ +type ExtrasTopologyMapsCreateParams struct { + + /*Data*/ + Data *models.WritableTopologyMap + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras topology maps create params +func (o *ExtrasTopologyMapsCreateParams) WithTimeout(timeout time.Duration) *ExtrasTopologyMapsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras topology maps create params +func (o *ExtrasTopologyMapsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras topology maps create params +func (o *ExtrasTopologyMapsCreateParams) WithContext(ctx context.Context) *ExtrasTopologyMapsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras topology maps create params +func (o *ExtrasTopologyMapsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras topology maps create params +func (o *ExtrasTopologyMapsCreateParams) WithHTTPClient(client *http.Client) *ExtrasTopologyMapsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras topology maps create params +func (o *ExtrasTopologyMapsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras topology maps create params +func (o *ExtrasTopologyMapsCreateParams) WithData(data *models.WritableTopologyMap) *ExtrasTopologyMapsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras topology maps create params +func (o *ExtrasTopologyMapsCreateParams) SetData(data *models.WritableTopologyMap) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTopologyMapsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_create_responses.go new file mode 100644 index 0000000..a1b92be --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasTopologyMapsCreateReader is a Reader for the ExtrasTopologyMapsCreate structure. +type ExtrasTopologyMapsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTopologyMapsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewExtrasTopologyMapsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasTopologyMapsCreateCreated creates a ExtrasTopologyMapsCreateCreated with default headers values +func NewExtrasTopologyMapsCreateCreated() *ExtrasTopologyMapsCreateCreated { + return &ExtrasTopologyMapsCreateCreated{} +} + +/*ExtrasTopologyMapsCreateCreated handles this case with default header values. + +ExtrasTopologyMapsCreateCreated extras topology maps create created +*/ +type ExtrasTopologyMapsCreateCreated struct { + Payload *models.WritableTopologyMap +} + +func (o *ExtrasTopologyMapsCreateCreated) Error() string { + return fmt.Sprintf("[POST /extras/topology-maps/][%d] extrasTopologyMapsCreateCreated %+v", 201, o.Payload) +} + +func (o *ExtrasTopologyMapsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableTopologyMap) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_delete_parameters.go new file mode 100644 index 0000000..ddb6ea4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasTopologyMapsDeleteParams creates a new ExtrasTopologyMapsDeleteParams object +// with the default values initialized. +func NewExtrasTopologyMapsDeleteParams() *ExtrasTopologyMapsDeleteParams { + var () + return &ExtrasTopologyMapsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTopologyMapsDeleteParamsWithTimeout creates a new ExtrasTopologyMapsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTopologyMapsDeleteParamsWithTimeout(timeout time.Duration) *ExtrasTopologyMapsDeleteParams { + var () + return &ExtrasTopologyMapsDeleteParams{ + + timeout: timeout, + } +} + +// NewExtrasTopologyMapsDeleteParamsWithContext creates a new ExtrasTopologyMapsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTopologyMapsDeleteParamsWithContext(ctx context.Context) *ExtrasTopologyMapsDeleteParams { + var () + return &ExtrasTopologyMapsDeleteParams{ + + Context: ctx, + } +} + +// NewExtrasTopologyMapsDeleteParamsWithHTTPClient creates a new ExtrasTopologyMapsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTopologyMapsDeleteParamsWithHTTPClient(client *http.Client) *ExtrasTopologyMapsDeleteParams { + var () + return &ExtrasTopologyMapsDeleteParams{ + HTTPClient: client, + } +} + +/*ExtrasTopologyMapsDeleteParams contains all the parameters to send to the API endpoint +for the extras topology maps delete operation typically these are written to a http.Request +*/ +type ExtrasTopologyMapsDeleteParams struct { + + /*ID + A unique integer value identifying this topology map. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras topology maps delete params +func (o *ExtrasTopologyMapsDeleteParams) WithTimeout(timeout time.Duration) *ExtrasTopologyMapsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras topology maps delete params +func (o *ExtrasTopologyMapsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras topology maps delete params +func (o *ExtrasTopologyMapsDeleteParams) WithContext(ctx context.Context) *ExtrasTopologyMapsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras topology maps delete params +func (o *ExtrasTopologyMapsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras topology maps delete params +func (o *ExtrasTopologyMapsDeleteParams) WithHTTPClient(client *http.Client) *ExtrasTopologyMapsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras topology maps delete params +func (o *ExtrasTopologyMapsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras topology maps delete params +func (o *ExtrasTopologyMapsDeleteParams) WithID(id int64) *ExtrasTopologyMapsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras topology maps delete params +func (o *ExtrasTopologyMapsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTopologyMapsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_delete_responses.go new file mode 100644 index 0000000..460e489 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasTopologyMapsDeleteReader is a Reader for the ExtrasTopologyMapsDelete structure. +type ExtrasTopologyMapsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTopologyMapsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewExtrasTopologyMapsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasTopologyMapsDeleteNoContent creates a ExtrasTopologyMapsDeleteNoContent with default headers values +func NewExtrasTopologyMapsDeleteNoContent() *ExtrasTopologyMapsDeleteNoContent { + return &ExtrasTopologyMapsDeleteNoContent{} +} + +/*ExtrasTopologyMapsDeleteNoContent handles this case with default header values. + +ExtrasTopologyMapsDeleteNoContent extras topology maps delete no content +*/ +type ExtrasTopologyMapsDeleteNoContent struct { +} + +func (o *ExtrasTopologyMapsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /extras/topology-maps/{id}/][%d] extrasTopologyMapsDeleteNoContent ", 204) +} + +func (o *ExtrasTopologyMapsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_list_parameters.go new file mode 100644 index 0000000..45c0274 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_list_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasTopologyMapsListParams creates a new ExtrasTopologyMapsListParams object +// with the default values initialized. +func NewExtrasTopologyMapsListParams() *ExtrasTopologyMapsListParams { + var () + return &ExtrasTopologyMapsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTopologyMapsListParamsWithTimeout creates a new ExtrasTopologyMapsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTopologyMapsListParamsWithTimeout(timeout time.Duration) *ExtrasTopologyMapsListParams { + var () + return &ExtrasTopologyMapsListParams{ + + timeout: timeout, + } +} + +// NewExtrasTopologyMapsListParamsWithContext creates a new ExtrasTopologyMapsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTopologyMapsListParamsWithContext(ctx context.Context) *ExtrasTopologyMapsListParams { + var () + return &ExtrasTopologyMapsListParams{ + + Context: ctx, + } +} + +// NewExtrasTopologyMapsListParamsWithHTTPClient creates a new ExtrasTopologyMapsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTopologyMapsListParamsWithHTTPClient(client *http.Client) *ExtrasTopologyMapsListParams { + var () + return &ExtrasTopologyMapsListParams{ + HTTPClient: client, + } +} + +/*ExtrasTopologyMapsListParams contains all the parameters to send to the API endpoint +for the extras topology maps list operation typically these are written to a http.Request +*/ +type ExtrasTopologyMapsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithTimeout(timeout time.Duration) *ExtrasTopologyMapsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithContext(ctx context.Context) *ExtrasTopologyMapsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithHTTPClient(client *http.Client) *ExtrasTopologyMapsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithLimit(limit *int64) *ExtrasTopologyMapsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithName(name *string) *ExtrasTopologyMapsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithOffset(offset *int64) *ExtrasTopologyMapsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSite adds the site to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithSite(site *string) *ExtrasTopologyMapsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithSiteID(siteID *string) *ExtrasTopologyMapsListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithSlug adds the slug to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithSlug(slug *string) *ExtrasTopologyMapsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTopologyMapsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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.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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_list_responses.go new file mode 100644 index 0000000..3ae731d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasTopologyMapsListReader is a Reader for the ExtrasTopologyMapsList structure. +type ExtrasTopologyMapsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTopologyMapsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasTopologyMapsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasTopologyMapsListOK creates a ExtrasTopologyMapsListOK with default headers values +func NewExtrasTopologyMapsListOK() *ExtrasTopologyMapsListOK { + return &ExtrasTopologyMapsListOK{} +} + +/*ExtrasTopologyMapsListOK handles this case with default header values. + +ExtrasTopologyMapsListOK extras topology maps list o k +*/ +type ExtrasTopologyMapsListOK struct { + Payload *models.ExtrasTopologyMapsListOKBody +} + +func (o *ExtrasTopologyMapsListOK) Error() string { + return fmt.Sprintf("[GET /extras/topology-maps/][%d] extrasTopologyMapsListOK %+v", 200, o.Payload) +} + +func (o *ExtrasTopologyMapsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExtrasTopologyMapsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_partial_update_parameters.go new file mode 100644 index 0000000..9aa8287 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasTopologyMapsPartialUpdateParams creates a new ExtrasTopologyMapsPartialUpdateParams object +// with the default values initialized. +func NewExtrasTopologyMapsPartialUpdateParams() *ExtrasTopologyMapsPartialUpdateParams { + var () + return &ExtrasTopologyMapsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTopologyMapsPartialUpdateParamsWithTimeout creates a new ExtrasTopologyMapsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTopologyMapsPartialUpdateParamsWithTimeout(timeout time.Duration) *ExtrasTopologyMapsPartialUpdateParams { + var () + return &ExtrasTopologyMapsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasTopologyMapsPartialUpdateParamsWithContext creates a new ExtrasTopologyMapsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTopologyMapsPartialUpdateParamsWithContext(ctx context.Context) *ExtrasTopologyMapsPartialUpdateParams { + var () + return &ExtrasTopologyMapsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasTopologyMapsPartialUpdateParamsWithHTTPClient creates a new ExtrasTopologyMapsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTopologyMapsPartialUpdateParamsWithHTTPClient(client *http.Client) *ExtrasTopologyMapsPartialUpdateParams { + var () + return &ExtrasTopologyMapsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasTopologyMapsPartialUpdateParams contains all the parameters to send to the API endpoint +for the extras topology maps partial update operation typically these are written to a http.Request +*/ +type ExtrasTopologyMapsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableTopologyMap + /*ID + A unique integer value identifying this topology map. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) WithTimeout(timeout time.Duration) *ExtrasTopologyMapsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) WithContext(ctx context.Context) *ExtrasTopologyMapsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) WithHTTPClient(client *http.Client) *ExtrasTopologyMapsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) WithData(data *models.WritableTopologyMap) *ExtrasTopologyMapsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) SetData(data *models.WritableTopologyMap) { + o.Data = data +} + +// WithID adds the id to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) WithID(id int64) *ExtrasTopologyMapsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTopologyMapsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_partial_update_responses.go new file mode 100644 index 0000000..848f860 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasTopologyMapsPartialUpdateReader is a Reader for the ExtrasTopologyMapsPartialUpdate structure. +type ExtrasTopologyMapsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTopologyMapsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasTopologyMapsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasTopologyMapsPartialUpdateOK creates a ExtrasTopologyMapsPartialUpdateOK with default headers values +func NewExtrasTopologyMapsPartialUpdateOK() *ExtrasTopologyMapsPartialUpdateOK { + return &ExtrasTopologyMapsPartialUpdateOK{} +} + +/*ExtrasTopologyMapsPartialUpdateOK handles this case with default header values. + +ExtrasTopologyMapsPartialUpdateOK extras topology maps partial update o k +*/ +type ExtrasTopologyMapsPartialUpdateOK struct { + Payload *models.WritableTopologyMap +} + +func (o *ExtrasTopologyMapsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /extras/topology-maps/{id}/][%d] extrasTopologyMapsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasTopologyMapsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableTopologyMap) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_read_parameters.go new file mode 100644 index 0000000..5e91d09 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasTopologyMapsReadParams creates a new ExtrasTopologyMapsReadParams object +// with the default values initialized. +func NewExtrasTopologyMapsReadParams() *ExtrasTopologyMapsReadParams { + var () + return &ExtrasTopologyMapsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTopologyMapsReadParamsWithTimeout creates a new ExtrasTopologyMapsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTopologyMapsReadParamsWithTimeout(timeout time.Duration) *ExtrasTopologyMapsReadParams { + var () + return &ExtrasTopologyMapsReadParams{ + + timeout: timeout, + } +} + +// NewExtrasTopologyMapsReadParamsWithContext creates a new ExtrasTopologyMapsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTopologyMapsReadParamsWithContext(ctx context.Context) *ExtrasTopologyMapsReadParams { + var () + return &ExtrasTopologyMapsReadParams{ + + Context: ctx, + } +} + +// NewExtrasTopologyMapsReadParamsWithHTTPClient creates a new ExtrasTopologyMapsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTopologyMapsReadParamsWithHTTPClient(client *http.Client) *ExtrasTopologyMapsReadParams { + var () + return &ExtrasTopologyMapsReadParams{ + HTTPClient: client, + } +} + +/*ExtrasTopologyMapsReadParams contains all the parameters to send to the API endpoint +for the extras topology maps read operation typically these are written to a http.Request +*/ +type ExtrasTopologyMapsReadParams struct { + + /*ID + A unique integer value identifying this topology map. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras topology maps read params +func (o *ExtrasTopologyMapsReadParams) WithTimeout(timeout time.Duration) *ExtrasTopologyMapsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras topology maps read params +func (o *ExtrasTopologyMapsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras topology maps read params +func (o *ExtrasTopologyMapsReadParams) WithContext(ctx context.Context) *ExtrasTopologyMapsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras topology maps read params +func (o *ExtrasTopologyMapsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras topology maps read params +func (o *ExtrasTopologyMapsReadParams) WithHTTPClient(client *http.Client) *ExtrasTopologyMapsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras topology maps read params +func (o *ExtrasTopologyMapsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras topology maps read params +func (o *ExtrasTopologyMapsReadParams) WithID(id int64) *ExtrasTopologyMapsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras topology maps read params +func (o *ExtrasTopologyMapsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTopologyMapsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_read_responses.go new file mode 100644 index 0000000..c9a95f4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasTopologyMapsReadReader is a Reader for the ExtrasTopologyMapsRead structure. +type ExtrasTopologyMapsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTopologyMapsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasTopologyMapsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasTopologyMapsReadOK creates a ExtrasTopologyMapsReadOK with default headers values +func NewExtrasTopologyMapsReadOK() *ExtrasTopologyMapsReadOK { + return &ExtrasTopologyMapsReadOK{} +} + +/*ExtrasTopologyMapsReadOK handles this case with default header values. + +ExtrasTopologyMapsReadOK extras topology maps read o k +*/ +type ExtrasTopologyMapsReadOK struct { + Payload *models.TopologyMap +} + +func (o *ExtrasTopologyMapsReadOK) Error() string { + return fmt.Sprintf("[GET /extras/topology-maps/{id}/][%d] extrasTopologyMapsReadOK %+v", 200, o.Payload) +} + +func (o *ExtrasTopologyMapsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TopologyMap) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_render_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_render_parameters.go new file mode 100644 index 0000000..fd22e4e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_render_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasTopologyMapsRenderParams creates a new ExtrasTopologyMapsRenderParams object +// with the default values initialized. +func NewExtrasTopologyMapsRenderParams() *ExtrasTopologyMapsRenderParams { + var () + return &ExtrasTopologyMapsRenderParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTopologyMapsRenderParamsWithTimeout creates a new ExtrasTopologyMapsRenderParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTopologyMapsRenderParamsWithTimeout(timeout time.Duration) *ExtrasTopologyMapsRenderParams { + var () + return &ExtrasTopologyMapsRenderParams{ + + timeout: timeout, + } +} + +// NewExtrasTopologyMapsRenderParamsWithContext creates a new ExtrasTopologyMapsRenderParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTopologyMapsRenderParamsWithContext(ctx context.Context) *ExtrasTopologyMapsRenderParams { + var () + return &ExtrasTopologyMapsRenderParams{ + + Context: ctx, + } +} + +// NewExtrasTopologyMapsRenderParamsWithHTTPClient creates a new ExtrasTopologyMapsRenderParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTopologyMapsRenderParamsWithHTTPClient(client *http.Client) *ExtrasTopologyMapsRenderParams { + var () + return &ExtrasTopologyMapsRenderParams{ + HTTPClient: client, + } +} + +/*ExtrasTopologyMapsRenderParams contains all the parameters to send to the API endpoint +for the extras topology maps render operation typically these are written to a http.Request +*/ +type ExtrasTopologyMapsRenderParams struct { + + /*ID + A unique integer value identifying this topology map. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras topology maps render params +func (o *ExtrasTopologyMapsRenderParams) WithTimeout(timeout time.Duration) *ExtrasTopologyMapsRenderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras topology maps render params +func (o *ExtrasTopologyMapsRenderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras topology maps render params +func (o *ExtrasTopologyMapsRenderParams) WithContext(ctx context.Context) *ExtrasTopologyMapsRenderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras topology maps render params +func (o *ExtrasTopologyMapsRenderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras topology maps render params +func (o *ExtrasTopologyMapsRenderParams) WithHTTPClient(client *http.Client) *ExtrasTopologyMapsRenderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras topology maps render params +func (o *ExtrasTopologyMapsRenderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras topology maps render params +func (o *ExtrasTopologyMapsRenderParams) WithID(id int64) *ExtrasTopologyMapsRenderParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras topology maps render params +func (o *ExtrasTopologyMapsRenderParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTopologyMapsRenderParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_render_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_render_responses.go new file mode 100644 index 0000000..6d7ebdf --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_render_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasTopologyMapsRenderReader is a Reader for the ExtrasTopologyMapsRender structure. +type ExtrasTopologyMapsRenderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTopologyMapsRenderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasTopologyMapsRenderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasTopologyMapsRenderOK creates a ExtrasTopologyMapsRenderOK with default headers values +func NewExtrasTopologyMapsRenderOK() *ExtrasTopologyMapsRenderOK { + return &ExtrasTopologyMapsRenderOK{} +} + +/*ExtrasTopologyMapsRenderOK handles this case with default header values. + +ExtrasTopologyMapsRenderOK extras topology maps render o k +*/ +type ExtrasTopologyMapsRenderOK struct { + Payload *models.TopologyMap +} + +func (o *ExtrasTopologyMapsRenderOK) Error() string { + return fmt.Sprintf("[GET /extras/topology-maps/{id}/render/][%d] extrasTopologyMapsRenderOK %+v", 200, o.Payload) +} + +func (o *ExtrasTopologyMapsRenderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TopologyMap) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_update_parameters.go new file mode 100644 index 0000000..f671e0f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasTopologyMapsUpdateParams creates a new ExtrasTopologyMapsUpdateParams object +// with the default values initialized. +func NewExtrasTopologyMapsUpdateParams() *ExtrasTopologyMapsUpdateParams { + var () + return &ExtrasTopologyMapsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTopologyMapsUpdateParamsWithTimeout creates a new ExtrasTopologyMapsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTopologyMapsUpdateParamsWithTimeout(timeout time.Duration) *ExtrasTopologyMapsUpdateParams { + var () + return &ExtrasTopologyMapsUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasTopologyMapsUpdateParamsWithContext creates a new ExtrasTopologyMapsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTopologyMapsUpdateParamsWithContext(ctx context.Context) *ExtrasTopologyMapsUpdateParams { + var () + return &ExtrasTopologyMapsUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasTopologyMapsUpdateParamsWithHTTPClient creates a new ExtrasTopologyMapsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTopologyMapsUpdateParamsWithHTTPClient(client *http.Client) *ExtrasTopologyMapsUpdateParams { + var () + return &ExtrasTopologyMapsUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasTopologyMapsUpdateParams contains all the parameters to send to the API endpoint +for the extras topology maps update operation typically these are written to a http.Request +*/ +type ExtrasTopologyMapsUpdateParams struct { + + /*Data*/ + Data *models.WritableTopologyMap + /*ID + A unique integer value identifying this topology map. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) WithTimeout(timeout time.Duration) *ExtrasTopologyMapsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) WithContext(ctx context.Context) *ExtrasTopologyMapsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) WithHTTPClient(client *http.Client) *ExtrasTopologyMapsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) WithData(data *models.WritableTopologyMap) *ExtrasTopologyMapsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) SetData(data *models.WritableTopologyMap) { + o.Data = data +} + +// WithID adds the id to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) WithID(id int64) *ExtrasTopologyMapsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTopologyMapsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_update_responses.go new file mode 100644 index 0000000..167ae82 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/extras/extras_topology_maps_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 extras + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasTopologyMapsUpdateReader is a Reader for the ExtrasTopologyMapsUpdate structure. +type ExtrasTopologyMapsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTopologyMapsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasTopologyMapsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasTopologyMapsUpdateOK creates a ExtrasTopologyMapsUpdateOK with default headers values +func NewExtrasTopologyMapsUpdateOK() *ExtrasTopologyMapsUpdateOK { + return &ExtrasTopologyMapsUpdateOK{} +} + +/*ExtrasTopologyMapsUpdateOK handles this case with default header values. + +ExtrasTopologyMapsUpdateOK extras topology maps update o k +*/ +type ExtrasTopologyMapsUpdateOK struct { + Payload *models.WritableTopologyMap +} + +func (o *ExtrasTopologyMapsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /extras/topology-maps/{id}/][%d] extrasTopologyMapsUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasTopologyMapsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableTopologyMap) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_am_client.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_am_client.go new file mode 100644 index 0000000..a3a36f4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_am_client.go @@ -0,0 +1,1788 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new ipam API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for ipam API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +IPAMChoicesList ipam choices list API +*/ +func (a *Client) IPAMChoicesList(params *IPAMChoicesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMChoicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMChoicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam__choices_list", + Method: "GET", + PathPattern: "/ipam/_choices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMChoicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMChoicesListOK), nil + +} + +/* +IPAMChoicesRead ipam choices read API +*/ +func (a *Client) IPAMChoicesRead(params *IPAMChoicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMChoicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMChoicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam__choices_read", + Method: "GET", + PathPattern: "/ipam/_choices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMChoicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMChoicesReadOK), nil + +} + +/* +IPAMAggregatesCreate ipam aggregates create API +*/ +func (a *Client) IPAMAggregatesCreate(params *IPAMAggregatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMAggregatesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMAggregatesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_aggregates_create", + Method: "POST", + PathPattern: "/ipam/aggregates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMAggregatesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMAggregatesCreateCreated), nil + +} + +/* +IPAMAggregatesDelete ipam aggregates delete API +*/ +func (a *Client) IPAMAggregatesDelete(params *IPAMAggregatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMAggregatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMAggregatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_aggregates_delete", + Method: "DELETE", + PathPattern: "/ipam/aggregates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMAggregatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMAggregatesDeleteNoContent), nil + +} + +/* +IPAMAggregatesList ipam aggregates list API +*/ +func (a *Client) IPAMAggregatesList(params *IPAMAggregatesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMAggregatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMAggregatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_aggregates_list", + Method: "GET", + PathPattern: "/ipam/aggregates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMAggregatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMAggregatesListOK), nil + +} + +/* +IPAMAggregatesPartialUpdate ipam aggregates partial update API +*/ +func (a *Client) IPAMAggregatesPartialUpdate(params *IPAMAggregatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMAggregatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMAggregatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_aggregates_partial_update", + Method: "PATCH", + PathPattern: "/ipam/aggregates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMAggregatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMAggregatesPartialUpdateOK), nil + +} + +/* +IPAMAggregatesRead ipam aggregates read API +*/ +func (a *Client) IPAMAggregatesRead(params *IPAMAggregatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMAggregatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMAggregatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_aggregates_read", + Method: "GET", + PathPattern: "/ipam/aggregates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMAggregatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMAggregatesReadOK), nil + +} + +/* +IPAMAggregatesUpdate ipam aggregates update API +*/ +func (a *Client) IPAMAggregatesUpdate(params *IPAMAggregatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMAggregatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMAggregatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_aggregates_update", + Method: "PUT", + PathPattern: "/ipam/aggregates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMAggregatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMAggregatesUpdateOK), nil + +} + +/* +IPAMIPAddressesCreate ipam ip addresses create API +*/ +func (a *Client) IPAMIPAddressesCreate(params *IPAMIPAddressesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMIPAddressesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMIPAddressesCreateParams() + } + + result, err := a.transport.Submit(&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, + }) + if err != nil { + return nil, err + } + return result.(*IPAMIPAddressesCreateCreated), nil + +} + +/* +IPAMIPAddressesDelete ipam ip addresses delete API +*/ +func (a *Client) IPAMIPAddressesDelete(params *IPAMIPAddressesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMIPAddressesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMIPAddressesDeleteParams() + } + + result, err := a.transport.Submit(&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, + }) + if err != nil { + return nil, err + } + return result.(*IPAMIPAddressesDeleteNoContent), nil + +} + +/* +IPAMIPAddressesList ipam ip addresses list API +*/ +func (a *Client) IPAMIPAddressesList(params *IPAMIPAddressesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMIPAddressesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMIPAddressesListParams() + } + + result, err := a.transport.Submit(&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, + }) + if err != nil { + return nil, err + } + return result.(*IPAMIPAddressesListOK), nil + +} + +/* +IPAMIPAddressesPartialUpdate ipam ip addresses partial update API +*/ +func (a *Client) IPAMIPAddressesPartialUpdate(params *IPAMIPAddressesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMIPAddressesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMIPAddressesPartialUpdateParams() + } + + result, err := a.transport.Submit(&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, + }) + if err != nil { + return nil, err + } + return result.(*IPAMIPAddressesPartialUpdateOK), nil + +} + +/* +IPAMIPAddressesRead ipam ip addresses read API +*/ +func (a *Client) IPAMIPAddressesRead(params *IPAMIPAddressesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMIPAddressesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMIPAddressesReadParams() + } + + result, err := a.transport.Submit(&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, + }) + if err != nil { + return nil, err + } + return result.(*IPAMIPAddressesReadOK), nil + +} + +/* +IPAMIPAddressesUpdate ipam ip addresses update API +*/ +func (a *Client) IPAMIPAddressesUpdate(params *IPAMIPAddressesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMIPAddressesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMIPAddressesUpdateParams() + } + + result, err := a.transport.Submit(&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, + }) + if err != nil { + return nil, err + } + return result.(*IPAMIPAddressesUpdateOK), nil + +} + +/* +IPAMPrefixesAvailableIpsCreate A convenience method for returning available IP addresses within a prefix. 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. +*/ +func (a *Client) IPAMPrefixesAvailableIpsCreate(params *IPAMPrefixesAvailableIpsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesAvailableIpsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesAvailableIpsCreateParams() + } + + result, err := a.transport.Submit(&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, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesAvailableIpsCreateCreated), nil + +} + +/* +IPAMPrefixesAvailableIpsRead A convenience method for returning available IP addresses within a prefix. 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. +*/ +func (a *Client) IPAMPrefixesAvailableIpsRead(params *IPAMPrefixesAvailableIpsReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesAvailableIpsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesAvailableIpsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_available-ips_read", + Method: "GET", + PathPattern: "/ipam/prefixes/{id}/available-ips/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesAvailableIpsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesAvailableIpsReadOK), nil + +} + +/* +IPAMPrefixesAvailablePrefixesCreate A convenience method for returning available child prefixes within a parent. +*/ +func (a *Client) IPAMPrefixesAvailablePrefixesCreate(params *IPAMPrefixesAvailablePrefixesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesAvailablePrefixesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesAvailablePrefixesCreateParams() + } + + result, err := a.transport.Submit(&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, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesAvailablePrefixesCreateCreated), nil + +} + +/* +IPAMPrefixesAvailablePrefixesRead A convenience method for returning available child prefixes within a parent. +*/ +func (a *Client) IPAMPrefixesAvailablePrefixesRead(params *IPAMPrefixesAvailablePrefixesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesAvailablePrefixesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesAvailablePrefixesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_available-prefixes_read", + 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}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesAvailablePrefixesReadOK), nil + +} + +/* +IPAMPrefixesCreate ipam prefixes create API +*/ +func (a *Client) IPAMPrefixesCreate(params *IPAMPrefixesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_create", + Method: "POST", + PathPattern: "/ipam/prefixes/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesCreateCreated), nil + +} + +/* +IPAMPrefixesDelete ipam prefixes delete API +*/ +func (a *Client) IPAMPrefixesDelete(params *IPAMPrefixesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_delete", + Method: "DELETE", + PathPattern: "/ipam/prefixes/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesDeleteNoContent), nil + +} + +/* +IPAMPrefixesList ipam prefixes list API +*/ +func (a *Client) IPAMPrefixesList(params *IPAMPrefixesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_list", + Method: "GET", + PathPattern: "/ipam/prefixes/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesListOK), nil + +} + +/* +IPAMPrefixesPartialUpdate ipam prefixes partial update API +*/ +func (a *Client) IPAMPrefixesPartialUpdate(params *IPAMPrefixesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_partial_update", + Method: "PATCH", + PathPattern: "/ipam/prefixes/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesPartialUpdateOK), nil + +} + +/* +IPAMPrefixesRead ipam prefixes read API +*/ +func (a *Client) IPAMPrefixesRead(params *IPAMPrefixesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_read", + Method: "GET", + PathPattern: "/ipam/prefixes/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesReadOK), nil + +} + +/* +IPAMPrefixesUpdate ipam prefixes update API +*/ +func (a *Client) IPAMPrefixesUpdate(params *IPAMPrefixesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_update", + Method: "PUT", + PathPattern: "/ipam/prefixes/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesUpdateOK), nil + +} + +/* +IPAMRirsCreate ipam rirs create API +*/ +func (a *Client) IPAMRirsCreate(params *IPAMRirsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRirsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRirsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_rirs_create", + Method: "POST", + PathPattern: "/ipam/rirs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRirsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRirsCreateCreated), nil + +} + +/* +IPAMRirsDelete ipam rirs delete API +*/ +func (a *Client) IPAMRirsDelete(params *IPAMRirsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRirsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRirsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_rirs_delete", + Method: "DELETE", + PathPattern: "/ipam/rirs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRirsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRirsDeleteNoContent), nil + +} + +/* +IPAMRirsList ipam rirs list API +*/ +func (a *Client) IPAMRirsList(params *IPAMRirsListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRirsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRirsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_rirs_list", + Method: "GET", + PathPattern: "/ipam/rirs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRirsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRirsListOK), nil + +} + +/* +IPAMRirsPartialUpdate ipam rirs partial update API +*/ +func (a *Client) IPAMRirsPartialUpdate(params *IPAMRirsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRirsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRirsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_rirs_partial_update", + Method: "PATCH", + PathPattern: "/ipam/rirs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRirsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRirsPartialUpdateOK), nil + +} + +/* +IPAMRirsRead ipam rirs read API +*/ +func (a *Client) IPAMRirsRead(params *IPAMRirsReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRirsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRirsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_rirs_read", + Method: "GET", + PathPattern: "/ipam/rirs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRirsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRirsReadOK), nil + +} + +/* +IPAMRirsUpdate ipam rirs update API +*/ +func (a *Client) IPAMRirsUpdate(params *IPAMRirsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRirsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRirsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_rirs_update", + Method: "PUT", + PathPattern: "/ipam/rirs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRirsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRirsUpdateOK), nil + +} + +/* +IPAMRolesCreate ipam roles create API +*/ +func (a *Client) IPAMRolesCreate(params *IPAMRolesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRolesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRolesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_roles_create", + Method: "POST", + PathPattern: "/ipam/roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRolesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRolesCreateCreated), nil + +} + +/* +IPAMRolesDelete ipam roles delete API +*/ +func (a *Client) IPAMRolesDelete(params *IPAMRolesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRolesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRolesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_roles_delete", + Method: "DELETE", + PathPattern: "/ipam/roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRolesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRolesDeleteNoContent), nil + +} + +/* +IPAMRolesList ipam roles list API +*/ +func (a *Client) IPAMRolesList(params *IPAMRolesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRolesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRolesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_roles_list", + Method: "GET", + PathPattern: "/ipam/roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRolesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRolesListOK), nil + +} + +/* +IPAMRolesPartialUpdate ipam roles partial update API +*/ +func (a *Client) IPAMRolesPartialUpdate(params *IPAMRolesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRolesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRolesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_roles_partial_update", + Method: "PATCH", + PathPattern: "/ipam/roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRolesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRolesPartialUpdateOK), nil + +} + +/* +IPAMRolesRead ipam roles read API +*/ +func (a *Client) IPAMRolesRead(params *IPAMRolesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRolesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRolesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_roles_read", + Method: "GET", + PathPattern: "/ipam/roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRolesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRolesReadOK), nil + +} + +/* +IPAMRolesUpdate ipam roles update API +*/ +func (a *Client) IPAMRolesUpdate(params *IPAMRolesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRolesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRolesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_roles_update", + Method: "PUT", + PathPattern: "/ipam/roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRolesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRolesUpdateOK), nil + +} + +/* +IPAMServicesCreate ipam services create API +*/ +func (a *Client) IPAMServicesCreate(params *IPAMServicesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMServicesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMServicesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_services_create", + Method: "POST", + PathPattern: "/ipam/services/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMServicesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMServicesCreateCreated), nil + +} + +/* +IPAMServicesDelete ipam services delete API +*/ +func (a *Client) IPAMServicesDelete(params *IPAMServicesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMServicesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMServicesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_services_delete", + Method: "DELETE", + PathPattern: "/ipam/services/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMServicesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMServicesDeleteNoContent), nil + +} + +/* +IPAMServicesList ipam services list API +*/ +func (a *Client) IPAMServicesList(params *IPAMServicesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMServicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMServicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_services_list", + Method: "GET", + PathPattern: "/ipam/services/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMServicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMServicesListOK), nil + +} + +/* +IPAMServicesPartialUpdate ipam services partial update API +*/ +func (a *Client) IPAMServicesPartialUpdate(params *IPAMServicesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMServicesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMServicesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_services_partial_update", + Method: "PATCH", + PathPattern: "/ipam/services/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMServicesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMServicesPartialUpdateOK), nil + +} + +/* +IPAMServicesRead ipam services read API +*/ +func (a *Client) IPAMServicesRead(params *IPAMServicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMServicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMServicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_services_read", + Method: "GET", + PathPattern: "/ipam/services/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMServicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMServicesReadOK), nil + +} + +/* +IPAMServicesUpdate ipam services update API +*/ +func (a *Client) IPAMServicesUpdate(params *IPAMServicesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMServicesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMServicesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_services_update", + Method: "PUT", + PathPattern: "/ipam/services/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMServicesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMServicesUpdateOK), nil + +} + +/* +IPAMVlanGroupsCreate ipam vlan groups create API +*/ +func (a *Client) IPAMVlanGroupsCreate(params *IPAMVlanGroupsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlanGroupsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlanGroupsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlan-groups_create", + Method: "POST", + PathPattern: "/ipam/vlan-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlanGroupsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlanGroupsCreateCreated), nil + +} + +/* +IPAMVlanGroupsDelete ipam vlan groups delete API +*/ +func (a *Client) IPAMVlanGroupsDelete(params *IPAMVlanGroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlanGroupsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlanGroupsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlan-groups_delete", + Method: "DELETE", + PathPattern: "/ipam/vlan-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlanGroupsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlanGroupsDeleteNoContent), nil + +} + +/* +IPAMVlanGroupsList ipam vlan groups list API +*/ +func (a *Client) IPAMVlanGroupsList(params *IPAMVlanGroupsListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlanGroupsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlanGroupsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlan-groups_list", + Method: "GET", + PathPattern: "/ipam/vlan-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlanGroupsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlanGroupsListOK), nil + +} + +/* +IPAMVlanGroupsPartialUpdate ipam vlan groups partial update API +*/ +func (a *Client) IPAMVlanGroupsPartialUpdate(params *IPAMVlanGroupsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlanGroupsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlanGroupsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlan-groups_partial_update", + Method: "PATCH", + PathPattern: "/ipam/vlan-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlanGroupsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlanGroupsPartialUpdateOK), nil + +} + +/* +IPAMVlanGroupsRead ipam vlan groups read API +*/ +func (a *Client) IPAMVlanGroupsRead(params *IPAMVlanGroupsReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlanGroupsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlanGroupsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlan-groups_read", + Method: "GET", + PathPattern: "/ipam/vlan-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlanGroupsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlanGroupsReadOK), nil + +} + +/* +IPAMVlanGroupsUpdate ipam vlan groups update API +*/ +func (a *Client) IPAMVlanGroupsUpdate(params *IPAMVlanGroupsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlanGroupsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlanGroupsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlan-groups_update", + Method: "PUT", + PathPattern: "/ipam/vlan-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlanGroupsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlanGroupsUpdateOK), nil + +} + +/* +IPAMVlansCreate ipam vlans create API +*/ +func (a *Client) IPAMVlansCreate(params *IPAMVlansCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlansCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlansCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlans_create", + Method: "POST", + PathPattern: "/ipam/vlans/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlansCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlansCreateCreated), nil + +} + +/* +IPAMVlansDelete ipam vlans delete API +*/ +func (a *Client) IPAMVlansDelete(params *IPAMVlansDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlansDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlansDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlans_delete", + Method: "DELETE", + PathPattern: "/ipam/vlans/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlansDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlansDeleteNoContent), nil + +} + +/* +IPAMVlansList ipam vlans list API +*/ +func (a *Client) IPAMVlansList(params *IPAMVlansListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlansListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlansListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlans_list", + Method: "GET", + PathPattern: "/ipam/vlans/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlansListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlansListOK), nil + +} + +/* +IPAMVlansPartialUpdate ipam vlans partial update API +*/ +func (a *Client) IPAMVlansPartialUpdate(params *IPAMVlansPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlansPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlansPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlans_partial_update", + Method: "PATCH", + PathPattern: "/ipam/vlans/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlansPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlansPartialUpdateOK), nil + +} + +/* +IPAMVlansRead ipam vlans read API +*/ +func (a *Client) IPAMVlansRead(params *IPAMVlansReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlansReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlansReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlans_read", + Method: "GET", + PathPattern: "/ipam/vlans/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlansReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlansReadOK), nil + +} + +/* +IPAMVlansUpdate ipam vlans update API +*/ +func (a *Client) IPAMVlansUpdate(params *IPAMVlansUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlansUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlansUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlans_update", + Method: "PUT", + PathPattern: "/ipam/vlans/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlansUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlansUpdateOK), nil + +} + +/* +IPAMVrfsCreate ipam vrfs create API +*/ +func (a *Client) IPAMVrfsCreate(params *IPAMVrfsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVrfsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVrfsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vrfs_create", + Method: "POST", + PathPattern: "/ipam/vrfs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVrfsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVrfsCreateCreated), nil + +} + +/* +IPAMVrfsDelete ipam vrfs delete API +*/ +func (a *Client) IPAMVrfsDelete(params *IPAMVrfsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVrfsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVrfsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vrfs_delete", + Method: "DELETE", + PathPattern: "/ipam/vrfs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVrfsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVrfsDeleteNoContent), nil + +} + +/* +IPAMVrfsList ipam vrfs list API +*/ +func (a *Client) IPAMVrfsList(params *IPAMVrfsListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVrfsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVrfsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vrfs_list", + Method: "GET", + PathPattern: "/ipam/vrfs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVrfsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVrfsListOK), nil + +} + +/* +IPAMVrfsPartialUpdate ipam vrfs partial update API +*/ +func (a *Client) IPAMVrfsPartialUpdate(params *IPAMVrfsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVrfsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVrfsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vrfs_partial_update", + Method: "PATCH", + PathPattern: "/ipam/vrfs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVrfsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVrfsPartialUpdateOK), nil + +} + +/* +IPAMVrfsRead ipam vrfs read API +*/ +func (a *Client) IPAMVrfsRead(params *IPAMVrfsReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVrfsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVrfsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vrfs_read", + Method: "GET", + PathPattern: "/ipam/vrfs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVrfsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVrfsReadOK), nil + +} + +/* +IPAMVrfsUpdate ipam vrfs update API +*/ +func (a *Client) IPAMVrfsUpdate(params *IPAMVrfsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVrfsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVrfsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vrfs_update", + Method: "PUT", + PathPattern: "/ipam/vrfs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVrfsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVrfsUpdateOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_create_parameters.go new file mode 100644 index 0000000..15d9788 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMAggregatesCreateParams creates a new IPAMAggregatesCreateParams object +// with the default values initialized. +func NewIPAMAggregatesCreateParams() *IPAMAggregatesCreateParams { + var () + return &IPAMAggregatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMAggregatesCreateParamsWithTimeout creates a new IPAMAggregatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMAggregatesCreateParamsWithTimeout(timeout time.Duration) *IPAMAggregatesCreateParams { + var () + return &IPAMAggregatesCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMAggregatesCreateParamsWithContext creates a new IPAMAggregatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMAggregatesCreateParamsWithContext(ctx context.Context) *IPAMAggregatesCreateParams { + var () + return &IPAMAggregatesCreateParams{ + + Context: ctx, + } +} + +// NewIPAMAggregatesCreateParamsWithHTTPClient creates a new IPAMAggregatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMAggregatesCreateParamsWithHTTPClient(client *http.Client) *IPAMAggregatesCreateParams { + var () + return &IPAMAggregatesCreateParams{ + HTTPClient: client, + } +} + +/*IPAMAggregatesCreateParams contains all the parameters to send to the API endpoint +for the ipam aggregates create operation typically these are written to a http.Request +*/ +type IPAMAggregatesCreateParams struct { + + /*Data*/ + Data *models.WritableAggregate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam aggregates create params +func (o *IPAMAggregatesCreateParams) WithTimeout(timeout time.Duration) *IPAMAggregatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam aggregates create params +func (o *IPAMAggregatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam aggregates create params +func (o *IPAMAggregatesCreateParams) WithContext(ctx context.Context) *IPAMAggregatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam aggregates create params +func (o *IPAMAggregatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam aggregates create params +func (o *IPAMAggregatesCreateParams) WithHTTPClient(client *http.Client) *IPAMAggregatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam aggregates create params +func (o *IPAMAggregatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam aggregates create params +func (o *IPAMAggregatesCreateParams) WithData(data *models.WritableAggregate) *IPAMAggregatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam aggregates create params +func (o *IPAMAggregatesCreateParams) SetData(data *models.WritableAggregate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMAggregatesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_create_responses.go new file mode 100644 index 0000000..c4f82dd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMAggregatesCreateReader is a Reader for the IPAMAggregatesCreate structure. +type IPAMAggregatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMAggregatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMAggregatesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMAggregatesCreateCreated creates a IPAMAggregatesCreateCreated with default headers values +func NewIPAMAggregatesCreateCreated() *IPAMAggregatesCreateCreated { + return &IPAMAggregatesCreateCreated{} +} + +/*IPAMAggregatesCreateCreated handles this case with default header values. + +IPAMAggregatesCreateCreated ipam aggregates create created +*/ +type IPAMAggregatesCreateCreated struct { + Payload *models.WritableAggregate +} + +func (o *IPAMAggregatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/aggregates/][%d] ipamAggregatesCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMAggregatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableAggregate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_delete_parameters.go new file mode 100644 index 0000000..da25171 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMAggregatesDeleteParams creates a new IPAMAggregatesDeleteParams object +// with the default values initialized. +func NewIPAMAggregatesDeleteParams() *IPAMAggregatesDeleteParams { + var () + return &IPAMAggregatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMAggregatesDeleteParamsWithTimeout creates a new IPAMAggregatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMAggregatesDeleteParamsWithTimeout(timeout time.Duration) *IPAMAggregatesDeleteParams { + var () + return &IPAMAggregatesDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMAggregatesDeleteParamsWithContext creates a new IPAMAggregatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMAggregatesDeleteParamsWithContext(ctx context.Context) *IPAMAggregatesDeleteParams { + var () + return &IPAMAggregatesDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMAggregatesDeleteParamsWithHTTPClient creates a new IPAMAggregatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMAggregatesDeleteParamsWithHTTPClient(client *http.Client) *IPAMAggregatesDeleteParams { + var () + return &IPAMAggregatesDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMAggregatesDeleteParams contains all the parameters to send to the API endpoint +for the ipam aggregates delete operation typically these are written to a http.Request +*/ +type IPAMAggregatesDeleteParams struct { + + /*ID + A unique integer value identifying this aggregate. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam aggregates delete params +func (o *IPAMAggregatesDeleteParams) WithTimeout(timeout time.Duration) *IPAMAggregatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam aggregates delete params +func (o *IPAMAggregatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam aggregates delete params +func (o *IPAMAggregatesDeleteParams) WithContext(ctx context.Context) *IPAMAggregatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam aggregates delete params +func (o *IPAMAggregatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam aggregates delete params +func (o *IPAMAggregatesDeleteParams) WithHTTPClient(client *http.Client) *IPAMAggregatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam aggregates delete params +func (o *IPAMAggregatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam aggregates delete params +func (o *IPAMAggregatesDeleteParams) WithID(id int64) *IPAMAggregatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam aggregates delete params +func (o *IPAMAggregatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMAggregatesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_delete_responses.go new file mode 100644 index 0000000..32812e1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMAggregatesDeleteReader is a Reader for the IPAMAggregatesDelete structure. +type IPAMAggregatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMAggregatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMAggregatesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMAggregatesDeleteNoContent creates a IPAMAggregatesDeleteNoContent with default headers values +func NewIPAMAggregatesDeleteNoContent() *IPAMAggregatesDeleteNoContent { + return &IPAMAggregatesDeleteNoContent{} +} + +/*IPAMAggregatesDeleteNoContent handles this case with default header values. + +IPAMAggregatesDeleteNoContent ipam aggregates delete no content +*/ +type IPAMAggregatesDeleteNoContent struct { +} + +func (o *IPAMAggregatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/aggregates/{id}/][%d] ipamAggregatesDeleteNoContent ", 204) +} + +func (o *IPAMAggregatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_list_parameters.go new file mode 100644 index 0000000..9a574db --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_list_parameters.go @@ -0,0 +1,372 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMAggregatesListParams creates a new IPAMAggregatesListParams object +// with the default values initialized. +func NewIPAMAggregatesListParams() *IPAMAggregatesListParams { + var () + return &IPAMAggregatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMAggregatesListParamsWithTimeout creates a new IPAMAggregatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMAggregatesListParamsWithTimeout(timeout time.Duration) *IPAMAggregatesListParams { + var () + return &IPAMAggregatesListParams{ + + timeout: timeout, + } +} + +// NewIPAMAggregatesListParamsWithContext creates a new IPAMAggregatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMAggregatesListParamsWithContext(ctx context.Context) *IPAMAggregatesListParams { + var () + return &IPAMAggregatesListParams{ + + Context: ctx, + } +} + +// NewIPAMAggregatesListParamsWithHTTPClient creates a new IPAMAggregatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMAggregatesListParamsWithHTTPClient(client *http.Client) *IPAMAggregatesListParams { + var () + return &IPAMAggregatesListParams{ + HTTPClient: client, + } +} + +/*IPAMAggregatesListParams contains all the parameters to send to the API endpoint +for the ipam aggregates list operation typically these are written to a http.Request +*/ +type IPAMAggregatesListParams struct { + + /*DateAdded*/ + DateAdded *string + /*Family*/ + Family *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *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 + /*RirID*/ + RirID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithTimeout(timeout time.Duration) *IPAMAggregatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithContext(ctx context.Context) *IPAMAggregatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithHTTPClient(client *http.Client) *IPAMAggregatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDateAdded adds the dateAdded to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithDateAdded(dateAdded *string) *IPAMAggregatesListParams { + o.SetDateAdded(dateAdded) + return o +} + +// SetDateAdded adds the dateAdded to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetDateAdded(dateAdded *string) { + o.DateAdded = dateAdded +} + +// WithFamily adds the family to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithFamily(family *string) *IPAMAggregatesListParams { + o.SetFamily(family) + return o +} + +// SetFamily adds the family to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetFamily(family *string) { + o.Family = family +} + +// WithIDIn adds the iDIn to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithIDIn(iDIn *string) *IPAMAggregatesListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithLimit(limit *int64) *IPAMAggregatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithOffset(offset *int64) *IPAMAggregatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithQ(q *string) *IPAMAggregatesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetQ(q *string) { + o.Q = q +} + +// WithRir adds the rir to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithRir(rir *string) *IPAMAggregatesListParams { + o.SetRir(rir) + return o +} + +// SetRir adds the rir to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetRir(rir *string) { + o.Rir = rir +} + +// WithRirID adds the rirID to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithRirID(rirID *string) *IPAMAggregatesListParams { + o.SetRirID(rirID) + return o +} + +// SetRirID adds the rirId to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetRirID(rirID *string) { + o.RirID = rirID +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMAggregatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DateAdded != nil { + + // query param date_added + var qrDateAdded string + if o.DateAdded != nil { + qrDateAdded = *o.DateAdded + } + qDateAdded := qrDateAdded + if qDateAdded != "" { + if err := r.SetQueryParam("date_added", qDateAdded); err != nil { + return err + } + } + + } + + if o.Family != nil { + + // query param family + var qrFamily string + if o.Family != nil { + qrFamily = *o.Family + } + qFamily := qrFamily + if qFamily != "" { + if err := r.SetQueryParam("family", qFamily); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); 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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_list_responses.go new file mode 100644 index 0000000..e5d8eb7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMAggregatesListReader is a Reader for the IPAMAggregatesList structure. +type IPAMAggregatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMAggregatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMAggregatesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMAggregatesListOK creates a IPAMAggregatesListOK with default headers values +func NewIPAMAggregatesListOK() *IPAMAggregatesListOK { + return &IPAMAggregatesListOK{} +} + +/*IPAMAggregatesListOK handles this case with default header values. + +IPAMAggregatesListOK ipam aggregates list o k +*/ +type IPAMAggregatesListOK struct { + Payload *models.IPAMAggregatesListOKBody +} + +func (o *IPAMAggregatesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/aggregates/][%d] ipamAggregatesListOK %+v", 200, o.Payload) +} + +func (o *IPAMAggregatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMAggregatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_partial_update_parameters.go new file mode 100644 index 0000000..b256992 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMAggregatesPartialUpdateParams creates a new IPAMAggregatesPartialUpdateParams object +// with the default values initialized. +func NewIPAMAggregatesPartialUpdateParams() *IPAMAggregatesPartialUpdateParams { + var () + return &IPAMAggregatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMAggregatesPartialUpdateParamsWithTimeout creates a new IPAMAggregatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMAggregatesPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMAggregatesPartialUpdateParams { + var () + return &IPAMAggregatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMAggregatesPartialUpdateParamsWithContext creates a new IPAMAggregatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMAggregatesPartialUpdateParamsWithContext(ctx context.Context) *IPAMAggregatesPartialUpdateParams { + var () + return &IPAMAggregatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMAggregatesPartialUpdateParamsWithHTTPClient creates a new IPAMAggregatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMAggregatesPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMAggregatesPartialUpdateParams { + var () + return &IPAMAggregatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMAggregatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam aggregates partial update operation typically these are written to a http.Request +*/ +type IPAMAggregatesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableAggregate + /*ID + A unique integer value identifying this aggregate. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMAggregatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) WithContext(ctx context.Context) *IPAMAggregatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMAggregatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) WithData(data *models.WritableAggregate) *IPAMAggregatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) SetData(data *models.WritableAggregate) { + o.Data = data +} + +// WithID adds the id to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) WithID(id int64) *IPAMAggregatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMAggregatesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_partial_update_responses.go new file mode 100644 index 0000000..294692b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMAggregatesPartialUpdateReader is a Reader for the IPAMAggregatesPartialUpdate structure. +type IPAMAggregatesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMAggregatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMAggregatesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMAggregatesPartialUpdateOK creates a IPAMAggregatesPartialUpdateOK with default headers values +func NewIPAMAggregatesPartialUpdateOK() *IPAMAggregatesPartialUpdateOK { + return &IPAMAggregatesPartialUpdateOK{} +} + +/*IPAMAggregatesPartialUpdateOK handles this case with default header values. + +IPAMAggregatesPartialUpdateOK ipam aggregates partial update o k +*/ +type IPAMAggregatesPartialUpdateOK struct { + Payload *models.WritableAggregate +} + +func (o *IPAMAggregatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/aggregates/{id}/][%d] ipamAggregatesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMAggregatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableAggregate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_read_parameters.go new file mode 100644 index 0000000..627f725 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMAggregatesReadParams creates a new IPAMAggregatesReadParams object +// with the default values initialized. +func NewIPAMAggregatesReadParams() *IPAMAggregatesReadParams { + var () + return &IPAMAggregatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMAggregatesReadParamsWithTimeout creates a new IPAMAggregatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMAggregatesReadParamsWithTimeout(timeout time.Duration) *IPAMAggregatesReadParams { + var () + return &IPAMAggregatesReadParams{ + + timeout: timeout, + } +} + +// NewIPAMAggregatesReadParamsWithContext creates a new IPAMAggregatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMAggregatesReadParamsWithContext(ctx context.Context) *IPAMAggregatesReadParams { + var () + return &IPAMAggregatesReadParams{ + + Context: ctx, + } +} + +// NewIPAMAggregatesReadParamsWithHTTPClient creates a new IPAMAggregatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMAggregatesReadParamsWithHTTPClient(client *http.Client) *IPAMAggregatesReadParams { + var () + return &IPAMAggregatesReadParams{ + HTTPClient: client, + } +} + +/*IPAMAggregatesReadParams contains all the parameters to send to the API endpoint +for the ipam aggregates read operation typically these are written to a http.Request +*/ +type IPAMAggregatesReadParams struct { + + /*ID + A unique integer value identifying this aggregate. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam aggregates read params +func (o *IPAMAggregatesReadParams) WithTimeout(timeout time.Duration) *IPAMAggregatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam aggregates read params +func (o *IPAMAggregatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam aggregates read params +func (o *IPAMAggregatesReadParams) WithContext(ctx context.Context) *IPAMAggregatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam aggregates read params +func (o *IPAMAggregatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam aggregates read params +func (o *IPAMAggregatesReadParams) WithHTTPClient(client *http.Client) *IPAMAggregatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam aggregates read params +func (o *IPAMAggregatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam aggregates read params +func (o *IPAMAggregatesReadParams) WithID(id int64) *IPAMAggregatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam aggregates read params +func (o *IPAMAggregatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMAggregatesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_read_responses.go new file mode 100644 index 0000000..0d23dd8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMAggregatesReadReader is a Reader for the IPAMAggregatesRead structure. +type IPAMAggregatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMAggregatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMAggregatesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMAggregatesReadOK creates a IPAMAggregatesReadOK with default headers values +func NewIPAMAggregatesReadOK() *IPAMAggregatesReadOK { + return &IPAMAggregatesReadOK{} +} + +/*IPAMAggregatesReadOK handles this case with default header values. + +IPAMAggregatesReadOK ipam aggregates read o k +*/ +type IPAMAggregatesReadOK struct { + Payload *models.Aggregate +} + +func (o *IPAMAggregatesReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/aggregates/{id}/][%d] ipamAggregatesReadOK %+v", 200, o.Payload) +} + +func (o *IPAMAggregatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Aggregate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_update_parameters.go new file mode 100644 index 0000000..b3fa043 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMAggregatesUpdateParams creates a new IPAMAggregatesUpdateParams object +// with the default values initialized. +func NewIPAMAggregatesUpdateParams() *IPAMAggregatesUpdateParams { + var () + return &IPAMAggregatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMAggregatesUpdateParamsWithTimeout creates a new IPAMAggregatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMAggregatesUpdateParamsWithTimeout(timeout time.Duration) *IPAMAggregatesUpdateParams { + var () + return &IPAMAggregatesUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMAggregatesUpdateParamsWithContext creates a new IPAMAggregatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMAggregatesUpdateParamsWithContext(ctx context.Context) *IPAMAggregatesUpdateParams { + var () + return &IPAMAggregatesUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMAggregatesUpdateParamsWithHTTPClient creates a new IPAMAggregatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMAggregatesUpdateParamsWithHTTPClient(client *http.Client) *IPAMAggregatesUpdateParams { + var () + return &IPAMAggregatesUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMAggregatesUpdateParams contains all the parameters to send to the API endpoint +for the ipam aggregates update operation typically these are written to a http.Request +*/ +type IPAMAggregatesUpdateParams struct { + + /*Data*/ + Data *models.WritableAggregate + /*ID + A unique integer value identifying this aggregate. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) WithTimeout(timeout time.Duration) *IPAMAggregatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) WithContext(ctx context.Context) *IPAMAggregatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) WithHTTPClient(client *http.Client) *IPAMAggregatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) WithData(data *models.WritableAggregate) *IPAMAggregatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) SetData(data *models.WritableAggregate) { + o.Data = data +} + +// WithID adds the id to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) WithID(id int64) *IPAMAggregatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMAggregatesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_update_responses.go new file mode 100644 index 0000000..205b88c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amaggregates_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMAggregatesUpdateReader is a Reader for the IPAMAggregatesUpdate structure. +type IPAMAggregatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMAggregatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMAggregatesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMAggregatesUpdateOK creates a IPAMAggregatesUpdateOK with default headers values +func NewIPAMAggregatesUpdateOK() *IPAMAggregatesUpdateOK { + return &IPAMAggregatesUpdateOK{} +} + +/*IPAMAggregatesUpdateOK handles this case with default header values. + +IPAMAggregatesUpdateOK ipam aggregates update o k +*/ +type IPAMAggregatesUpdateOK struct { + Payload *models.WritableAggregate +} + +func (o *IPAMAggregatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/aggregates/{id}/][%d] ipamAggregatesUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMAggregatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableAggregate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amchoices_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amchoices_list_parameters.go new file mode 100644 index 0000000..9c2378f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amchoices_list_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMChoicesListParams creates a new IPAMChoicesListParams object +// with the default values initialized. +func NewIPAMChoicesListParams() *IPAMChoicesListParams { + + return &IPAMChoicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMChoicesListParamsWithTimeout creates a new IPAMChoicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMChoicesListParamsWithTimeout(timeout time.Duration) *IPAMChoicesListParams { + + return &IPAMChoicesListParams{ + + timeout: timeout, + } +} + +// NewIPAMChoicesListParamsWithContext creates a new IPAMChoicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMChoicesListParamsWithContext(ctx context.Context) *IPAMChoicesListParams { + + return &IPAMChoicesListParams{ + + Context: ctx, + } +} + +// NewIPAMChoicesListParamsWithHTTPClient creates a new IPAMChoicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMChoicesListParamsWithHTTPClient(client *http.Client) *IPAMChoicesListParams { + + return &IPAMChoicesListParams{ + HTTPClient: client, + } +} + +/*IPAMChoicesListParams contains all the parameters to send to the API endpoint +for the ipam choices list operation typically these are written to a http.Request +*/ +type IPAMChoicesListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam choices list params +func (o *IPAMChoicesListParams) WithTimeout(timeout time.Duration) *IPAMChoicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam choices list params +func (o *IPAMChoicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam choices list params +func (o *IPAMChoicesListParams) WithContext(ctx context.Context) *IPAMChoicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam choices list params +func (o *IPAMChoicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam choices list params +func (o *IPAMChoicesListParams) WithHTTPClient(client *http.Client) *IPAMChoicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam choices list params +func (o *IPAMChoicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMChoicesListParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amchoices_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amchoices_list_responses.go new file mode 100644 index 0000000..e3a500a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amchoices_list_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMChoicesListReader is a Reader for the IPAMChoicesList structure. +type IPAMChoicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMChoicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMChoicesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMChoicesListOK creates a IPAMChoicesListOK with default headers values +func NewIPAMChoicesListOK() *IPAMChoicesListOK { + return &IPAMChoicesListOK{} +} + +/*IPAMChoicesListOK handles this case with default header values. + +IPAMChoicesListOK ipam choices list o k +*/ +type IPAMChoicesListOK struct { +} + +func (o *IPAMChoicesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/_choices/][%d] ipamChoicesListOK ", 200) +} + +func (o *IPAMChoicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amchoices_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amchoices_read_parameters.go new file mode 100644 index 0000000..834c1a3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amchoices_read_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMChoicesReadParams creates a new IPAMChoicesReadParams object +// with the default values initialized. +func NewIPAMChoicesReadParams() *IPAMChoicesReadParams { + var () + return &IPAMChoicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMChoicesReadParamsWithTimeout creates a new IPAMChoicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMChoicesReadParamsWithTimeout(timeout time.Duration) *IPAMChoicesReadParams { + var () + return &IPAMChoicesReadParams{ + + timeout: timeout, + } +} + +// NewIPAMChoicesReadParamsWithContext creates a new IPAMChoicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMChoicesReadParamsWithContext(ctx context.Context) *IPAMChoicesReadParams { + var () + return &IPAMChoicesReadParams{ + + Context: ctx, + } +} + +// NewIPAMChoicesReadParamsWithHTTPClient creates a new IPAMChoicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMChoicesReadParamsWithHTTPClient(client *http.Client) *IPAMChoicesReadParams { + var () + return &IPAMChoicesReadParams{ + HTTPClient: client, + } +} + +/*IPAMChoicesReadParams contains all the parameters to send to the API endpoint +for the ipam choices read operation typically these are written to a http.Request +*/ +type IPAMChoicesReadParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam choices read params +func (o *IPAMChoicesReadParams) WithTimeout(timeout time.Duration) *IPAMChoicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam choices read params +func (o *IPAMChoicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam choices read params +func (o *IPAMChoicesReadParams) WithContext(ctx context.Context) *IPAMChoicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam choices read params +func (o *IPAMChoicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam choices read params +func (o *IPAMChoicesReadParams) WithHTTPClient(client *http.Client) *IPAMChoicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam choices read params +func (o *IPAMChoicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam choices read params +func (o *IPAMChoicesReadParams) WithID(id string) *IPAMChoicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam choices read params +func (o *IPAMChoicesReadParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMChoicesReadParams) 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", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amchoices_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amchoices_read_responses.go new file mode 100644 index 0000000..bee4187 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amchoices_read_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMChoicesReadReader is a Reader for the IPAMChoicesRead structure. +type IPAMChoicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMChoicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMChoicesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMChoicesReadOK creates a IPAMChoicesReadOK with default headers values +func NewIPAMChoicesReadOK() *IPAMChoicesReadOK { + return &IPAMChoicesReadOK{} +} + +/*IPAMChoicesReadOK handles this case with default header values. + +IPAMChoicesReadOK ipam choices read o k +*/ +type IPAMChoicesReadOK struct { +} + +func (o *IPAMChoicesReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/_choices/{id}/][%d] ipamChoicesReadOK ", 200) +} + +func (o *IPAMChoicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_create_parameters.go new file mode 100644 index 0000000..90ef06e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMIPAddressesCreateParams creates a new IPAMIPAddressesCreateParams object +// with the default values initialized. +func NewIPAMIPAddressesCreateParams() *IPAMIPAddressesCreateParams { + var () + return &IPAMIPAddressesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMIPAddressesCreateParamsWithTimeout creates a new IPAMIPAddressesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMIPAddressesCreateParamsWithTimeout(timeout time.Duration) *IPAMIPAddressesCreateParams { + var () + return &IPAMIPAddressesCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMIPAddressesCreateParamsWithContext creates a new IPAMIPAddressesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMIPAddressesCreateParamsWithContext(ctx context.Context) *IPAMIPAddressesCreateParams { + var () + return &IPAMIPAddressesCreateParams{ + + Context: ctx, + } +} + +// NewIPAMIPAddressesCreateParamsWithHTTPClient creates a new IPAMIPAddressesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMIPAddressesCreateParamsWithHTTPClient(client *http.Client) *IPAMIPAddressesCreateParams { + var () + return &IPAMIPAddressesCreateParams{ + HTTPClient: client, + } +} + +/*IPAMIPAddressesCreateParams contains all the parameters to send to the API endpoint +for the ipam ip addresses create operation typically these are written to a http.Request +*/ +type IPAMIPAddressesCreateParams struct { + + /*Data*/ + Data *models.WritableIPAddress + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam ip addresses create params +func (o *IPAMIPAddressesCreateParams) WithTimeout(timeout time.Duration) *IPAMIPAddressesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam ip addresses create params +func (o *IPAMIPAddressesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam ip addresses create params +func (o *IPAMIPAddressesCreateParams) WithContext(ctx context.Context) *IPAMIPAddressesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam ip addresses create params +func (o *IPAMIPAddressesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam ip addresses create params +func (o *IPAMIPAddressesCreateParams) WithHTTPClient(client *http.Client) *IPAMIPAddressesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam ip addresses create params +func (o *IPAMIPAddressesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam ip addresses create params +func (o *IPAMIPAddressesCreateParams) WithData(data *models.WritableIPAddress) *IPAMIPAddressesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam ip addresses create params +func (o *IPAMIPAddressesCreateParams) SetData(data *models.WritableIPAddress) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMIPAddressesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_create_responses.go new file mode 100644 index 0000000..05729de --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMIPAddressesCreateReader is a Reader for the IPAMIPAddressesCreate structure. +type IPAMIPAddressesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMIPAddressesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMIPAddressesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMIPAddressesCreateCreated creates a IPAMIPAddressesCreateCreated with default headers values +func NewIPAMIPAddressesCreateCreated() *IPAMIPAddressesCreateCreated { + return &IPAMIPAddressesCreateCreated{} +} + +/*IPAMIPAddressesCreateCreated handles this case with default header values. + +IPAMIPAddressesCreateCreated ipam Ip addresses create created +*/ +type IPAMIPAddressesCreateCreated struct { + Payload *models.WritableIPAddress +} + +func (o *IPAMIPAddressesCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/ip-addresses/][%d] ipamIpAddressesCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMIPAddressesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableIPAddress) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_delete_parameters.go new file mode 100644 index 0000000..8d4f9d1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMIPAddressesDeleteParams creates a new IPAMIPAddressesDeleteParams object +// with the default values initialized. +func NewIPAMIPAddressesDeleteParams() *IPAMIPAddressesDeleteParams { + var () + return &IPAMIPAddressesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMIPAddressesDeleteParamsWithTimeout creates a new IPAMIPAddressesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMIPAddressesDeleteParamsWithTimeout(timeout time.Duration) *IPAMIPAddressesDeleteParams { + var () + return &IPAMIPAddressesDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMIPAddressesDeleteParamsWithContext creates a new IPAMIPAddressesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMIPAddressesDeleteParamsWithContext(ctx context.Context) *IPAMIPAddressesDeleteParams { + var () + return &IPAMIPAddressesDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMIPAddressesDeleteParamsWithHTTPClient creates a new IPAMIPAddressesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMIPAddressesDeleteParamsWithHTTPClient(client *http.Client) *IPAMIPAddressesDeleteParams { + var () + return &IPAMIPAddressesDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMIPAddressesDeleteParams contains all the parameters to send to the API endpoint +for the ipam ip addresses delete operation typically these are written to a http.Request +*/ +type IPAMIPAddressesDeleteParams struct { + + /*ID + A unique integer value identifying this IP address. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam ip addresses delete params +func (o *IPAMIPAddressesDeleteParams) WithTimeout(timeout time.Duration) *IPAMIPAddressesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam ip addresses delete params +func (o *IPAMIPAddressesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam ip addresses delete params +func (o *IPAMIPAddressesDeleteParams) WithContext(ctx context.Context) *IPAMIPAddressesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam ip addresses delete params +func (o *IPAMIPAddressesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam ip addresses delete params +func (o *IPAMIPAddressesDeleteParams) WithHTTPClient(client *http.Client) *IPAMIPAddressesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam ip addresses delete params +func (o *IPAMIPAddressesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam ip addresses delete params +func (o *IPAMIPAddressesDeleteParams) WithID(id int64) *IPAMIPAddressesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam ip addresses delete params +func (o *IPAMIPAddressesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMIPAddressesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_delete_responses.go new file mode 100644 index 0000000..b05cb8c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMIPAddressesDeleteReader is a Reader for the IPAMIPAddressesDelete structure. +type IPAMIPAddressesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMIPAddressesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMIPAddressesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMIPAddressesDeleteNoContent creates a IPAMIPAddressesDeleteNoContent with default headers values +func NewIPAMIPAddressesDeleteNoContent() *IPAMIPAddressesDeleteNoContent { + return &IPAMIPAddressesDeleteNoContent{} +} + +/*IPAMIPAddressesDeleteNoContent handles this case with default header values. + +IPAMIPAddressesDeleteNoContent ipam Ip addresses delete no content +*/ +type IPAMIPAddressesDeleteNoContent struct { +} + +func (o *IPAMIPAddressesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/ip-addresses/{id}/][%d] ipamIpAddressesDeleteNoContent ", 204) +} + +func (o *IPAMIPAddressesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_list_parameters.go new file mode 100644 index 0000000..2a03ebd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_list_parameters.go @@ -0,0 +1,662 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMIPAddressesListParams creates a new IPAMIPAddressesListParams object +// with the default values initialized. +func NewIPAMIPAddressesListParams() *IPAMIPAddressesListParams { + var () + return &IPAMIPAddressesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMIPAddressesListParamsWithTimeout creates a new IPAMIPAddressesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMIPAddressesListParamsWithTimeout(timeout time.Duration) *IPAMIPAddressesListParams { + var () + return &IPAMIPAddressesListParams{ + + timeout: timeout, + } +} + +// NewIPAMIPAddressesListParamsWithContext creates a new IPAMIPAddressesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMIPAddressesListParamsWithContext(ctx context.Context) *IPAMIPAddressesListParams { + var () + return &IPAMIPAddressesListParams{ + + Context: ctx, + } +} + +// NewIPAMIPAddressesListParamsWithHTTPClient creates a new IPAMIPAddressesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMIPAddressesListParamsWithHTTPClient(client *http.Client) *IPAMIPAddressesListParams { + var () + return &IPAMIPAddressesListParams{ + HTTPClient: client, + } +} + +/*IPAMIPAddressesListParams contains all the parameters to send to the API endpoint +for the ipam ip addresses list operation typically these are written to a http.Request +*/ +type IPAMIPAddressesListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *float64 + /*Family*/ + Family *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*InterfaceID*/ + InterfaceID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*MaskLength*/ + MaskLength *float64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Parent*/ + Parent *string + /*Q*/ + Q *string + /*Role*/ + Role *string + /*Status*/ + Status *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + /*VirtualMachine*/ + VirtualMachine *string + /*VirtualMachineID*/ + VirtualMachineID *string + /*Vrf*/ + Vrf *string + /*VrfID*/ + VrfID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithTimeout(timeout time.Duration) *IPAMIPAddressesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithContext(ctx context.Context) *IPAMIPAddressesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithHTTPClient(client *http.Client) *IPAMIPAddressesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithDevice(device *string) *IPAMIPAddressesListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithDeviceID(deviceID *float64) *IPAMIPAddressesListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetDeviceID(deviceID *float64) { + o.DeviceID = deviceID +} + +// WithFamily adds the family to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithFamily(family *string) *IPAMIPAddressesListParams { + o.SetFamily(family) + return o +} + +// SetFamily adds the family to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetFamily(family *string) { + o.Family = family +} + +// WithIDIn adds the iDIn to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithIDIn(iDIn *string) *IPAMIPAddressesListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithInterfaceID adds the interfaceID to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithInterfaceID(interfaceID *string) *IPAMIPAddressesListParams { + o.SetInterfaceID(interfaceID) + return o +} + +// SetInterfaceID adds the interfaceId to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetInterfaceID(interfaceID *string) { + o.InterfaceID = interfaceID +} + +// WithLimit adds the limit to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithLimit(limit *int64) *IPAMIPAddressesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithMaskLength adds the maskLength to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithMaskLength(maskLength *float64) *IPAMIPAddressesListParams { + o.SetMaskLength(maskLength) + return o +} + +// SetMaskLength adds the maskLength to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetMaskLength(maskLength *float64) { + o.MaskLength = maskLength +} + +// WithOffset adds the offset to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithOffset(offset *int64) *IPAMIPAddressesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithParent adds the parent to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithParent(parent *string) *IPAMIPAddressesListParams { + o.SetParent(parent) + return o +} + +// SetParent adds the parent to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetParent(parent *string) { + o.Parent = parent +} + +// WithQ adds the q to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithQ(q *string) *IPAMIPAddressesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetQ(q *string) { + o.Q = q +} + +// WithRole adds the role to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithRole(role *string) *IPAMIPAddressesListParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetRole(role *string) { + o.Role = role +} + +// WithStatus adds the status to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithStatus(status *string) *IPAMIPAddressesListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetStatus(status *string) { + o.Status = status +} + +// WithTenant adds the tenant to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithTenant(tenant *string) *IPAMIPAddressesListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithTenantID(tenantID *string) *IPAMIPAddressesListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WithVirtualMachine adds the virtualMachine to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithVirtualMachine(virtualMachine *string) *IPAMIPAddressesListParams { + o.SetVirtualMachine(virtualMachine) + return o +} + +// SetVirtualMachine adds the virtualMachine to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetVirtualMachine(virtualMachine *string) { + o.VirtualMachine = virtualMachine +} + +// WithVirtualMachineID adds the virtualMachineID to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithVirtualMachineID(virtualMachineID *string) *IPAMIPAddressesListParams { + o.SetVirtualMachineID(virtualMachineID) + return o +} + +// SetVirtualMachineID adds the virtualMachineId to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetVirtualMachineID(virtualMachineID *string) { + o.VirtualMachineID = virtualMachineID +} + +// WithVrf adds the vrf to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithVrf(vrf *string) *IPAMIPAddressesListParams { + o.SetVrf(vrf) + return o +} + +// SetVrf adds the vrf to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetVrf(vrf *string) { + o.Vrf = vrf +} + +// WithVrfID adds the vrfID to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithVrfID(vrfID *string) *IPAMIPAddressesListParams { + o.SetVrfID(vrfID) + return o +} + +// SetVrfID adds the vrfId to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetVrfID(vrfID *string) { + o.VrfID = vrfID +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMIPAddressesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID float64 + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := swag.FormatFloat64(qrDeviceID) + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.Family != nil { + + // query param family + var qrFamily string + if o.Family != nil { + qrFamily = *o.Family + } + qFamily := qrFamily + if qFamily != "" { + if err := r.SetQueryParam("family", qFamily); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); 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.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.MaskLength != nil { + + // query param mask_length + var qrMaskLength float64 + if o.MaskLength != nil { + qrMaskLength = *o.MaskLength + } + qMaskLength := swag.FormatFloat64(qrMaskLength) + if qMaskLength != "" { + if err := r.SetQueryParam("mask_length", qMaskLength); 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.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.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.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.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.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.VirtualMachine != nil { + + // query param virtual_machine + var qrVirtualMachine string + if o.VirtualMachine != nil { + qrVirtualMachine = *o.VirtualMachine + } + qVirtualMachine := qrVirtualMachine + if qVirtualMachine != "" { + if err := r.SetQueryParam("virtual_machine", qVirtualMachine); err != nil { + return err + } + } + + } + + if o.VirtualMachineID != nil { + + // query param virtual_machine_id + var qrVirtualMachineID string + if o.VirtualMachineID != nil { + qrVirtualMachineID = *o.VirtualMachineID + } + qVirtualMachineID := qrVirtualMachineID + if qVirtualMachineID != "" { + if err := r.SetQueryParam("virtual_machine_id", qVirtualMachineID); err != nil { + return err + } + } + + } + + if o.Vrf != nil { + + // query param vrf + var qrVrf string + if o.Vrf != nil { + qrVrf = *o.Vrf + } + qVrf := qrVrf + if qVrf != "" { + if err := r.SetQueryParam("vrf", qVrf); err != nil { + return err + } + } + + } + + if o.VrfID != nil { + + // query param vrf_id + var qrVrfID string + if o.VrfID != nil { + qrVrfID = *o.VrfID + } + qVrfID := qrVrfID + if qVrfID != "" { + if err := r.SetQueryParam("vrf_id", qVrfID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_list_responses.go new file mode 100644 index 0000000..6d9a024 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMIPAddressesListReader is a Reader for the IPAMIPAddressesList structure. +type IPAMIPAddressesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMIPAddressesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMIPAddressesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMIPAddressesListOK creates a IPAMIPAddressesListOK with default headers values +func NewIPAMIPAddressesListOK() *IPAMIPAddressesListOK { + return &IPAMIPAddressesListOK{} +} + +/*IPAMIPAddressesListOK handles this case with default header values. + +IPAMIPAddressesListOK ipam Ip addresses list o k +*/ +type IPAMIPAddressesListOK struct { + Payload *models.IPAMIPAddressesListOKBody +} + +func (o *IPAMIPAddressesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/ip-addresses/][%d] ipamIpAddressesListOK %+v", 200, o.Payload) +} + +func (o *IPAMIPAddressesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMIPAddressesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_partial_update_parameters.go new file mode 100644 index 0000000..eb480f9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMIPAddressesPartialUpdateParams creates a new IPAMIPAddressesPartialUpdateParams object +// with the default values initialized. +func NewIPAMIPAddressesPartialUpdateParams() *IPAMIPAddressesPartialUpdateParams { + var () + return &IPAMIPAddressesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMIPAddressesPartialUpdateParamsWithTimeout creates a new IPAMIPAddressesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMIPAddressesPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMIPAddressesPartialUpdateParams { + var () + return &IPAMIPAddressesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMIPAddressesPartialUpdateParamsWithContext creates a new IPAMIPAddressesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMIPAddressesPartialUpdateParamsWithContext(ctx context.Context) *IPAMIPAddressesPartialUpdateParams { + var () + return &IPAMIPAddressesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMIPAddressesPartialUpdateParamsWithHTTPClient creates a new IPAMIPAddressesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMIPAddressesPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMIPAddressesPartialUpdateParams { + var () + return &IPAMIPAddressesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMIPAddressesPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam ip addresses partial update operation typically these are written to a http.Request +*/ +type IPAMIPAddressesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableIPAddress + /*ID + A unique integer value identifying this IP address. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMIPAddressesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) WithContext(ctx context.Context) *IPAMIPAddressesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMIPAddressesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) WithData(data *models.WritableIPAddress) *IPAMIPAddressesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) SetData(data *models.WritableIPAddress) { + o.Data = data +} + +// WithID adds the id to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) WithID(id int64) *IPAMIPAddressesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMIPAddressesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_partial_update_responses.go new file mode 100644 index 0000000..59770b2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMIPAddressesPartialUpdateReader is a Reader for the IPAMIPAddressesPartialUpdate structure. +type IPAMIPAddressesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMIPAddressesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMIPAddressesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMIPAddressesPartialUpdateOK creates a IPAMIPAddressesPartialUpdateOK with default headers values +func NewIPAMIPAddressesPartialUpdateOK() *IPAMIPAddressesPartialUpdateOK { + return &IPAMIPAddressesPartialUpdateOK{} +} + +/*IPAMIPAddressesPartialUpdateOK handles this case with default header values. + +IPAMIPAddressesPartialUpdateOK ipam Ip addresses partial update o k +*/ +type IPAMIPAddressesPartialUpdateOK struct { + Payload *models.WritableIPAddress +} + +func (o *IPAMIPAddressesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/ip-addresses/{id}/][%d] ipamIpAddressesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMIPAddressesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableIPAddress) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_read_parameters.go new file mode 100644 index 0000000..b326478 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMIPAddressesReadParams creates a new IPAMIPAddressesReadParams object +// with the default values initialized. +func NewIPAMIPAddressesReadParams() *IPAMIPAddressesReadParams { + var () + return &IPAMIPAddressesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMIPAddressesReadParamsWithTimeout creates a new IPAMIPAddressesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMIPAddressesReadParamsWithTimeout(timeout time.Duration) *IPAMIPAddressesReadParams { + var () + return &IPAMIPAddressesReadParams{ + + timeout: timeout, + } +} + +// NewIPAMIPAddressesReadParamsWithContext creates a new IPAMIPAddressesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMIPAddressesReadParamsWithContext(ctx context.Context) *IPAMIPAddressesReadParams { + var () + return &IPAMIPAddressesReadParams{ + + Context: ctx, + } +} + +// NewIPAMIPAddressesReadParamsWithHTTPClient creates a new IPAMIPAddressesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMIPAddressesReadParamsWithHTTPClient(client *http.Client) *IPAMIPAddressesReadParams { + var () + return &IPAMIPAddressesReadParams{ + HTTPClient: client, + } +} + +/*IPAMIPAddressesReadParams contains all the parameters to send to the API endpoint +for the ipam ip addresses read operation typically these are written to a http.Request +*/ +type IPAMIPAddressesReadParams struct { + + /*ID + A unique integer value identifying this IP address. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam ip addresses read params +func (o *IPAMIPAddressesReadParams) WithTimeout(timeout time.Duration) *IPAMIPAddressesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam ip addresses read params +func (o *IPAMIPAddressesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam ip addresses read params +func (o *IPAMIPAddressesReadParams) WithContext(ctx context.Context) *IPAMIPAddressesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam ip addresses read params +func (o *IPAMIPAddressesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam ip addresses read params +func (o *IPAMIPAddressesReadParams) WithHTTPClient(client *http.Client) *IPAMIPAddressesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam ip addresses read params +func (o *IPAMIPAddressesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam ip addresses read params +func (o *IPAMIPAddressesReadParams) WithID(id int64) *IPAMIPAddressesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam ip addresses read params +func (o *IPAMIPAddressesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMIPAddressesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_read_responses.go new file mode 100644 index 0000000..b9b8d10 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMIPAddressesReadReader is a Reader for the IPAMIPAddressesRead structure. +type IPAMIPAddressesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMIPAddressesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMIPAddressesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMIPAddressesReadOK creates a IPAMIPAddressesReadOK with default headers values +func NewIPAMIPAddressesReadOK() *IPAMIPAddressesReadOK { + return &IPAMIPAddressesReadOK{} +} + +/*IPAMIPAddressesReadOK handles this case with default header values. + +IPAMIPAddressesReadOK ipam Ip addresses read o k +*/ +type IPAMIPAddressesReadOK struct { + Payload *models.IPAddress +} + +func (o *IPAMIPAddressesReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/ip-addresses/{id}/][%d] ipamIpAddressesReadOK %+v", 200, o.Payload) +} + +func (o *IPAMIPAddressesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAddress) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_update_parameters.go new file mode 100644 index 0000000..54b097e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMIPAddressesUpdateParams creates a new IPAMIPAddressesUpdateParams object +// with the default values initialized. +func NewIPAMIPAddressesUpdateParams() *IPAMIPAddressesUpdateParams { + var () + return &IPAMIPAddressesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMIPAddressesUpdateParamsWithTimeout creates a new IPAMIPAddressesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMIPAddressesUpdateParamsWithTimeout(timeout time.Duration) *IPAMIPAddressesUpdateParams { + var () + return &IPAMIPAddressesUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMIPAddressesUpdateParamsWithContext creates a new IPAMIPAddressesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMIPAddressesUpdateParamsWithContext(ctx context.Context) *IPAMIPAddressesUpdateParams { + var () + return &IPAMIPAddressesUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMIPAddressesUpdateParamsWithHTTPClient creates a new IPAMIPAddressesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMIPAddressesUpdateParamsWithHTTPClient(client *http.Client) *IPAMIPAddressesUpdateParams { + var () + return &IPAMIPAddressesUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMIPAddressesUpdateParams contains all the parameters to send to the API endpoint +for the ipam ip addresses update operation typically these are written to a http.Request +*/ +type IPAMIPAddressesUpdateParams struct { + + /*Data*/ + Data *models.WritableIPAddress + /*ID + A unique integer value identifying this IP address. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) WithTimeout(timeout time.Duration) *IPAMIPAddressesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) WithContext(ctx context.Context) *IPAMIPAddressesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) WithHTTPClient(client *http.Client) *IPAMIPAddressesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) WithData(data *models.WritableIPAddress) *IPAMIPAddressesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) SetData(data *models.WritableIPAddress) { + o.Data = data +} + +// WithID adds the id to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) WithID(id int64) *IPAMIPAddressesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMIPAddressesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_update_responses.go new file mode 100644 index 0000000..c9e917b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amip_addresses_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMIPAddressesUpdateReader is a Reader for the IPAMIPAddressesUpdate structure. +type IPAMIPAddressesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMIPAddressesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMIPAddressesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMIPAddressesUpdateOK creates a IPAMIPAddressesUpdateOK with default headers values +func NewIPAMIPAddressesUpdateOK() *IPAMIPAddressesUpdateOK { + return &IPAMIPAddressesUpdateOK{} +} + +/*IPAMIPAddressesUpdateOK handles this case with default header values. + +IPAMIPAddressesUpdateOK ipam Ip addresses update o k +*/ +type IPAMIPAddressesUpdateOK struct { + Payload *models.WritableIPAddress +} + +func (o *IPAMIPAddressesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/ip-addresses/{id}/][%d] ipamIpAddressesUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMIPAddressesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableIPAddress) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_ips_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_ips_create_parameters.go new file mode 100644 index 0000000..b16acd4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_ips_create_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMPrefixesAvailableIpsCreateParams creates a new IPAMPrefixesAvailableIpsCreateParams object +// with the default values initialized. +func NewIPAMPrefixesAvailableIpsCreateParams() *IPAMPrefixesAvailableIpsCreateParams { + var () + return &IPAMPrefixesAvailableIpsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesAvailableIpsCreateParamsWithTimeout creates a new IPAMPrefixesAvailableIpsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesAvailableIpsCreateParamsWithTimeout(timeout time.Duration) *IPAMPrefixesAvailableIpsCreateParams { + var () + return &IPAMPrefixesAvailableIpsCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesAvailableIpsCreateParamsWithContext creates a new IPAMPrefixesAvailableIpsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesAvailableIpsCreateParamsWithContext(ctx context.Context) *IPAMPrefixesAvailableIpsCreateParams { + var () + return &IPAMPrefixesAvailableIpsCreateParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesAvailableIpsCreateParamsWithHTTPClient creates a new IPAMPrefixesAvailableIpsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesAvailableIpsCreateParamsWithHTTPClient(client *http.Client) *IPAMPrefixesAvailableIpsCreateParams { + var () + return &IPAMPrefixesAvailableIpsCreateParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesAvailableIpsCreateParams contains all the parameters to send to the API endpoint +for the ipam prefixes available ips create operation typically these are written to a http.Request +*/ +type IPAMPrefixesAvailableIpsCreateParams struct { + + /*Data*/ + Data *models.Prefix + /*ID + A unique integer value identifying this prefix. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) WithTimeout(timeout time.Duration) *IPAMPrefixesAvailableIpsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) WithContext(ctx context.Context) *IPAMPrefixesAvailableIpsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) WithHTTPClient(client *http.Client) *IPAMPrefixesAvailableIpsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) WithData(data *models.Prefix) *IPAMPrefixesAvailableIpsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) SetData(data *models.Prefix) { + o.Data = data +} + +// WithID adds the id to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) WithID(id int64) *IPAMPrefixesAvailableIpsCreateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesAvailableIpsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_ips_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_ips_create_responses.go new file mode 100644 index 0000000..088dc49 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_ips_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMPrefixesAvailableIpsCreateReader is a Reader for the IPAMPrefixesAvailableIpsCreate structure. +type IPAMPrefixesAvailableIpsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesAvailableIpsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMPrefixesAvailableIpsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMPrefixesAvailableIpsCreateCreated creates a IPAMPrefixesAvailableIpsCreateCreated with default headers values +func NewIPAMPrefixesAvailableIpsCreateCreated() *IPAMPrefixesAvailableIpsCreateCreated { + return &IPAMPrefixesAvailableIpsCreateCreated{} +} + +/*IPAMPrefixesAvailableIpsCreateCreated handles this case with default header values. + +IPAMPrefixesAvailableIpsCreateCreated ipam prefixes available ips create created +*/ +type IPAMPrefixesAvailableIpsCreateCreated struct { + Payload *models.Prefix +} + +func (o *IPAMPrefixesAvailableIpsCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/prefixes/{id}/available-ips/][%d] ipamPrefixesAvailableIpsCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMPrefixesAvailableIpsCreateCreated) 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 { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_ips_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_ips_read_parameters.go new file mode 100644 index 0000000..95da2ec --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_ips_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMPrefixesAvailableIpsReadParams creates a new IPAMPrefixesAvailableIpsReadParams object +// with the default values initialized. +func NewIPAMPrefixesAvailableIpsReadParams() *IPAMPrefixesAvailableIpsReadParams { + var () + return &IPAMPrefixesAvailableIpsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesAvailableIpsReadParamsWithTimeout creates a new IPAMPrefixesAvailableIpsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesAvailableIpsReadParamsWithTimeout(timeout time.Duration) *IPAMPrefixesAvailableIpsReadParams { + var () + return &IPAMPrefixesAvailableIpsReadParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesAvailableIpsReadParamsWithContext creates a new IPAMPrefixesAvailableIpsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesAvailableIpsReadParamsWithContext(ctx context.Context) *IPAMPrefixesAvailableIpsReadParams { + var () + return &IPAMPrefixesAvailableIpsReadParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesAvailableIpsReadParamsWithHTTPClient creates a new IPAMPrefixesAvailableIpsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesAvailableIpsReadParamsWithHTTPClient(client *http.Client) *IPAMPrefixesAvailableIpsReadParams { + var () + return &IPAMPrefixesAvailableIpsReadParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesAvailableIpsReadParams contains all the parameters to send to the API endpoint +for the ipam prefixes available ips read operation typically these are written to a http.Request +*/ +type IPAMPrefixesAvailableIpsReadParams struct { + + /*ID + A unique integer value identifying this prefix. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam prefixes available ips read params +func (o *IPAMPrefixesAvailableIpsReadParams) WithTimeout(timeout time.Duration) *IPAMPrefixesAvailableIpsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes available ips read params +func (o *IPAMPrefixesAvailableIpsReadParams) 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 { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes available ips read params +func (o *IPAMPrefixesAvailableIpsReadParams) 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 { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes available ips read params +func (o *IPAMPrefixesAvailableIpsReadParams) 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 { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam prefixes available ips read params +func (o *IPAMPrefixesAvailableIpsReadParams) 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 { + + 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_ips_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_ips_read_responses.go new file mode 100644 index 0000000..c358354 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_ips_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMPrefixesAvailableIpsReadReader is a Reader for the IPAMPrefixesAvailableIpsRead structure. +type IPAMPrefixesAvailableIpsReadReader 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) { + switch response.Code() { + + case 200: + result := NewIPAMPrefixesAvailableIpsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMPrefixesAvailableIpsReadOK creates a IPAMPrefixesAvailableIpsReadOK with default headers values +func NewIPAMPrefixesAvailableIpsReadOK() *IPAMPrefixesAvailableIpsReadOK { + return &IPAMPrefixesAvailableIpsReadOK{} +} + +/*IPAMPrefixesAvailableIpsReadOK handles this case with default header values. + +IPAMPrefixesAvailableIpsReadOK ipam prefixes available ips read o k +*/ +type IPAMPrefixesAvailableIpsReadOK struct { + Payload *models.Prefix +} + +func (o *IPAMPrefixesAvailableIpsReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/prefixes/{id}/available-ips/][%d] ipamPrefixesAvailableIpsReadOK %+v", 200, o.Payload) +} + +func (o *IPAMPrefixesAvailableIpsReadOK) 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 { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_prefixes_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_prefixes_create_parameters.go new file mode 100644 index 0000000..7864c07 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_prefixes_create_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMPrefixesAvailablePrefixesCreateParams creates a new IPAMPrefixesAvailablePrefixesCreateParams object +// with the default values initialized. +func NewIPAMPrefixesAvailablePrefixesCreateParams() *IPAMPrefixesAvailablePrefixesCreateParams { + var () + return &IPAMPrefixesAvailablePrefixesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesAvailablePrefixesCreateParamsWithTimeout creates a new IPAMPrefixesAvailablePrefixesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesAvailablePrefixesCreateParamsWithTimeout(timeout time.Duration) *IPAMPrefixesAvailablePrefixesCreateParams { + var () + return &IPAMPrefixesAvailablePrefixesCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesAvailablePrefixesCreateParamsWithContext creates a new IPAMPrefixesAvailablePrefixesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesAvailablePrefixesCreateParamsWithContext(ctx context.Context) *IPAMPrefixesAvailablePrefixesCreateParams { + var () + return &IPAMPrefixesAvailablePrefixesCreateParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesAvailablePrefixesCreateParamsWithHTTPClient creates a new IPAMPrefixesAvailablePrefixesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesAvailablePrefixesCreateParamsWithHTTPClient(client *http.Client) *IPAMPrefixesAvailablePrefixesCreateParams { + var () + return &IPAMPrefixesAvailablePrefixesCreateParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesAvailablePrefixesCreateParams contains all the parameters to send to the API endpoint +for the ipam prefixes available prefixes create operation typically these are written to a http.Request +*/ +type IPAMPrefixesAvailablePrefixesCreateParams struct { + + /*Data*/ + Data *models.Prefix + /*ID + A unique integer value identifying this prefix. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) WithTimeout(timeout time.Duration) *IPAMPrefixesAvailablePrefixesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) WithContext(ctx context.Context) *IPAMPrefixesAvailablePrefixesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) WithHTTPClient(client *http.Client) *IPAMPrefixesAvailablePrefixesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) WithData(data *models.Prefix) *IPAMPrefixesAvailablePrefixesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) SetData(data *models.Prefix) { + o.Data = data +} + +// WithID adds the id to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) WithID(id int64) *IPAMPrefixesAvailablePrefixesCreateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesAvailablePrefixesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_prefixes_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_prefixes_create_responses.go new file mode 100644 index 0000000..c34039f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_prefixes_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMPrefixesAvailablePrefixesCreateReader is a Reader for the IPAMPrefixesAvailablePrefixesCreate structure. +type IPAMPrefixesAvailablePrefixesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesAvailablePrefixesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMPrefixesAvailablePrefixesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMPrefixesAvailablePrefixesCreateCreated creates a IPAMPrefixesAvailablePrefixesCreateCreated with default headers values +func NewIPAMPrefixesAvailablePrefixesCreateCreated() *IPAMPrefixesAvailablePrefixesCreateCreated { + return &IPAMPrefixesAvailablePrefixesCreateCreated{} +} + +/*IPAMPrefixesAvailablePrefixesCreateCreated handles this case with default header values. + +IPAMPrefixesAvailablePrefixesCreateCreated ipam prefixes available prefixes create created +*/ +type IPAMPrefixesAvailablePrefixesCreateCreated struct { + 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) 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 { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_prefixes_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_prefixes_read_parameters.go new file mode 100644 index 0000000..ffe2c3c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_prefixes_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMPrefixesAvailablePrefixesReadParams creates a new IPAMPrefixesAvailablePrefixesReadParams object +// with the default values initialized. +func NewIPAMPrefixesAvailablePrefixesReadParams() *IPAMPrefixesAvailablePrefixesReadParams { + var () + return &IPAMPrefixesAvailablePrefixesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesAvailablePrefixesReadParamsWithTimeout creates a new IPAMPrefixesAvailablePrefixesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesAvailablePrefixesReadParamsWithTimeout(timeout time.Duration) *IPAMPrefixesAvailablePrefixesReadParams { + var () + return &IPAMPrefixesAvailablePrefixesReadParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesAvailablePrefixesReadParamsWithContext creates a new IPAMPrefixesAvailablePrefixesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesAvailablePrefixesReadParamsWithContext(ctx context.Context) *IPAMPrefixesAvailablePrefixesReadParams { + var () + return &IPAMPrefixesAvailablePrefixesReadParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesAvailablePrefixesReadParamsWithHTTPClient creates a new IPAMPrefixesAvailablePrefixesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesAvailablePrefixesReadParamsWithHTTPClient(client *http.Client) *IPAMPrefixesAvailablePrefixesReadParams { + var () + return &IPAMPrefixesAvailablePrefixesReadParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesAvailablePrefixesReadParams contains all the parameters to send to the API endpoint +for the ipam prefixes available prefixes read operation typically these are written to a http.Request +*/ +type IPAMPrefixesAvailablePrefixesReadParams struct { + + /*ID + A unique integer value identifying this prefix. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam prefixes available prefixes read params +func (o *IPAMPrefixesAvailablePrefixesReadParams) WithTimeout(timeout time.Duration) *IPAMPrefixesAvailablePrefixesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes available prefixes read params +func (o *IPAMPrefixesAvailablePrefixesReadParams) 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 { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes available prefixes read params +func (o *IPAMPrefixesAvailablePrefixesReadParams) 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 { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes available prefixes read params +func (o *IPAMPrefixesAvailablePrefixesReadParams) 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 { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam prefixes available prefixes read params +func (o *IPAMPrefixesAvailablePrefixesReadParams) 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 { + + 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_prefixes_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_prefixes_read_responses.go new file mode 100644 index 0000000..4ae9449 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_available_prefixes_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMPrefixesAvailablePrefixesReadReader is a Reader for the IPAMPrefixesAvailablePrefixesRead structure. +type IPAMPrefixesAvailablePrefixesReadReader 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) { + switch response.Code() { + + case 200: + result := NewIPAMPrefixesAvailablePrefixesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMPrefixesAvailablePrefixesReadOK creates a IPAMPrefixesAvailablePrefixesReadOK with default headers values +func NewIPAMPrefixesAvailablePrefixesReadOK() *IPAMPrefixesAvailablePrefixesReadOK { + return &IPAMPrefixesAvailablePrefixesReadOK{} +} + +/*IPAMPrefixesAvailablePrefixesReadOK handles this case with default header values. + +IPAMPrefixesAvailablePrefixesReadOK ipam prefixes available prefixes read o k +*/ +type IPAMPrefixesAvailablePrefixesReadOK struct { + Payload *models.Prefix +} + +func (o *IPAMPrefixesAvailablePrefixesReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/prefixes/{id}/available-prefixes/][%d] ipamPrefixesAvailablePrefixesReadOK %+v", 200, o.Payload) +} + +func (o *IPAMPrefixesAvailablePrefixesReadOK) 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 { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_create_parameters.go new file mode 100644 index 0000000..8eb3712 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMPrefixesCreateParams creates a new IPAMPrefixesCreateParams object +// with the default values initialized. +func NewIPAMPrefixesCreateParams() *IPAMPrefixesCreateParams { + var () + return &IPAMPrefixesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesCreateParamsWithTimeout creates a new IPAMPrefixesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesCreateParamsWithTimeout(timeout time.Duration) *IPAMPrefixesCreateParams { + var () + return &IPAMPrefixesCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesCreateParamsWithContext creates a new IPAMPrefixesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesCreateParamsWithContext(ctx context.Context) *IPAMPrefixesCreateParams { + var () + return &IPAMPrefixesCreateParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesCreateParamsWithHTTPClient creates a new IPAMPrefixesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesCreateParamsWithHTTPClient(client *http.Client) *IPAMPrefixesCreateParams { + var () + return &IPAMPrefixesCreateParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesCreateParams contains all the parameters to send to the API endpoint +for the ipam prefixes create operation typically these are written to a http.Request +*/ +type IPAMPrefixesCreateParams struct { + + /*Data*/ + Data *models.WritablePrefix + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam prefixes create params +func (o *IPAMPrefixesCreateParams) WithTimeout(timeout time.Duration) *IPAMPrefixesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes create params +func (o *IPAMPrefixesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes create params +func (o *IPAMPrefixesCreateParams) WithContext(ctx context.Context) *IPAMPrefixesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes create params +func (o *IPAMPrefixesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes create params +func (o *IPAMPrefixesCreateParams) WithHTTPClient(client *http.Client) *IPAMPrefixesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes create params +func (o *IPAMPrefixesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam prefixes create params +func (o *IPAMPrefixesCreateParams) WithData(data *models.WritablePrefix) *IPAMPrefixesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam prefixes create params +func (o *IPAMPrefixesCreateParams) SetData(data *models.WritablePrefix) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_create_responses.go new file mode 100644 index 0000000..744b7d2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMPrefixesCreateReader is a Reader for the IPAMPrefixesCreate structure. +type IPAMPrefixesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMPrefixesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMPrefixesCreateCreated creates a IPAMPrefixesCreateCreated with default headers values +func NewIPAMPrefixesCreateCreated() *IPAMPrefixesCreateCreated { + return &IPAMPrefixesCreateCreated{} +} + +/*IPAMPrefixesCreateCreated handles this case with default header values. + +IPAMPrefixesCreateCreated ipam prefixes create created +*/ +type IPAMPrefixesCreateCreated struct { + Payload *models.WritablePrefix +} + +func (o *IPAMPrefixesCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/prefixes/][%d] ipamPrefixesCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMPrefixesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePrefix) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_delete_parameters.go new file mode 100644 index 0000000..f3ca330 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMPrefixesDeleteParams creates a new IPAMPrefixesDeleteParams object +// with the default values initialized. +func NewIPAMPrefixesDeleteParams() *IPAMPrefixesDeleteParams { + var () + return &IPAMPrefixesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesDeleteParamsWithTimeout creates a new IPAMPrefixesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesDeleteParamsWithTimeout(timeout time.Duration) *IPAMPrefixesDeleteParams { + var () + return &IPAMPrefixesDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesDeleteParamsWithContext creates a new IPAMPrefixesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesDeleteParamsWithContext(ctx context.Context) *IPAMPrefixesDeleteParams { + var () + return &IPAMPrefixesDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesDeleteParamsWithHTTPClient creates a new IPAMPrefixesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesDeleteParamsWithHTTPClient(client *http.Client) *IPAMPrefixesDeleteParams { + var () + return &IPAMPrefixesDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesDeleteParams contains all the parameters to send to the API endpoint +for the ipam prefixes delete operation typically these are written to a http.Request +*/ +type IPAMPrefixesDeleteParams struct { + + /*ID + A unique integer value identifying this prefix. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam prefixes delete params +func (o *IPAMPrefixesDeleteParams) WithTimeout(timeout time.Duration) *IPAMPrefixesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes delete params +func (o *IPAMPrefixesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes delete params +func (o *IPAMPrefixesDeleteParams) WithContext(ctx context.Context) *IPAMPrefixesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes delete params +func (o *IPAMPrefixesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes delete params +func (o *IPAMPrefixesDeleteParams) WithHTTPClient(client *http.Client) *IPAMPrefixesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes delete params +func (o *IPAMPrefixesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam prefixes delete params +func (o *IPAMPrefixesDeleteParams) WithID(id int64) *IPAMPrefixesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam prefixes delete params +func (o *IPAMPrefixesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_delete_responses.go new file mode 100644 index 0000000..c9668b8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMPrefixesDeleteReader is a Reader for the IPAMPrefixesDelete structure. +type IPAMPrefixesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMPrefixesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMPrefixesDeleteNoContent creates a IPAMPrefixesDeleteNoContent with default headers values +func NewIPAMPrefixesDeleteNoContent() *IPAMPrefixesDeleteNoContent { + return &IPAMPrefixesDeleteNoContent{} +} + +/*IPAMPrefixesDeleteNoContent handles this case with default header values. + +IPAMPrefixesDeleteNoContent ipam prefixes delete no content +*/ +type IPAMPrefixesDeleteNoContent struct { +} + +func (o *IPAMPrefixesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/prefixes/{id}/][%d] ipamPrefixesDeleteNoContent ", 204) +} + +func (o *IPAMPrefixesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_list_parameters.go new file mode 100644 index 0000000..2223c81 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_list_parameters.go @@ -0,0 +1,749 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMPrefixesListParams creates a new IPAMPrefixesListParams object +// with the default values initialized. +func NewIPAMPrefixesListParams() *IPAMPrefixesListParams { + var () + return &IPAMPrefixesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesListParamsWithTimeout creates a new IPAMPrefixesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesListParamsWithTimeout(timeout time.Duration) *IPAMPrefixesListParams { + var () + return &IPAMPrefixesListParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesListParamsWithContext creates a new IPAMPrefixesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesListParamsWithContext(ctx context.Context) *IPAMPrefixesListParams { + var () + return &IPAMPrefixesListParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesListParamsWithHTTPClient creates a new IPAMPrefixesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesListParamsWithHTTPClient(client *http.Client) *IPAMPrefixesListParams { + var () + return &IPAMPrefixesListParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesListParams contains all the parameters to send to the API endpoint +for the ipam prefixes list operation typically these are written to a http.Request +*/ +type IPAMPrefixesListParams struct { + + /*Contains*/ + Contains *string + /*Family*/ + Family *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*IsPool*/ + IsPool *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*MaskLength*/ + MaskLength *float64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Role*/ + Role *string + /*RoleID*/ + RoleID *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Status*/ + Status *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + /*VlanID*/ + VlanID *string + /*VlanVid*/ + VlanVid *float64 + /*Vrf*/ + Vrf *string + /*VrfID*/ + VrfID *string + /*Within*/ + Within *string + /*WithinInclude*/ + WithinInclude *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithTimeout(timeout time.Duration) *IPAMPrefixesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithContext(ctx context.Context) *IPAMPrefixesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithHTTPClient(client *http.Client) *IPAMPrefixesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithContains adds the contains to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithContains(contains *string) *IPAMPrefixesListParams { + o.SetContains(contains) + return o +} + +// SetContains adds the contains to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetContains(contains *string) { + o.Contains = contains +} + +// WithFamily adds the family to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithFamily(family *string) *IPAMPrefixesListParams { + o.SetFamily(family) + return o +} + +// SetFamily adds the family to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetFamily(family *string) { + o.Family = family +} + +// WithIDIn adds the iDIn to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithIDIn(iDIn *string) *IPAMPrefixesListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithIsPool adds the isPool to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithIsPool(isPool *string) *IPAMPrefixesListParams { + o.SetIsPool(isPool) + return o +} + +// SetIsPool adds the isPool to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetIsPool(isPool *string) { + o.IsPool = isPool +} + +// WithLimit adds the limit to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithLimit(limit *int64) *IPAMPrefixesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithMaskLength adds the maskLength to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithMaskLength(maskLength *float64) *IPAMPrefixesListParams { + o.SetMaskLength(maskLength) + return o +} + +// SetMaskLength adds the maskLength to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetMaskLength(maskLength *float64) { + o.MaskLength = maskLength +} + +// WithOffset adds the offset to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithOffset(offset *int64) *IPAMPrefixesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithQ(q *string) *IPAMPrefixesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetQ(q *string) { + o.Q = q +} + +// WithRole adds the role to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithRole(role *string) *IPAMPrefixesListParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetRole(role *string) { + o.Role = role +} + +// WithRoleID adds the roleID to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithRoleID(roleID *string) *IPAMPrefixesListParams { + o.SetRoleID(roleID) + return o +} + +// SetRoleID adds the roleId to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetRoleID(roleID *string) { + o.RoleID = roleID +} + +// WithSite adds the site to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithSite(site *string) *IPAMPrefixesListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithSiteID(siteID *string) *IPAMPrefixesListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithStatus adds the status to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithStatus(status *string) *IPAMPrefixesListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetStatus(status *string) { + o.Status = status +} + +// WithTenant adds the tenant to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithTenant(tenant *string) *IPAMPrefixesListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithTenantID(tenantID *string) *IPAMPrefixesListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WithVlanID adds the vlanID to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithVlanID(vlanID *string) *IPAMPrefixesListParams { + o.SetVlanID(vlanID) + return o +} + +// SetVlanID adds the vlanId to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetVlanID(vlanID *string) { + o.VlanID = vlanID +} + +// WithVlanVid adds the vlanVid to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithVlanVid(vlanVid *float64) *IPAMPrefixesListParams { + o.SetVlanVid(vlanVid) + return o +} + +// SetVlanVid adds the vlanVid to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetVlanVid(vlanVid *float64) { + o.VlanVid = vlanVid +} + +// WithVrf adds the vrf to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithVrf(vrf *string) *IPAMPrefixesListParams { + o.SetVrf(vrf) + return o +} + +// SetVrf adds the vrf to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetVrf(vrf *string) { + o.Vrf = vrf +} + +// WithVrfID adds the vrfID to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithVrfID(vrfID *string) *IPAMPrefixesListParams { + o.SetVrfID(vrfID) + return o +} + +// SetVrfID adds the vrfId to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetVrfID(vrfID *string) { + o.VrfID = vrfID +} + +// WithWithin adds the within to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithWithin(within *string) *IPAMPrefixesListParams { + o.SetWithin(within) + return o +} + +// SetWithin adds the within to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetWithin(within *string) { + o.Within = within +} + +// WithWithinInclude adds the withinInclude to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithWithinInclude(withinInclude *string) *IPAMPrefixesListParams { + o.SetWithinInclude(withinInclude) + return o +} + +// SetWithinInclude adds the withinInclude to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetWithinInclude(withinInclude *string) { + o.WithinInclude = withinInclude +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Contains != nil { + + // query param contains + var qrContains string + if o.Contains != nil { + qrContains = *o.Contains + } + qContains := qrContains + if qContains != "" { + if err := r.SetQueryParam("contains", qContains); err != nil { + return err + } + } + + } + + if o.Family != nil { + + // query param family + var qrFamily string + if o.Family != nil { + qrFamily = *o.Family + } + qFamily := qrFamily + if qFamily != "" { + if err := r.SetQueryParam("family", qFamily); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.IsPool != nil { + + // query param is_pool + var qrIsPool string + if o.IsPool != nil { + qrIsPool = *o.IsPool + } + qIsPool := qrIsPool + if qIsPool != "" { + if err := r.SetQueryParam("is_pool", qIsPool); 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.MaskLength != nil { + + // query param mask_length + var qrMaskLength float64 + if o.MaskLength != nil { + qrMaskLength = *o.MaskLength + } + qMaskLength := swag.FormatFloat64(qrMaskLength) + if qMaskLength != "" { + if err := r.SetQueryParam("mask_length", qMaskLength); 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.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.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.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.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.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.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.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.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.VlanVid != nil { + + // query param vlan_vid + var qrVlanVid float64 + if o.VlanVid != nil { + qrVlanVid = *o.VlanVid + } + qVlanVid := swag.FormatFloat64(qrVlanVid) + if qVlanVid != "" { + if err := r.SetQueryParam("vlan_vid", qVlanVid); err != nil { + return err + } + } + + } + + if o.Vrf != nil { + + // query param vrf + var qrVrf string + if o.Vrf != nil { + qrVrf = *o.Vrf + } + qVrf := qrVrf + if qVrf != "" { + if err := r.SetQueryParam("vrf", qVrf); err != nil { + return err + } + } + + } + + if o.VrfID != nil { + + // query param vrf_id + var qrVrfID string + if o.VrfID != nil { + qrVrfID = *o.VrfID + } + qVrfID := qrVrfID + if qVrfID != "" { + if err := r.SetQueryParam("vrf_id", qVrfID); err != nil { + return err + } + } + + } + + if o.Within != nil { + + // query param within + var qrWithin string + if o.Within != nil { + qrWithin = *o.Within + } + qWithin := qrWithin + if qWithin != "" { + if err := r.SetQueryParam("within", qWithin); err != nil { + return err + } + } + + } + + if o.WithinInclude != nil { + + // query param within_include + var qrWithinInclude string + if o.WithinInclude != nil { + qrWithinInclude = *o.WithinInclude + } + qWithinInclude := qrWithinInclude + if qWithinInclude != "" { + if err := r.SetQueryParam("within_include", qWithinInclude); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_list_responses.go new file mode 100644 index 0000000..47a823c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMPrefixesListReader is a Reader for the IPAMPrefixesList structure. +type IPAMPrefixesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMPrefixesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMPrefixesListOK creates a IPAMPrefixesListOK with default headers values +func NewIPAMPrefixesListOK() *IPAMPrefixesListOK { + return &IPAMPrefixesListOK{} +} + +/*IPAMPrefixesListOK handles this case with default header values. + +IPAMPrefixesListOK ipam prefixes list o k +*/ +type IPAMPrefixesListOK struct { + Payload *models.IPAMPrefixesListOKBody +} + +func (o *IPAMPrefixesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/prefixes/][%d] ipamPrefixesListOK %+v", 200, o.Payload) +} + +func (o *IPAMPrefixesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMPrefixesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_partial_update_parameters.go new file mode 100644 index 0000000..d48c984 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMPrefixesPartialUpdateParams creates a new IPAMPrefixesPartialUpdateParams object +// with the default values initialized. +func NewIPAMPrefixesPartialUpdateParams() *IPAMPrefixesPartialUpdateParams { + var () + return &IPAMPrefixesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesPartialUpdateParamsWithTimeout creates a new IPAMPrefixesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMPrefixesPartialUpdateParams { + var () + return &IPAMPrefixesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesPartialUpdateParamsWithContext creates a new IPAMPrefixesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesPartialUpdateParamsWithContext(ctx context.Context) *IPAMPrefixesPartialUpdateParams { + var () + return &IPAMPrefixesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesPartialUpdateParamsWithHTTPClient creates a new IPAMPrefixesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMPrefixesPartialUpdateParams { + var () + return &IPAMPrefixesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam prefixes partial update operation typically these are written to a http.Request +*/ +type IPAMPrefixesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritablePrefix + /*ID + A unique integer value identifying this prefix. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMPrefixesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) WithContext(ctx context.Context) *IPAMPrefixesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMPrefixesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) WithData(data *models.WritablePrefix) *IPAMPrefixesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) SetData(data *models.WritablePrefix) { + o.Data = data +} + +// WithID adds the id to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) WithID(id int64) *IPAMPrefixesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_partial_update_responses.go new file mode 100644 index 0000000..96e1838 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMPrefixesPartialUpdateReader is a Reader for the IPAMPrefixesPartialUpdate structure. +type IPAMPrefixesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMPrefixesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMPrefixesPartialUpdateOK creates a IPAMPrefixesPartialUpdateOK with default headers values +func NewIPAMPrefixesPartialUpdateOK() *IPAMPrefixesPartialUpdateOK { + return &IPAMPrefixesPartialUpdateOK{} +} + +/*IPAMPrefixesPartialUpdateOK handles this case with default header values. + +IPAMPrefixesPartialUpdateOK ipam prefixes partial update o k +*/ +type IPAMPrefixesPartialUpdateOK struct { + Payload *models.WritablePrefix +} + +func (o *IPAMPrefixesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/prefixes/{id}/][%d] ipamPrefixesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMPrefixesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePrefix) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_read_parameters.go new file mode 100644 index 0000000..7ec788c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMPrefixesReadParams creates a new IPAMPrefixesReadParams object +// with the default values initialized. +func NewIPAMPrefixesReadParams() *IPAMPrefixesReadParams { + var () + return &IPAMPrefixesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesReadParamsWithTimeout creates a new IPAMPrefixesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesReadParamsWithTimeout(timeout time.Duration) *IPAMPrefixesReadParams { + var () + return &IPAMPrefixesReadParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesReadParamsWithContext creates a new IPAMPrefixesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesReadParamsWithContext(ctx context.Context) *IPAMPrefixesReadParams { + var () + return &IPAMPrefixesReadParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesReadParamsWithHTTPClient creates a new IPAMPrefixesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesReadParamsWithHTTPClient(client *http.Client) *IPAMPrefixesReadParams { + var () + return &IPAMPrefixesReadParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesReadParams contains all the parameters to send to the API endpoint +for the ipam prefixes read operation typically these are written to a http.Request +*/ +type IPAMPrefixesReadParams struct { + + /*ID + A unique integer value identifying this prefix. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam prefixes read params +func (o *IPAMPrefixesReadParams) WithTimeout(timeout time.Duration) *IPAMPrefixesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes read params +func (o *IPAMPrefixesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes read params +func (o *IPAMPrefixesReadParams) WithContext(ctx context.Context) *IPAMPrefixesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes read params +func (o *IPAMPrefixesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes read params +func (o *IPAMPrefixesReadParams) WithHTTPClient(client *http.Client) *IPAMPrefixesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes read params +func (o *IPAMPrefixesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam prefixes read params +func (o *IPAMPrefixesReadParams) WithID(id int64) *IPAMPrefixesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam prefixes read params +func (o *IPAMPrefixesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_read_responses.go new file mode 100644 index 0000000..b86b914 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMPrefixesReadReader is a Reader for the IPAMPrefixesRead structure. +type IPAMPrefixesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMPrefixesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMPrefixesReadOK creates a IPAMPrefixesReadOK with default headers values +func NewIPAMPrefixesReadOK() *IPAMPrefixesReadOK { + return &IPAMPrefixesReadOK{} +} + +/*IPAMPrefixesReadOK handles this case with default header values. + +IPAMPrefixesReadOK ipam prefixes read o k +*/ +type IPAMPrefixesReadOK struct { + Payload *models.Prefix +} + +func (o *IPAMPrefixesReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/prefixes/{id}/][%d] ipamPrefixesReadOK %+v", 200, o.Payload) +} + +func (o *IPAMPrefixesReadOK) 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 { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_update_parameters.go new file mode 100644 index 0000000..8d44888 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMPrefixesUpdateParams creates a new IPAMPrefixesUpdateParams object +// with the default values initialized. +func NewIPAMPrefixesUpdateParams() *IPAMPrefixesUpdateParams { + var () + return &IPAMPrefixesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesUpdateParamsWithTimeout creates a new IPAMPrefixesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesUpdateParamsWithTimeout(timeout time.Duration) *IPAMPrefixesUpdateParams { + var () + return &IPAMPrefixesUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesUpdateParamsWithContext creates a new IPAMPrefixesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesUpdateParamsWithContext(ctx context.Context) *IPAMPrefixesUpdateParams { + var () + return &IPAMPrefixesUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesUpdateParamsWithHTTPClient creates a new IPAMPrefixesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesUpdateParamsWithHTTPClient(client *http.Client) *IPAMPrefixesUpdateParams { + var () + return &IPAMPrefixesUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesUpdateParams contains all the parameters to send to the API endpoint +for the ipam prefixes update operation typically these are written to a http.Request +*/ +type IPAMPrefixesUpdateParams struct { + + /*Data*/ + Data *models.WritablePrefix + /*ID + A unique integer value identifying this prefix. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) WithTimeout(timeout time.Duration) *IPAMPrefixesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) WithContext(ctx context.Context) *IPAMPrefixesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) WithHTTPClient(client *http.Client) *IPAMPrefixesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) WithData(data *models.WritablePrefix) *IPAMPrefixesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) SetData(data *models.WritablePrefix) { + o.Data = data +} + +// WithID adds the id to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) WithID(id int64) *IPAMPrefixesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_update_responses.go new file mode 100644 index 0000000..d292f5e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amprefixes_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMPrefixesUpdateReader is a Reader for the IPAMPrefixesUpdate structure. +type IPAMPrefixesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMPrefixesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMPrefixesUpdateOK creates a IPAMPrefixesUpdateOK with default headers values +func NewIPAMPrefixesUpdateOK() *IPAMPrefixesUpdateOK { + return &IPAMPrefixesUpdateOK{} +} + +/*IPAMPrefixesUpdateOK handles this case with default header values. + +IPAMPrefixesUpdateOK ipam prefixes update o k +*/ +type IPAMPrefixesUpdateOK struct { + Payload *models.WritablePrefix +} + +func (o *IPAMPrefixesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/prefixes/{id}/][%d] ipamPrefixesUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMPrefixesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePrefix) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_create_parameters.go new file mode 100644 index 0000000..d0f1747 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMRirsCreateParams creates a new IPAMRirsCreateParams object +// with the default values initialized. +func NewIPAMRirsCreateParams() *IPAMRirsCreateParams { + var () + return &IPAMRirsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRirsCreateParamsWithTimeout creates a new IPAMRirsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRirsCreateParamsWithTimeout(timeout time.Duration) *IPAMRirsCreateParams { + var () + return &IPAMRirsCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMRirsCreateParamsWithContext creates a new IPAMRirsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRirsCreateParamsWithContext(ctx context.Context) *IPAMRirsCreateParams { + var () + return &IPAMRirsCreateParams{ + + Context: ctx, + } +} + +// NewIPAMRirsCreateParamsWithHTTPClient creates a new IPAMRirsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRirsCreateParamsWithHTTPClient(client *http.Client) *IPAMRirsCreateParams { + var () + return &IPAMRirsCreateParams{ + HTTPClient: client, + } +} + +/*IPAMRirsCreateParams contains all the parameters to send to the API endpoint +for the ipam rirs create operation typically these are written to a http.Request +*/ +type IPAMRirsCreateParams struct { + + /*Data*/ + Data *models.RIR + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam rirs create params +func (o *IPAMRirsCreateParams) WithTimeout(timeout time.Duration) *IPAMRirsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam rirs create params +func (o *IPAMRirsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam rirs create params +func (o *IPAMRirsCreateParams) WithContext(ctx context.Context) *IPAMRirsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam rirs create params +func (o *IPAMRirsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam rirs create params +func (o *IPAMRirsCreateParams) WithHTTPClient(client *http.Client) *IPAMRirsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam rirs create params +func (o *IPAMRirsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam rirs create params +func (o *IPAMRirsCreateParams) WithData(data *models.RIR) *IPAMRirsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam rirs create params +func (o *IPAMRirsCreateParams) SetData(data *models.RIR) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRirsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_create_responses.go new file mode 100644 index 0000000..6bc360b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMRirsCreateReader is a Reader for the IPAMRirsCreate structure. +type IPAMRirsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRirsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMRirsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMRirsCreateCreated creates a IPAMRirsCreateCreated with default headers values +func NewIPAMRirsCreateCreated() *IPAMRirsCreateCreated { + return &IPAMRirsCreateCreated{} +} + +/*IPAMRirsCreateCreated handles this case with default header values. + +IPAMRirsCreateCreated ipam rirs create created +*/ +type IPAMRirsCreateCreated struct { + Payload *models.RIR +} + +func (o *IPAMRirsCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/rirs/][%d] ipamRirsCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMRirsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RIR) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_delete_parameters.go new file mode 100644 index 0000000..17f1be4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMRirsDeleteParams creates a new IPAMRirsDeleteParams object +// with the default values initialized. +func NewIPAMRirsDeleteParams() *IPAMRirsDeleteParams { + var () + return &IPAMRirsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRirsDeleteParamsWithTimeout creates a new IPAMRirsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRirsDeleteParamsWithTimeout(timeout time.Duration) *IPAMRirsDeleteParams { + var () + return &IPAMRirsDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMRirsDeleteParamsWithContext creates a new IPAMRirsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRirsDeleteParamsWithContext(ctx context.Context) *IPAMRirsDeleteParams { + var () + return &IPAMRirsDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMRirsDeleteParamsWithHTTPClient creates a new IPAMRirsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRirsDeleteParamsWithHTTPClient(client *http.Client) *IPAMRirsDeleteParams { + var () + return &IPAMRirsDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMRirsDeleteParams contains all the parameters to send to the API endpoint +for the ipam rirs delete operation typically these are written to a http.Request +*/ +type IPAMRirsDeleteParams struct { + + /*ID + A unique integer value identifying this RIR. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam rirs delete params +func (o *IPAMRirsDeleteParams) WithTimeout(timeout time.Duration) *IPAMRirsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam rirs delete params +func (o *IPAMRirsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam rirs delete params +func (o *IPAMRirsDeleteParams) WithContext(ctx context.Context) *IPAMRirsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam rirs delete params +func (o *IPAMRirsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam rirs delete params +func (o *IPAMRirsDeleteParams) WithHTTPClient(client *http.Client) *IPAMRirsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam rirs delete params +func (o *IPAMRirsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam rirs delete params +func (o *IPAMRirsDeleteParams) WithID(id int64) *IPAMRirsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam rirs delete params +func (o *IPAMRirsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRirsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_delete_responses.go new file mode 100644 index 0000000..2aeebcb --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMRirsDeleteReader is a Reader for the IPAMRirsDelete structure. +type IPAMRirsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRirsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMRirsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMRirsDeleteNoContent creates a IPAMRirsDeleteNoContent with default headers values +func NewIPAMRirsDeleteNoContent() *IPAMRirsDeleteNoContent { + return &IPAMRirsDeleteNoContent{} +} + +/*IPAMRirsDeleteNoContent handles this case with default header values. + +IPAMRirsDeleteNoContent ipam rirs delete no content +*/ +type IPAMRirsDeleteNoContent struct { +} + +func (o *IPAMRirsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/rirs/{id}/][%d] ipamRirsDeleteNoContent ", 204) +} + +func (o *IPAMRirsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_list_parameters.go new file mode 100644 index 0000000..26d18de --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_list_parameters.go @@ -0,0 +1,314 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMRirsListParams creates a new IPAMRirsListParams object +// with the default values initialized. +func NewIPAMRirsListParams() *IPAMRirsListParams { + var () + return &IPAMRirsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRirsListParamsWithTimeout creates a new IPAMRirsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRirsListParamsWithTimeout(timeout time.Duration) *IPAMRirsListParams { + var () + return &IPAMRirsListParams{ + + timeout: timeout, + } +} + +// NewIPAMRirsListParamsWithContext creates a new IPAMRirsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRirsListParamsWithContext(ctx context.Context) *IPAMRirsListParams { + var () + return &IPAMRirsListParams{ + + Context: ctx, + } +} + +// NewIPAMRirsListParamsWithHTTPClient creates a new IPAMRirsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRirsListParamsWithHTTPClient(client *http.Client) *IPAMRirsListParams { + var () + return &IPAMRirsListParams{ + HTTPClient: client, + } +} + +/*IPAMRirsListParams contains all the parameters to send to the API endpoint +for the ipam rirs list operation typically these are written to a http.Request +*/ +type IPAMRirsListParams struct { + + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*IsPrivate*/ + IsPrivate *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam rirs list params +func (o *IPAMRirsListParams) WithTimeout(timeout time.Duration) *IPAMRirsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam rirs list params +func (o *IPAMRirsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam rirs list params +func (o *IPAMRirsListParams) WithContext(ctx context.Context) *IPAMRirsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam rirs list params +func (o *IPAMRirsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam rirs list params +func (o *IPAMRirsListParams) WithHTTPClient(client *http.Client) *IPAMRirsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam rirs list params +func (o *IPAMRirsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIDIn adds the iDIn to the ipam rirs list params +func (o *IPAMRirsListParams) WithIDIn(iDIn *string) *IPAMRirsListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the ipam rirs list params +func (o *IPAMRirsListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithIsPrivate adds the isPrivate to the ipam rirs list params +func (o *IPAMRirsListParams) WithIsPrivate(isPrivate *string) *IPAMRirsListParams { + o.SetIsPrivate(isPrivate) + return o +} + +// SetIsPrivate adds the isPrivate to the ipam rirs list params +func (o *IPAMRirsListParams) SetIsPrivate(isPrivate *string) { + o.IsPrivate = isPrivate +} + +// WithLimit adds the limit to the ipam rirs list params +func (o *IPAMRirsListParams) WithLimit(limit *int64) *IPAMRirsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam rirs list params +func (o *IPAMRirsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the ipam rirs list params +func (o *IPAMRirsListParams) WithName(name *string) *IPAMRirsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the ipam rirs list params +func (o *IPAMRirsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the ipam rirs list params +func (o *IPAMRirsListParams) WithOffset(offset *int64) *IPAMRirsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam rirs list params +func (o *IPAMRirsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the ipam rirs list params +func (o *IPAMRirsListParams) WithSlug(slug *string) *IPAMRirsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the ipam rirs list params +func (o *IPAMRirsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRirsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.IsPrivate != nil { + + // query param is_private + var qrIsPrivate string + if o.IsPrivate != nil { + qrIsPrivate = *o.IsPrivate + } + qIsPrivate := qrIsPrivate + if qIsPrivate != "" { + if err := r.SetQueryParam("is_private", qIsPrivate); 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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_list_responses.go new file mode 100644 index 0000000..4cdfdd8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMRirsListReader is a Reader for the IPAMRirsList structure. +type IPAMRirsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRirsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRirsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMRirsListOK creates a IPAMRirsListOK with default headers values +func NewIPAMRirsListOK() *IPAMRirsListOK { + return &IPAMRirsListOK{} +} + +/*IPAMRirsListOK handles this case with default header values. + +IPAMRirsListOK ipam rirs list o k +*/ +type IPAMRirsListOK struct { + Payload *models.IPAMRirsListOKBody +} + +func (o *IPAMRirsListOK) Error() string { + return fmt.Sprintf("[GET /ipam/rirs/][%d] ipamRirsListOK %+v", 200, o.Payload) +} + +func (o *IPAMRirsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMRirsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_partial_update_parameters.go new file mode 100644 index 0000000..9f6f306 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMRirsPartialUpdateParams creates a new IPAMRirsPartialUpdateParams object +// with the default values initialized. +func NewIPAMRirsPartialUpdateParams() *IPAMRirsPartialUpdateParams { + var () + return &IPAMRirsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRirsPartialUpdateParamsWithTimeout creates a new IPAMRirsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRirsPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMRirsPartialUpdateParams { + var () + return &IPAMRirsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMRirsPartialUpdateParamsWithContext creates a new IPAMRirsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRirsPartialUpdateParamsWithContext(ctx context.Context) *IPAMRirsPartialUpdateParams { + var () + return &IPAMRirsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMRirsPartialUpdateParamsWithHTTPClient creates a new IPAMRirsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRirsPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMRirsPartialUpdateParams { + var () + return &IPAMRirsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMRirsPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam rirs partial update operation typically these are written to a http.Request +*/ +type IPAMRirsPartialUpdateParams struct { + + /*Data*/ + Data *models.RIR + /*ID + A unique integer value identifying this RIR. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMRirsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) WithContext(ctx context.Context) *IPAMRirsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMRirsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) WithData(data *models.RIR) *IPAMRirsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) SetData(data *models.RIR) { + o.Data = data +} + +// WithID adds the id to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) WithID(id int64) *IPAMRirsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRirsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_partial_update_responses.go new file mode 100644 index 0000000..fc3375b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMRirsPartialUpdateReader is a Reader for the IPAMRirsPartialUpdate structure. +type IPAMRirsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRirsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRirsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMRirsPartialUpdateOK creates a IPAMRirsPartialUpdateOK with default headers values +func NewIPAMRirsPartialUpdateOK() *IPAMRirsPartialUpdateOK { + return &IPAMRirsPartialUpdateOK{} +} + +/*IPAMRirsPartialUpdateOK handles this case with default header values. + +IPAMRirsPartialUpdateOK ipam rirs partial update o k +*/ +type IPAMRirsPartialUpdateOK struct { + Payload *models.RIR +} + +func (o *IPAMRirsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/rirs/{id}/][%d] ipamRirsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMRirsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RIR) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_read_parameters.go new file mode 100644 index 0000000..5a09b46 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMRirsReadParams creates a new IPAMRirsReadParams object +// with the default values initialized. +func NewIPAMRirsReadParams() *IPAMRirsReadParams { + var () + return &IPAMRirsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRirsReadParamsWithTimeout creates a new IPAMRirsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRirsReadParamsWithTimeout(timeout time.Duration) *IPAMRirsReadParams { + var () + return &IPAMRirsReadParams{ + + timeout: timeout, + } +} + +// NewIPAMRirsReadParamsWithContext creates a new IPAMRirsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRirsReadParamsWithContext(ctx context.Context) *IPAMRirsReadParams { + var () + return &IPAMRirsReadParams{ + + Context: ctx, + } +} + +// NewIPAMRirsReadParamsWithHTTPClient creates a new IPAMRirsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRirsReadParamsWithHTTPClient(client *http.Client) *IPAMRirsReadParams { + var () + return &IPAMRirsReadParams{ + HTTPClient: client, + } +} + +/*IPAMRirsReadParams contains all the parameters to send to the API endpoint +for the ipam rirs read operation typically these are written to a http.Request +*/ +type IPAMRirsReadParams struct { + + /*ID + A unique integer value identifying this RIR. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam rirs read params +func (o *IPAMRirsReadParams) WithTimeout(timeout time.Duration) *IPAMRirsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam rirs read params +func (o *IPAMRirsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam rirs read params +func (o *IPAMRirsReadParams) WithContext(ctx context.Context) *IPAMRirsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam rirs read params +func (o *IPAMRirsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam rirs read params +func (o *IPAMRirsReadParams) WithHTTPClient(client *http.Client) *IPAMRirsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam rirs read params +func (o *IPAMRirsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam rirs read params +func (o *IPAMRirsReadParams) WithID(id int64) *IPAMRirsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam rirs read params +func (o *IPAMRirsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRirsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_read_responses.go new file mode 100644 index 0000000..8a2865c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMRirsReadReader is a Reader for the IPAMRirsRead structure. +type IPAMRirsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRirsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRirsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMRirsReadOK creates a IPAMRirsReadOK with default headers values +func NewIPAMRirsReadOK() *IPAMRirsReadOK { + return &IPAMRirsReadOK{} +} + +/*IPAMRirsReadOK handles this case with default header values. + +IPAMRirsReadOK ipam rirs read o k +*/ +type IPAMRirsReadOK struct { + Payload *models.RIR +} + +func (o *IPAMRirsReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/rirs/{id}/][%d] ipamRirsReadOK %+v", 200, o.Payload) +} + +func (o *IPAMRirsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RIR) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_update_parameters.go new file mode 100644 index 0000000..3f0622f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMRirsUpdateParams creates a new IPAMRirsUpdateParams object +// with the default values initialized. +func NewIPAMRirsUpdateParams() *IPAMRirsUpdateParams { + var () + return &IPAMRirsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRirsUpdateParamsWithTimeout creates a new IPAMRirsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRirsUpdateParamsWithTimeout(timeout time.Duration) *IPAMRirsUpdateParams { + var () + return &IPAMRirsUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMRirsUpdateParamsWithContext creates a new IPAMRirsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRirsUpdateParamsWithContext(ctx context.Context) *IPAMRirsUpdateParams { + var () + return &IPAMRirsUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMRirsUpdateParamsWithHTTPClient creates a new IPAMRirsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRirsUpdateParamsWithHTTPClient(client *http.Client) *IPAMRirsUpdateParams { + var () + return &IPAMRirsUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMRirsUpdateParams contains all the parameters to send to the API endpoint +for the ipam rirs update operation typically these are written to a http.Request +*/ +type IPAMRirsUpdateParams struct { + + /*Data*/ + Data *models.RIR + /*ID + A unique integer value identifying this RIR. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam rirs update params +func (o *IPAMRirsUpdateParams) WithTimeout(timeout time.Duration) *IPAMRirsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam rirs update params +func (o *IPAMRirsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam rirs update params +func (o *IPAMRirsUpdateParams) WithContext(ctx context.Context) *IPAMRirsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam rirs update params +func (o *IPAMRirsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam rirs update params +func (o *IPAMRirsUpdateParams) WithHTTPClient(client *http.Client) *IPAMRirsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam rirs update params +func (o *IPAMRirsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam rirs update params +func (o *IPAMRirsUpdateParams) WithData(data *models.RIR) *IPAMRirsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam rirs update params +func (o *IPAMRirsUpdateParams) SetData(data *models.RIR) { + o.Data = data +} + +// WithID adds the id to the ipam rirs update params +func (o *IPAMRirsUpdateParams) WithID(id int64) *IPAMRirsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam rirs update params +func (o *IPAMRirsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRirsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_update_responses.go new file mode 100644 index 0000000..1ca5248 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amrirs_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMRirsUpdateReader is a Reader for the IPAMRirsUpdate structure. +type IPAMRirsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRirsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRirsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMRirsUpdateOK creates a IPAMRirsUpdateOK with default headers values +func NewIPAMRirsUpdateOK() *IPAMRirsUpdateOK { + return &IPAMRirsUpdateOK{} +} + +/*IPAMRirsUpdateOK handles this case with default header values. + +IPAMRirsUpdateOK ipam rirs update o k +*/ +type IPAMRirsUpdateOK struct { + Payload *models.RIR +} + +func (o *IPAMRirsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/rirs/{id}/][%d] ipamRirsUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMRirsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RIR) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_create_parameters.go new file mode 100644 index 0000000..a5fd443 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMRolesCreateParams creates a new IPAMRolesCreateParams object +// with the default values initialized. +func NewIPAMRolesCreateParams() *IPAMRolesCreateParams { + var () + return &IPAMRolesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRolesCreateParamsWithTimeout creates a new IPAMRolesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRolesCreateParamsWithTimeout(timeout time.Duration) *IPAMRolesCreateParams { + var () + return &IPAMRolesCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMRolesCreateParamsWithContext creates a new IPAMRolesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRolesCreateParamsWithContext(ctx context.Context) *IPAMRolesCreateParams { + var () + return &IPAMRolesCreateParams{ + + Context: ctx, + } +} + +// NewIPAMRolesCreateParamsWithHTTPClient creates a new IPAMRolesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRolesCreateParamsWithHTTPClient(client *http.Client) *IPAMRolesCreateParams { + var () + return &IPAMRolesCreateParams{ + HTTPClient: client, + } +} + +/*IPAMRolesCreateParams contains all the parameters to send to the API endpoint +for the ipam roles create operation typically these are written to a http.Request +*/ +type IPAMRolesCreateParams struct { + + /*Data*/ + Data *models.Role + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam roles create params +func (o *IPAMRolesCreateParams) WithTimeout(timeout time.Duration) *IPAMRolesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam roles create params +func (o *IPAMRolesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam roles create params +func (o *IPAMRolesCreateParams) WithContext(ctx context.Context) *IPAMRolesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam roles create params +func (o *IPAMRolesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam roles create params +func (o *IPAMRolesCreateParams) WithHTTPClient(client *http.Client) *IPAMRolesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam roles create params +func (o *IPAMRolesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam roles create params +func (o *IPAMRolesCreateParams) WithData(data *models.Role) *IPAMRolesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam roles create params +func (o *IPAMRolesCreateParams) SetData(data *models.Role) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRolesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_create_responses.go new file mode 100644 index 0000000..05fe3d7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMRolesCreateReader is a Reader for the IPAMRolesCreate structure. +type IPAMRolesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRolesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMRolesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMRolesCreateCreated creates a IPAMRolesCreateCreated with default headers values +func NewIPAMRolesCreateCreated() *IPAMRolesCreateCreated { + return &IPAMRolesCreateCreated{} +} + +/*IPAMRolesCreateCreated handles this case with default header values. + +IPAMRolesCreateCreated ipam roles create created +*/ +type IPAMRolesCreateCreated struct { + Payload *models.Role +} + +func (o *IPAMRolesCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/roles/][%d] ipamRolesCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMRolesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Role) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_delete_parameters.go new file mode 100644 index 0000000..98f1227 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMRolesDeleteParams creates a new IPAMRolesDeleteParams object +// with the default values initialized. +func NewIPAMRolesDeleteParams() *IPAMRolesDeleteParams { + var () + return &IPAMRolesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRolesDeleteParamsWithTimeout creates a new IPAMRolesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRolesDeleteParamsWithTimeout(timeout time.Duration) *IPAMRolesDeleteParams { + var () + return &IPAMRolesDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMRolesDeleteParamsWithContext creates a new IPAMRolesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRolesDeleteParamsWithContext(ctx context.Context) *IPAMRolesDeleteParams { + var () + return &IPAMRolesDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMRolesDeleteParamsWithHTTPClient creates a new IPAMRolesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRolesDeleteParamsWithHTTPClient(client *http.Client) *IPAMRolesDeleteParams { + var () + return &IPAMRolesDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMRolesDeleteParams contains all the parameters to send to the API endpoint +for the ipam roles delete operation typically these are written to a http.Request +*/ +type IPAMRolesDeleteParams struct { + + /*ID + A unique integer value identifying this role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam roles delete params +func (o *IPAMRolesDeleteParams) WithTimeout(timeout time.Duration) *IPAMRolesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam roles delete params +func (o *IPAMRolesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam roles delete params +func (o *IPAMRolesDeleteParams) WithContext(ctx context.Context) *IPAMRolesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam roles delete params +func (o *IPAMRolesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam roles delete params +func (o *IPAMRolesDeleteParams) WithHTTPClient(client *http.Client) *IPAMRolesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam roles delete params +func (o *IPAMRolesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam roles delete params +func (o *IPAMRolesDeleteParams) WithID(id int64) *IPAMRolesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam roles delete params +func (o *IPAMRolesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRolesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_delete_responses.go new file mode 100644 index 0000000..6a5e17d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMRolesDeleteReader is a Reader for the IPAMRolesDelete structure. +type IPAMRolesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRolesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMRolesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMRolesDeleteNoContent creates a IPAMRolesDeleteNoContent with default headers values +func NewIPAMRolesDeleteNoContent() *IPAMRolesDeleteNoContent { + return &IPAMRolesDeleteNoContent{} +} + +/*IPAMRolesDeleteNoContent handles this case with default header values. + +IPAMRolesDeleteNoContent ipam roles delete no content +*/ +type IPAMRolesDeleteNoContent struct { +} + +func (o *IPAMRolesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/roles/{id}/][%d] ipamRolesDeleteNoContent ", 204) +} + +func (o *IPAMRolesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_list_parameters.go new file mode 100644 index 0000000..fb3f801 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_list_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMRolesListParams creates a new IPAMRolesListParams object +// with the default values initialized. +func NewIPAMRolesListParams() *IPAMRolesListParams { + var () + return &IPAMRolesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRolesListParamsWithTimeout creates a new IPAMRolesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRolesListParamsWithTimeout(timeout time.Duration) *IPAMRolesListParams { + var () + return &IPAMRolesListParams{ + + timeout: timeout, + } +} + +// NewIPAMRolesListParamsWithContext creates a new IPAMRolesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRolesListParamsWithContext(ctx context.Context) *IPAMRolesListParams { + var () + return &IPAMRolesListParams{ + + Context: ctx, + } +} + +// NewIPAMRolesListParamsWithHTTPClient creates a new IPAMRolesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRolesListParamsWithHTTPClient(client *http.Client) *IPAMRolesListParams { + var () + return &IPAMRolesListParams{ + HTTPClient: client, + } +} + +/*IPAMRolesListParams contains all the parameters to send to the API endpoint +for the ipam roles list operation typically these are written to a http.Request +*/ +type IPAMRolesListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam roles list params +func (o *IPAMRolesListParams) WithTimeout(timeout time.Duration) *IPAMRolesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam roles list params +func (o *IPAMRolesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam roles list params +func (o *IPAMRolesListParams) WithContext(ctx context.Context) *IPAMRolesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam roles list params +func (o *IPAMRolesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam roles list params +func (o *IPAMRolesListParams) WithHTTPClient(client *http.Client) *IPAMRolesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam roles list params +func (o *IPAMRolesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the ipam roles list params +func (o *IPAMRolesListParams) WithLimit(limit *int64) *IPAMRolesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam roles list params +func (o *IPAMRolesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the ipam roles list params +func (o *IPAMRolesListParams) WithName(name *string) *IPAMRolesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the ipam roles list params +func (o *IPAMRolesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the ipam roles list params +func (o *IPAMRolesListParams) WithOffset(offset *int64) *IPAMRolesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam roles list params +func (o *IPAMRolesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the ipam roles list params +func (o *IPAMRolesListParams) WithSlug(slug *string) *IPAMRolesListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the ipam roles list params +func (o *IPAMRolesListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRolesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_list_responses.go new file mode 100644 index 0000000..984bfb9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMRolesListReader is a Reader for the IPAMRolesList structure. +type IPAMRolesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRolesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRolesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMRolesListOK creates a IPAMRolesListOK with default headers values +func NewIPAMRolesListOK() *IPAMRolesListOK { + return &IPAMRolesListOK{} +} + +/*IPAMRolesListOK handles this case with default header values. + +IPAMRolesListOK ipam roles list o k +*/ +type IPAMRolesListOK struct { + Payload *models.IPAMRolesListOKBody +} + +func (o *IPAMRolesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/roles/][%d] ipamRolesListOK %+v", 200, o.Payload) +} + +func (o *IPAMRolesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMRolesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_partial_update_parameters.go new file mode 100644 index 0000000..192bcb0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMRolesPartialUpdateParams creates a new IPAMRolesPartialUpdateParams object +// with the default values initialized. +func NewIPAMRolesPartialUpdateParams() *IPAMRolesPartialUpdateParams { + var () + return &IPAMRolesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRolesPartialUpdateParamsWithTimeout creates a new IPAMRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRolesPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMRolesPartialUpdateParams { + var () + return &IPAMRolesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMRolesPartialUpdateParamsWithContext creates a new IPAMRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRolesPartialUpdateParamsWithContext(ctx context.Context) *IPAMRolesPartialUpdateParams { + var () + return &IPAMRolesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMRolesPartialUpdateParamsWithHTTPClient creates a new IPAMRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRolesPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMRolesPartialUpdateParams { + var () + return &IPAMRolesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMRolesPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam roles partial update operation typically these are written to a http.Request +*/ +type IPAMRolesPartialUpdateParams struct { + + /*Data*/ + Data *models.Role + /*ID + A unique integer value identifying this role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMRolesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) WithContext(ctx context.Context) *IPAMRolesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMRolesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) WithData(data *models.Role) *IPAMRolesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) SetData(data *models.Role) { + o.Data = data +} + +// WithID adds the id to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) WithID(id int64) *IPAMRolesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRolesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_partial_update_responses.go new file mode 100644 index 0000000..f2dd6ad --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMRolesPartialUpdateReader is a Reader for the IPAMRolesPartialUpdate structure. +type IPAMRolesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRolesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRolesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMRolesPartialUpdateOK creates a IPAMRolesPartialUpdateOK with default headers values +func NewIPAMRolesPartialUpdateOK() *IPAMRolesPartialUpdateOK { + return &IPAMRolesPartialUpdateOK{} +} + +/*IPAMRolesPartialUpdateOK handles this case with default header values. + +IPAMRolesPartialUpdateOK ipam roles partial update o k +*/ +type IPAMRolesPartialUpdateOK struct { + Payload *models.Role +} + +func (o *IPAMRolesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/roles/{id}/][%d] ipamRolesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMRolesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Role) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_read_parameters.go new file mode 100644 index 0000000..0543e0f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMRolesReadParams creates a new IPAMRolesReadParams object +// with the default values initialized. +func NewIPAMRolesReadParams() *IPAMRolesReadParams { + var () + return &IPAMRolesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRolesReadParamsWithTimeout creates a new IPAMRolesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRolesReadParamsWithTimeout(timeout time.Duration) *IPAMRolesReadParams { + var () + return &IPAMRolesReadParams{ + + timeout: timeout, + } +} + +// NewIPAMRolesReadParamsWithContext creates a new IPAMRolesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRolesReadParamsWithContext(ctx context.Context) *IPAMRolesReadParams { + var () + return &IPAMRolesReadParams{ + + Context: ctx, + } +} + +// NewIPAMRolesReadParamsWithHTTPClient creates a new IPAMRolesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRolesReadParamsWithHTTPClient(client *http.Client) *IPAMRolesReadParams { + var () + return &IPAMRolesReadParams{ + HTTPClient: client, + } +} + +/*IPAMRolesReadParams contains all the parameters to send to the API endpoint +for the ipam roles read operation typically these are written to a http.Request +*/ +type IPAMRolesReadParams struct { + + /*ID + A unique integer value identifying this role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam roles read params +func (o *IPAMRolesReadParams) WithTimeout(timeout time.Duration) *IPAMRolesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam roles read params +func (o *IPAMRolesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam roles read params +func (o *IPAMRolesReadParams) WithContext(ctx context.Context) *IPAMRolesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam roles read params +func (o *IPAMRolesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam roles read params +func (o *IPAMRolesReadParams) WithHTTPClient(client *http.Client) *IPAMRolesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam roles read params +func (o *IPAMRolesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam roles read params +func (o *IPAMRolesReadParams) WithID(id int64) *IPAMRolesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam roles read params +func (o *IPAMRolesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRolesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_read_responses.go new file mode 100644 index 0000000..055923d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMRolesReadReader is a Reader for the IPAMRolesRead structure. +type IPAMRolesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRolesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRolesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMRolesReadOK creates a IPAMRolesReadOK with default headers values +func NewIPAMRolesReadOK() *IPAMRolesReadOK { + return &IPAMRolesReadOK{} +} + +/*IPAMRolesReadOK handles this case with default header values. + +IPAMRolesReadOK ipam roles read o k +*/ +type IPAMRolesReadOK struct { + Payload *models.Role +} + +func (o *IPAMRolesReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/roles/{id}/][%d] ipamRolesReadOK %+v", 200, o.Payload) +} + +func (o *IPAMRolesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Role) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_update_parameters.go new file mode 100644 index 0000000..86cd84e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMRolesUpdateParams creates a new IPAMRolesUpdateParams object +// with the default values initialized. +func NewIPAMRolesUpdateParams() *IPAMRolesUpdateParams { + var () + return &IPAMRolesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRolesUpdateParamsWithTimeout creates a new IPAMRolesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRolesUpdateParamsWithTimeout(timeout time.Duration) *IPAMRolesUpdateParams { + var () + return &IPAMRolesUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMRolesUpdateParamsWithContext creates a new IPAMRolesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRolesUpdateParamsWithContext(ctx context.Context) *IPAMRolesUpdateParams { + var () + return &IPAMRolesUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMRolesUpdateParamsWithHTTPClient creates a new IPAMRolesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRolesUpdateParamsWithHTTPClient(client *http.Client) *IPAMRolesUpdateParams { + var () + return &IPAMRolesUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMRolesUpdateParams contains all the parameters to send to the API endpoint +for the ipam roles update operation typically these are written to a http.Request +*/ +type IPAMRolesUpdateParams struct { + + /*Data*/ + Data *models.Role + /*ID + A unique integer value identifying this role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam roles update params +func (o *IPAMRolesUpdateParams) WithTimeout(timeout time.Duration) *IPAMRolesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam roles update params +func (o *IPAMRolesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam roles update params +func (o *IPAMRolesUpdateParams) WithContext(ctx context.Context) *IPAMRolesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam roles update params +func (o *IPAMRolesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam roles update params +func (o *IPAMRolesUpdateParams) WithHTTPClient(client *http.Client) *IPAMRolesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam roles update params +func (o *IPAMRolesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam roles update params +func (o *IPAMRolesUpdateParams) WithData(data *models.Role) *IPAMRolesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam roles update params +func (o *IPAMRolesUpdateParams) SetData(data *models.Role) { + o.Data = data +} + +// WithID adds the id to the ipam roles update params +func (o *IPAMRolesUpdateParams) WithID(id int64) *IPAMRolesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam roles update params +func (o *IPAMRolesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRolesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_update_responses.go new file mode 100644 index 0000000..d57107b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amroles_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMRolesUpdateReader is a Reader for the IPAMRolesUpdate structure. +type IPAMRolesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRolesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRolesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMRolesUpdateOK creates a IPAMRolesUpdateOK with default headers values +func NewIPAMRolesUpdateOK() *IPAMRolesUpdateOK { + return &IPAMRolesUpdateOK{} +} + +/*IPAMRolesUpdateOK handles this case with default header values. + +IPAMRolesUpdateOK ipam roles update o k +*/ +type IPAMRolesUpdateOK struct { + Payload *models.Role +} + +func (o *IPAMRolesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/roles/{id}/][%d] ipamRolesUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMRolesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Role) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_create_parameters.go new file mode 100644 index 0000000..7b16d42 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMServicesCreateParams creates a new IPAMServicesCreateParams object +// with the default values initialized. +func NewIPAMServicesCreateParams() *IPAMServicesCreateParams { + var () + return &IPAMServicesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMServicesCreateParamsWithTimeout creates a new IPAMServicesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMServicesCreateParamsWithTimeout(timeout time.Duration) *IPAMServicesCreateParams { + var () + return &IPAMServicesCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMServicesCreateParamsWithContext creates a new IPAMServicesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMServicesCreateParamsWithContext(ctx context.Context) *IPAMServicesCreateParams { + var () + return &IPAMServicesCreateParams{ + + Context: ctx, + } +} + +// NewIPAMServicesCreateParamsWithHTTPClient creates a new IPAMServicesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMServicesCreateParamsWithHTTPClient(client *http.Client) *IPAMServicesCreateParams { + var () + return &IPAMServicesCreateParams{ + HTTPClient: client, + } +} + +/*IPAMServicesCreateParams contains all the parameters to send to the API endpoint +for the ipam services create operation typically these are written to a http.Request +*/ +type IPAMServicesCreateParams struct { + + /*Data*/ + Data *models.WritableService + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam services create params +func (o *IPAMServicesCreateParams) WithTimeout(timeout time.Duration) *IPAMServicesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam services create params +func (o *IPAMServicesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam services create params +func (o *IPAMServicesCreateParams) WithContext(ctx context.Context) *IPAMServicesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam services create params +func (o *IPAMServicesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam services create params +func (o *IPAMServicesCreateParams) WithHTTPClient(client *http.Client) *IPAMServicesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam services create params +func (o *IPAMServicesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam services create params +func (o *IPAMServicesCreateParams) WithData(data *models.WritableService) *IPAMServicesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam services create params +func (o *IPAMServicesCreateParams) SetData(data *models.WritableService) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMServicesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_create_responses.go new file mode 100644 index 0000000..488a672 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMServicesCreateReader is a Reader for the IPAMServicesCreate structure. +type IPAMServicesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMServicesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMServicesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMServicesCreateCreated creates a IPAMServicesCreateCreated with default headers values +func NewIPAMServicesCreateCreated() *IPAMServicesCreateCreated { + return &IPAMServicesCreateCreated{} +} + +/*IPAMServicesCreateCreated handles this case with default header values. + +IPAMServicesCreateCreated ipam services create created +*/ +type IPAMServicesCreateCreated struct { + Payload *models.WritableService +} + +func (o *IPAMServicesCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/services/][%d] ipamServicesCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMServicesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableService) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_delete_parameters.go new file mode 100644 index 0000000..f11b0bf --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMServicesDeleteParams creates a new IPAMServicesDeleteParams object +// with the default values initialized. +func NewIPAMServicesDeleteParams() *IPAMServicesDeleteParams { + var () + return &IPAMServicesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMServicesDeleteParamsWithTimeout creates a new IPAMServicesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMServicesDeleteParamsWithTimeout(timeout time.Duration) *IPAMServicesDeleteParams { + var () + return &IPAMServicesDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMServicesDeleteParamsWithContext creates a new IPAMServicesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMServicesDeleteParamsWithContext(ctx context.Context) *IPAMServicesDeleteParams { + var () + return &IPAMServicesDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMServicesDeleteParamsWithHTTPClient creates a new IPAMServicesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMServicesDeleteParamsWithHTTPClient(client *http.Client) *IPAMServicesDeleteParams { + var () + return &IPAMServicesDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMServicesDeleteParams contains all the parameters to send to the API endpoint +for the ipam services delete operation typically these are written to a http.Request +*/ +type IPAMServicesDeleteParams struct { + + /*ID + A unique integer value identifying this service. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam services delete params +func (o *IPAMServicesDeleteParams) WithTimeout(timeout time.Duration) *IPAMServicesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam services delete params +func (o *IPAMServicesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam services delete params +func (o *IPAMServicesDeleteParams) WithContext(ctx context.Context) *IPAMServicesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam services delete params +func (o *IPAMServicesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam services delete params +func (o *IPAMServicesDeleteParams) WithHTTPClient(client *http.Client) *IPAMServicesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam services delete params +func (o *IPAMServicesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam services delete params +func (o *IPAMServicesDeleteParams) WithID(id int64) *IPAMServicesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam services delete params +func (o *IPAMServicesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMServicesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_delete_responses.go new file mode 100644 index 0000000..12b6313 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMServicesDeleteReader is a Reader for the IPAMServicesDelete structure. +type IPAMServicesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMServicesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMServicesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMServicesDeleteNoContent creates a IPAMServicesDeleteNoContent with default headers values +func NewIPAMServicesDeleteNoContent() *IPAMServicesDeleteNoContent { + return &IPAMServicesDeleteNoContent{} +} + +/*IPAMServicesDeleteNoContent handles this case with default header values. + +IPAMServicesDeleteNoContent ipam services delete no content +*/ +type IPAMServicesDeleteNoContent struct { +} + +func (o *IPAMServicesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/services/{id}/][%d] ipamServicesDeleteNoContent ", 204) +} + +func (o *IPAMServicesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_list_parameters.go new file mode 100644 index 0000000..c854462 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_list_parameters.go @@ -0,0 +1,398 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMServicesListParams creates a new IPAMServicesListParams object +// with the default values initialized. +func NewIPAMServicesListParams() *IPAMServicesListParams { + var () + return &IPAMServicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMServicesListParamsWithTimeout creates a new IPAMServicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMServicesListParamsWithTimeout(timeout time.Duration) *IPAMServicesListParams { + var () + return &IPAMServicesListParams{ + + timeout: timeout, + } +} + +// NewIPAMServicesListParamsWithContext creates a new IPAMServicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMServicesListParamsWithContext(ctx context.Context) *IPAMServicesListParams { + var () + return &IPAMServicesListParams{ + + Context: ctx, + } +} + +// NewIPAMServicesListParamsWithHTTPClient creates a new IPAMServicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMServicesListParamsWithHTTPClient(client *http.Client) *IPAMServicesListParams { + var () + return &IPAMServicesListParams{ + HTTPClient: client, + } +} + +/*IPAMServicesListParams contains all the parameters to send to the API endpoint +for the ipam services list operation typically these are written to a http.Request +*/ +type IPAMServicesListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Port*/ + Port *float64 + /*Protocol*/ + Protocol *string + /*VirtualMachine*/ + VirtualMachine *string + /*VirtualMachineID*/ + VirtualMachineID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam services list params +func (o *IPAMServicesListParams) WithTimeout(timeout time.Duration) *IPAMServicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam services list params +func (o *IPAMServicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam services list params +func (o *IPAMServicesListParams) WithContext(ctx context.Context) *IPAMServicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam services list params +func (o *IPAMServicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam services list params +func (o *IPAMServicesListParams) WithHTTPClient(client *http.Client) *IPAMServicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam services list params +func (o *IPAMServicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the ipam services list params +func (o *IPAMServicesListParams) WithDevice(device *string) *IPAMServicesListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the ipam services list params +func (o *IPAMServicesListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the ipam services list params +func (o *IPAMServicesListParams) WithDeviceID(deviceID *string) *IPAMServicesListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the ipam services list params +func (o *IPAMServicesListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithLimit adds the limit to the ipam services list params +func (o *IPAMServicesListParams) WithLimit(limit *int64) *IPAMServicesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam services list params +func (o *IPAMServicesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the ipam services list params +func (o *IPAMServicesListParams) WithName(name *string) *IPAMServicesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the ipam services list params +func (o *IPAMServicesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the ipam services list params +func (o *IPAMServicesListParams) WithOffset(offset *int64) *IPAMServicesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam services list params +func (o *IPAMServicesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPort adds the port to the ipam services list params +func (o *IPAMServicesListParams) WithPort(port *float64) *IPAMServicesListParams { + o.SetPort(port) + return o +} + +// SetPort adds the port to the ipam services list params +func (o *IPAMServicesListParams) SetPort(port *float64) { + o.Port = port +} + +// WithProtocol adds the protocol to the ipam services list params +func (o *IPAMServicesListParams) WithProtocol(protocol *string) *IPAMServicesListParams { + o.SetProtocol(protocol) + return o +} + +// SetProtocol adds the protocol to the ipam services list params +func (o *IPAMServicesListParams) SetProtocol(protocol *string) { + o.Protocol = protocol +} + +// WithVirtualMachine adds the virtualMachine to the ipam services list params +func (o *IPAMServicesListParams) WithVirtualMachine(virtualMachine *string) *IPAMServicesListParams { + o.SetVirtualMachine(virtualMachine) + return o +} + +// SetVirtualMachine adds the virtualMachine to the ipam services list params +func (o *IPAMServicesListParams) SetVirtualMachine(virtualMachine *string) { + o.VirtualMachine = virtualMachine +} + +// WithVirtualMachineID adds the virtualMachineID to the ipam services list params +func (o *IPAMServicesListParams) WithVirtualMachineID(virtualMachineID *string) *IPAMServicesListParams { + o.SetVirtualMachineID(virtualMachineID) + return o +} + +// SetVirtualMachineID adds the virtualMachineId to the ipam services list params +func (o *IPAMServicesListParams) SetVirtualMachineID(virtualMachineID *string) { + o.VirtualMachineID = virtualMachineID +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMServicesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); 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.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.Port != nil { + + // query param port + var qrPort float64 + if o.Port != nil { + qrPort = *o.Port + } + qPort := swag.FormatFloat64(qrPort) + if qPort != "" { + if err := r.SetQueryParam("port", qPort); 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.VirtualMachine != nil { + + // query param virtual_machine + var qrVirtualMachine string + if o.VirtualMachine != nil { + qrVirtualMachine = *o.VirtualMachine + } + qVirtualMachine := qrVirtualMachine + if qVirtualMachine != "" { + if err := r.SetQueryParam("virtual_machine", qVirtualMachine); err != nil { + return err + } + } + + } + + if o.VirtualMachineID != nil { + + // query param virtual_machine_id + var qrVirtualMachineID string + if o.VirtualMachineID != nil { + qrVirtualMachineID = *o.VirtualMachineID + } + qVirtualMachineID := qrVirtualMachineID + if qVirtualMachineID != "" { + if err := r.SetQueryParam("virtual_machine_id", qVirtualMachineID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_list_responses.go new file mode 100644 index 0000000..22ec9b4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMServicesListReader is a Reader for the IPAMServicesList structure. +type IPAMServicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMServicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMServicesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMServicesListOK creates a IPAMServicesListOK with default headers values +func NewIPAMServicesListOK() *IPAMServicesListOK { + return &IPAMServicesListOK{} +} + +/*IPAMServicesListOK handles this case with default header values. + +IPAMServicesListOK ipam services list o k +*/ +type IPAMServicesListOK struct { + Payload *models.IPAMServicesListOKBody +} + +func (o *IPAMServicesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/services/][%d] ipamServicesListOK %+v", 200, o.Payload) +} + +func (o *IPAMServicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMServicesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_partial_update_parameters.go new file mode 100644 index 0000000..7363e4e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMServicesPartialUpdateParams creates a new IPAMServicesPartialUpdateParams object +// with the default values initialized. +func NewIPAMServicesPartialUpdateParams() *IPAMServicesPartialUpdateParams { + var () + return &IPAMServicesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMServicesPartialUpdateParamsWithTimeout creates a new IPAMServicesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMServicesPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMServicesPartialUpdateParams { + var () + return &IPAMServicesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMServicesPartialUpdateParamsWithContext creates a new IPAMServicesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMServicesPartialUpdateParamsWithContext(ctx context.Context) *IPAMServicesPartialUpdateParams { + var () + return &IPAMServicesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMServicesPartialUpdateParamsWithHTTPClient creates a new IPAMServicesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMServicesPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMServicesPartialUpdateParams { + var () + return &IPAMServicesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMServicesPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam services partial update operation typically these are written to a http.Request +*/ +type IPAMServicesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableService + /*ID + A unique integer value identifying this service. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMServicesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) WithContext(ctx context.Context) *IPAMServicesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMServicesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) WithData(data *models.WritableService) *IPAMServicesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) SetData(data *models.WritableService) { + o.Data = data +} + +// WithID adds the id to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) WithID(id int64) *IPAMServicesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMServicesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_partial_update_responses.go new file mode 100644 index 0000000..db21bb7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMServicesPartialUpdateReader is a Reader for the IPAMServicesPartialUpdate structure. +type IPAMServicesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMServicesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMServicesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMServicesPartialUpdateOK creates a IPAMServicesPartialUpdateOK with default headers values +func NewIPAMServicesPartialUpdateOK() *IPAMServicesPartialUpdateOK { + return &IPAMServicesPartialUpdateOK{} +} + +/*IPAMServicesPartialUpdateOK handles this case with default header values. + +IPAMServicesPartialUpdateOK ipam services partial update o k +*/ +type IPAMServicesPartialUpdateOK struct { + Payload *models.WritableService +} + +func (o *IPAMServicesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/services/{id}/][%d] ipamServicesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMServicesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableService) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_read_parameters.go new file mode 100644 index 0000000..6a9dae2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMServicesReadParams creates a new IPAMServicesReadParams object +// with the default values initialized. +func NewIPAMServicesReadParams() *IPAMServicesReadParams { + var () + return &IPAMServicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMServicesReadParamsWithTimeout creates a new IPAMServicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMServicesReadParamsWithTimeout(timeout time.Duration) *IPAMServicesReadParams { + var () + return &IPAMServicesReadParams{ + + timeout: timeout, + } +} + +// NewIPAMServicesReadParamsWithContext creates a new IPAMServicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMServicesReadParamsWithContext(ctx context.Context) *IPAMServicesReadParams { + var () + return &IPAMServicesReadParams{ + + Context: ctx, + } +} + +// NewIPAMServicesReadParamsWithHTTPClient creates a new IPAMServicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMServicesReadParamsWithHTTPClient(client *http.Client) *IPAMServicesReadParams { + var () + return &IPAMServicesReadParams{ + HTTPClient: client, + } +} + +/*IPAMServicesReadParams contains all the parameters to send to the API endpoint +for the ipam services read operation typically these are written to a http.Request +*/ +type IPAMServicesReadParams struct { + + /*ID + A unique integer value identifying this service. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam services read params +func (o *IPAMServicesReadParams) WithTimeout(timeout time.Duration) *IPAMServicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam services read params +func (o *IPAMServicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam services read params +func (o *IPAMServicesReadParams) WithContext(ctx context.Context) *IPAMServicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam services read params +func (o *IPAMServicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam services read params +func (o *IPAMServicesReadParams) WithHTTPClient(client *http.Client) *IPAMServicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam services read params +func (o *IPAMServicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam services read params +func (o *IPAMServicesReadParams) WithID(id int64) *IPAMServicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam services read params +func (o *IPAMServicesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMServicesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_read_responses.go new file mode 100644 index 0000000..01d78a3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMServicesReadReader is a Reader for the IPAMServicesRead structure. +type IPAMServicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMServicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMServicesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMServicesReadOK creates a IPAMServicesReadOK with default headers values +func NewIPAMServicesReadOK() *IPAMServicesReadOK { + return &IPAMServicesReadOK{} +} + +/*IPAMServicesReadOK handles this case with default header values. + +IPAMServicesReadOK ipam services read o k +*/ +type IPAMServicesReadOK struct { + Payload *models.Service +} + +func (o *IPAMServicesReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/services/{id}/][%d] ipamServicesReadOK %+v", 200, o.Payload) +} + +func (o *IPAMServicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Service) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_update_parameters.go new file mode 100644 index 0000000..e423e4f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMServicesUpdateParams creates a new IPAMServicesUpdateParams object +// with the default values initialized. +func NewIPAMServicesUpdateParams() *IPAMServicesUpdateParams { + var () + return &IPAMServicesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMServicesUpdateParamsWithTimeout creates a new IPAMServicesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMServicesUpdateParamsWithTimeout(timeout time.Duration) *IPAMServicesUpdateParams { + var () + return &IPAMServicesUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMServicesUpdateParamsWithContext creates a new IPAMServicesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMServicesUpdateParamsWithContext(ctx context.Context) *IPAMServicesUpdateParams { + var () + return &IPAMServicesUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMServicesUpdateParamsWithHTTPClient creates a new IPAMServicesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMServicesUpdateParamsWithHTTPClient(client *http.Client) *IPAMServicesUpdateParams { + var () + return &IPAMServicesUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMServicesUpdateParams contains all the parameters to send to the API endpoint +for the ipam services update operation typically these are written to a http.Request +*/ +type IPAMServicesUpdateParams struct { + + /*Data*/ + Data *models.WritableService + /*ID + A unique integer value identifying this service. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam services update params +func (o *IPAMServicesUpdateParams) WithTimeout(timeout time.Duration) *IPAMServicesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam services update params +func (o *IPAMServicesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam services update params +func (o *IPAMServicesUpdateParams) WithContext(ctx context.Context) *IPAMServicesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam services update params +func (o *IPAMServicesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam services update params +func (o *IPAMServicesUpdateParams) WithHTTPClient(client *http.Client) *IPAMServicesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam services update params +func (o *IPAMServicesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam services update params +func (o *IPAMServicesUpdateParams) WithData(data *models.WritableService) *IPAMServicesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam services update params +func (o *IPAMServicesUpdateParams) SetData(data *models.WritableService) { + o.Data = data +} + +// WithID adds the id to the ipam services update params +func (o *IPAMServicesUpdateParams) WithID(id int64) *IPAMServicesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam services update params +func (o *IPAMServicesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMServicesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_update_responses.go new file mode 100644 index 0000000..3ccf536 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amservices_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMServicesUpdateReader is a Reader for the IPAMServicesUpdate structure. +type IPAMServicesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMServicesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMServicesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMServicesUpdateOK creates a IPAMServicesUpdateOK with default headers values +func NewIPAMServicesUpdateOK() *IPAMServicesUpdateOK { + return &IPAMServicesUpdateOK{} +} + +/*IPAMServicesUpdateOK handles this case with default header values. + +IPAMServicesUpdateOK ipam services update o k +*/ +type IPAMServicesUpdateOK struct { + Payload *models.WritableService +} + +func (o *IPAMServicesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/services/{id}/][%d] ipamServicesUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMServicesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableService) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_create_parameters.go new file mode 100644 index 0000000..5a9a756 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMVlanGroupsCreateParams creates a new IPAMVlanGroupsCreateParams object +// with the default values initialized. +func NewIPAMVlanGroupsCreateParams() *IPAMVlanGroupsCreateParams { + var () + return &IPAMVlanGroupsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlanGroupsCreateParamsWithTimeout creates a new IPAMVlanGroupsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlanGroupsCreateParamsWithTimeout(timeout time.Duration) *IPAMVlanGroupsCreateParams { + var () + return &IPAMVlanGroupsCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMVlanGroupsCreateParamsWithContext creates a new IPAMVlanGroupsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlanGroupsCreateParamsWithContext(ctx context.Context) *IPAMVlanGroupsCreateParams { + var () + return &IPAMVlanGroupsCreateParams{ + + Context: ctx, + } +} + +// NewIPAMVlanGroupsCreateParamsWithHTTPClient creates a new IPAMVlanGroupsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlanGroupsCreateParamsWithHTTPClient(client *http.Client) *IPAMVlanGroupsCreateParams { + var () + return &IPAMVlanGroupsCreateParams{ + HTTPClient: client, + } +} + +/*IPAMVlanGroupsCreateParams contains all the parameters to send to the API endpoint +for the ipam vlan groups create operation typically these are written to a http.Request +*/ +type IPAMVlanGroupsCreateParams struct { + + /*Data*/ + Data *models.WritableVLANGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlan groups create params +func (o *IPAMVlanGroupsCreateParams) WithTimeout(timeout time.Duration) *IPAMVlanGroupsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlan groups create params +func (o *IPAMVlanGroupsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlan groups create params +func (o *IPAMVlanGroupsCreateParams) WithContext(ctx context.Context) *IPAMVlanGroupsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlan groups create params +func (o *IPAMVlanGroupsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlan groups create params +func (o *IPAMVlanGroupsCreateParams) WithHTTPClient(client *http.Client) *IPAMVlanGroupsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlan groups create params +func (o *IPAMVlanGroupsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vlan groups create params +func (o *IPAMVlanGroupsCreateParams) WithData(data *models.WritableVLANGroup) *IPAMVlanGroupsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vlan groups create params +func (o *IPAMVlanGroupsCreateParams) SetData(data *models.WritableVLANGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlanGroupsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_create_responses.go new file mode 100644 index 0000000..7bc5097 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVlanGroupsCreateReader is a Reader for the IPAMVlanGroupsCreate structure. +type IPAMVlanGroupsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlanGroupsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMVlanGroupsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVlanGroupsCreateCreated creates a IPAMVlanGroupsCreateCreated with default headers values +func NewIPAMVlanGroupsCreateCreated() *IPAMVlanGroupsCreateCreated { + return &IPAMVlanGroupsCreateCreated{} +} + +/*IPAMVlanGroupsCreateCreated handles this case with default header values. + +IPAMVlanGroupsCreateCreated ipam vlan groups create created +*/ +type IPAMVlanGroupsCreateCreated struct { + Payload *models.WritableVLANGroup +} + +func (o *IPAMVlanGroupsCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/vlan-groups/][%d] ipamVlanGroupsCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMVlanGroupsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVLANGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_delete_parameters.go new file mode 100644 index 0000000..46a262a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMVlanGroupsDeleteParams creates a new IPAMVlanGroupsDeleteParams object +// with the default values initialized. +func NewIPAMVlanGroupsDeleteParams() *IPAMVlanGroupsDeleteParams { + var () + return &IPAMVlanGroupsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlanGroupsDeleteParamsWithTimeout creates a new IPAMVlanGroupsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlanGroupsDeleteParamsWithTimeout(timeout time.Duration) *IPAMVlanGroupsDeleteParams { + var () + return &IPAMVlanGroupsDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMVlanGroupsDeleteParamsWithContext creates a new IPAMVlanGroupsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlanGroupsDeleteParamsWithContext(ctx context.Context) *IPAMVlanGroupsDeleteParams { + var () + return &IPAMVlanGroupsDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMVlanGroupsDeleteParamsWithHTTPClient creates a new IPAMVlanGroupsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlanGroupsDeleteParamsWithHTTPClient(client *http.Client) *IPAMVlanGroupsDeleteParams { + var () + return &IPAMVlanGroupsDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMVlanGroupsDeleteParams contains all the parameters to send to the API endpoint +for the ipam vlan groups delete operation typically these are written to a http.Request +*/ +type IPAMVlanGroupsDeleteParams struct { + + /*ID + A unique integer value identifying this VLAN group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlan groups delete params +func (o *IPAMVlanGroupsDeleteParams) WithTimeout(timeout time.Duration) *IPAMVlanGroupsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlan groups delete params +func (o *IPAMVlanGroupsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlan groups delete params +func (o *IPAMVlanGroupsDeleteParams) WithContext(ctx context.Context) *IPAMVlanGroupsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlan groups delete params +func (o *IPAMVlanGroupsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlan groups delete params +func (o *IPAMVlanGroupsDeleteParams) WithHTTPClient(client *http.Client) *IPAMVlanGroupsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlan groups delete params +func (o *IPAMVlanGroupsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam vlan groups delete params +func (o *IPAMVlanGroupsDeleteParams) WithID(id int64) *IPAMVlanGroupsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlan groups delete params +func (o *IPAMVlanGroupsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlanGroupsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_delete_responses.go new file mode 100644 index 0000000..2b529ce --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMVlanGroupsDeleteReader is a Reader for the IPAMVlanGroupsDelete structure. +type IPAMVlanGroupsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlanGroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMVlanGroupsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVlanGroupsDeleteNoContent creates a IPAMVlanGroupsDeleteNoContent with default headers values +func NewIPAMVlanGroupsDeleteNoContent() *IPAMVlanGroupsDeleteNoContent { + return &IPAMVlanGroupsDeleteNoContent{} +} + +/*IPAMVlanGroupsDeleteNoContent handles this case with default header values. + +IPAMVlanGroupsDeleteNoContent ipam vlan groups delete no content +*/ +type IPAMVlanGroupsDeleteNoContent struct { +} + +func (o *IPAMVlanGroupsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/vlan-groups/{id}/][%d] ipamVlanGroupsDeleteNoContent ", 204) +} + +func (o *IPAMVlanGroupsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_list_parameters.go new file mode 100644 index 0000000..827349e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_list_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMVlanGroupsListParams creates a new IPAMVlanGroupsListParams object +// with the default values initialized. +func NewIPAMVlanGroupsListParams() *IPAMVlanGroupsListParams { + var () + return &IPAMVlanGroupsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlanGroupsListParamsWithTimeout creates a new IPAMVlanGroupsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlanGroupsListParamsWithTimeout(timeout time.Duration) *IPAMVlanGroupsListParams { + var () + return &IPAMVlanGroupsListParams{ + + timeout: timeout, + } +} + +// NewIPAMVlanGroupsListParamsWithContext creates a new IPAMVlanGroupsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlanGroupsListParamsWithContext(ctx context.Context) *IPAMVlanGroupsListParams { + var () + return &IPAMVlanGroupsListParams{ + + Context: ctx, + } +} + +// NewIPAMVlanGroupsListParamsWithHTTPClient creates a new IPAMVlanGroupsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlanGroupsListParamsWithHTTPClient(client *http.Client) *IPAMVlanGroupsListParams { + var () + return &IPAMVlanGroupsListParams{ + HTTPClient: client, + } +} + +/*IPAMVlanGroupsListParams contains all the parameters to send to the API endpoint +for the ipam vlan groups list operation typically these are written to a http.Request +*/ +type IPAMVlanGroupsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithTimeout(timeout time.Duration) *IPAMVlanGroupsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithContext(ctx context.Context) *IPAMVlanGroupsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithHTTPClient(client *http.Client) *IPAMVlanGroupsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithLimit(limit *int64) *IPAMVlanGroupsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithName(name *string) *IPAMVlanGroupsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithOffset(offset *int64) *IPAMVlanGroupsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSite adds the site to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithSite(site *string) *IPAMVlanGroupsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithSiteID(siteID *string) *IPAMVlanGroupsListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithSlug adds the slug to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithSlug(slug *string) *IPAMVlanGroupsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlanGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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.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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_list_responses.go new file mode 100644 index 0000000..40e70da --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVlanGroupsListReader is a Reader for the IPAMVlanGroupsList structure. +type IPAMVlanGroupsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlanGroupsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlanGroupsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVlanGroupsListOK creates a IPAMVlanGroupsListOK with default headers values +func NewIPAMVlanGroupsListOK() *IPAMVlanGroupsListOK { + return &IPAMVlanGroupsListOK{} +} + +/*IPAMVlanGroupsListOK handles this case with default header values. + +IPAMVlanGroupsListOK ipam vlan groups list o k +*/ +type IPAMVlanGroupsListOK struct { + Payload *models.IPAMVlanGroupsListOKBody +} + +func (o *IPAMVlanGroupsListOK) Error() string { + return fmt.Sprintf("[GET /ipam/vlan-groups/][%d] ipamVlanGroupsListOK %+v", 200, o.Payload) +} + +func (o *IPAMVlanGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMVlanGroupsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_partial_update_parameters.go new file mode 100644 index 0000000..69b3c7b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMVlanGroupsPartialUpdateParams creates a new IPAMVlanGroupsPartialUpdateParams object +// with the default values initialized. +func NewIPAMVlanGroupsPartialUpdateParams() *IPAMVlanGroupsPartialUpdateParams { + var () + return &IPAMVlanGroupsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlanGroupsPartialUpdateParamsWithTimeout creates a new IPAMVlanGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlanGroupsPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMVlanGroupsPartialUpdateParams { + var () + return &IPAMVlanGroupsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMVlanGroupsPartialUpdateParamsWithContext creates a new IPAMVlanGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlanGroupsPartialUpdateParamsWithContext(ctx context.Context) *IPAMVlanGroupsPartialUpdateParams { + var () + return &IPAMVlanGroupsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMVlanGroupsPartialUpdateParamsWithHTTPClient creates a new IPAMVlanGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlanGroupsPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMVlanGroupsPartialUpdateParams { + var () + return &IPAMVlanGroupsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMVlanGroupsPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam vlan groups partial update operation typically these are written to a http.Request +*/ +type IPAMVlanGroupsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableVLANGroup + /*ID + A unique integer value identifying this VLAN group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMVlanGroupsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) WithContext(ctx context.Context) *IPAMVlanGroupsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMVlanGroupsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) WithData(data *models.WritableVLANGroup) *IPAMVlanGroupsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) SetData(data *models.WritableVLANGroup) { + o.Data = data +} + +// WithID adds the id to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) WithID(id int64) *IPAMVlanGroupsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlanGroupsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_partial_update_responses.go new file mode 100644 index 0000000..62fb341 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVlanGroupsPartialUpdateReader is a Reader for the IPAMVlanGroupsPartialUpdate structure. +type IPAMVlanGroupsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlanGroupsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlanGroupsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVlanGroupsPartialUpdateOK creates a IPAMVlanGroupsPartialUpdateOK with default headers values +func NewIPAMVlanGroupsPartialUpdateOK() *IPAMVlanGroupsPartialUpdateOK { + return &IPAMVlanGroupsPartialUpdateOK{} +} + +/*IPAMVlanGroupsPartialUpdateOK handles this case with default header values. + +IPAMVlanGroupsPartialUpdateOK ipam vlan groups partial update o k +*/ +type IPAMVlanGroupsPartialUpdateOK struct { + Payload *models.WritableVLANGroup +} + +func (o *IPAMVlanGroupsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/vlan-groups/{id}/][%d] ipamVlanGroupsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMVlanGroupsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVLANGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_read_parameters.go new file mode 100644 index 0000000..9872ce4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMVlanGroupsReadParams creates a new IPAMVlanGroupsReadParams object +// with the default values initialized. +func NewIPAMVlanGroupsReadParams() *IPAMVlanGroupsReadParams { + var () + return &IPAMVlanGroupsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlanGroupsReadParamsWithTimeout creates a new IPAMVlanGroupsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlanGroupsReadParamsWithTimeout(timeout time.Duration) *IPAMVlanGroupsReadParams { + var () + return &IPAMVlanGroupsReadParams{ + + timeout: timeout, + } +} + +// NewIPAMVlanGroupsReadParamsWithContext creates a new IPAMVlanGroupsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlanGroupsReadParamsWithContext(ctx context.Context) *IPAMVlanGroupsReadParams { + var () + return &IPAMVlanGroupsReadParams{ + + Context: ctx, + } +} + +// NewIPAMVlanGroupsReadParamsWithHTTPClient creates a new IPAMVlanGroupsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlanGroupsReadParamsWithHTTPClient(client *http.Client) *IPAMVlanGroupsReadParams { + var () + return &IPAMVlanGroupsReadParams{ + HTTPClient: client, + } +} + +/*IPAMVlanGroupsReadParams contains all the parameters to send to the API endpoint +for the ipam vlan groups read operation typically these are written to a http.Request +*/ +type IPAMVlanGroupsReadParams struct { + + /*ID + A unique integer value identifying this VLAN group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlan groups read params +func (o *IPAMVlanGroupsReadParams) WithTimeout(timeout time.Duration) *IPAMVlanGroupsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlan groups read params +func (o *IPAMVlanGroupsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlan groups read params +func (o *IPAMVlanGroupsReadParams) WithContext(ctx context.Context) *IPAMVlanGroupsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlan groups read params +func (o *IPAMVlanGroupsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlan groups read params +func (o *IPAMVlanGroupsReadParams) WithHTTPClient(client *http.Client) *IPAMVlanGroupsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlan groups read params +func (o *IPAMVlanGroupsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam vlan groups read params +func (o *IPAMVlanGroupsReadParams) WithID(id int64) *IPAMVlanGroupsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlan groups read params +func (o *IPAMVlanGroupsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlanGroupsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_read_responses.go new file mode 100644 index 0000000..08914ce --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVlanGroupsReadReader is a Reader for the IPAMVlanGroupsRead structure. +type IPAMVlanGroupsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlanGroupsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlanGroupsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVlanGroupsReadOK creates a IPAMVlanGroupsReadOK with default headers values +func NewIPAMVlanGroupsReadOK() *IPAMVlanGroupsReadOK { + return &IPAMVlanGroupsReadOK{} +} + +/*IPAMVlanGroupsReadOK handles this case with default header values. + +IPAMVlanGroupsReadOK ipam vlan groups read o k +*/ +type IPAMVlanGroupsReadOK struct { + Payload *models.VLANGroup +} + +func (o *IPAMVlanGroupsReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/vlan-groups/{id}/][%d] ipamVlanGroupsReadOK %+v", 200, o.Payload) +} + +func (o *IPAMVlanGroupsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VLANGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_update_parameters.go new file mode 100644 index 0000000..fbd5662 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMVlanGroupsUpdateParams creates a new IPAMVlanGroupsUpdateParams object +// with the default values initialized. +func NewIPAMVlanGroupsUpdateParams() *IPAMVlanGroupsUpdateParams { + var () + return &IPAMVlanGroupsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlanGroupsUpdateParamsWithTimeout creates a new IPAMVlanGroupsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlanGroupsUpdateParamsWithTimeout(timeout time.Duration) *IPAMVlanGroupsUpdateParams { + var () + return &IPAMVlanGroupsUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMVlanGroupsUpdateParamsWithContext creates a new IPAMVlanGroupsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlanGroupsUpdateParamsWithContext(ctx context.Context) *IPAMVlanGroupsUpdateParams { + var () + return &IPAMVlanGroupsUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMVlanGroupsUpdateParamsWithHTTPClient creates a new IPAMVlanGroupsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlanGroupsUpdateParamsWithHTTPClient(client *http.Client) *IPAMVlanGroupsUpdateParams { + var () + return &IPAMVlanGroupsUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMVlanGroupsUpdateParams contains all the parameters to send to the API endpoint +for the ipam vlan groups update operation typically these are written to a http.Request +*/ +type IPAMVlanGroupsUpdateParams struct { + + /*Data*/ + Data *models.WritableVLANGroup + /*ID + A unique integer value identifying this VLAN group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) WithTimeout(timeout time.Duration) *IPAMVlanGroupsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) WithContext(ctx context.Context) *IPAMVlanGroupsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) WithHTTPClient(client *http.Client) *IPAMVlanGroupsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) WithData(data *models.WritableVLANGroup) *IPAMVlanGroupsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) SetData(data *models.WritableVLANGroup) { + o.Data = data +} + +// WithID adds the id to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) WithID(id int64) *IPAMVlanGroupsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlanGroupsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_update_responses.go new file mode 100644 index 0000000..01c63cc --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlan_groups_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVlanGroupsUpdateReader is a Reader for the IPAMVlanGroupsUpdate structure. +type IPAMVlanGroupsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlanGroupsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlanGroupsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVlanGroupsUpdateOK creates a IPAMVlanGroupsUpdateOK with default headers values +func NewIPAMVlanGroupsUpdateOK() *IPAMVlanGroupsUpdateOK { + return &IPAMVlanGroupsUpdateOK{} +} + +/*IPAMVlanGroupsUpdateOK handles this case with default header values. + +IPAMVlanGroupsUpdateOK ipam vlan groups update o k +*/ +type IPAMVlanGroupsUpdateOK struct { + Payload *models.WritableVLANGroup +} + +func (o *IPAMVlanGroupsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/vlan-groups/{id}/][%d] ipamVlanGroupsUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMVlanGroupsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVLANGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_create_parameters.go new file mode 100644 index 0000000..9be4303 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMVlansCreateParams creates a new IPAMVlansCreateParams object +// with the default values initialized. +func NewIPAMVlansCreateParams() *IPAMVlansCreateParams { + var () + return &IPAMVlansCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlansCreateParamsWithTimeout creates a new IPAMVlansCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlansCreateParamsWithTimeout(timeout time.Duration) *IPAMVlansCreateParams { + var () + return &IPAMVlansCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMVlansCreateParamsWithContext creates a new IPAMVlansCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlansCreateParamsWithContext(ctx context.Context) *IPAMVlansCreateParams { + var () + return &IPAMVlansCreateParams{ + + Context: ctx, + } +} + +// NewIPAMVlansCreateParamsWithHTTPClient creates a new IPAMVlansCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlansCreateParamsWithHTTPClient(client *http.Client) *IPAMVlansCreateParams { + var () + return &IPAMVlansCreateParams{ + HTTPClient: client, + } +} + +/*IPAMVlansCreateParams contains all the parameters to send to the API endpoint +for the ipam vlans create operation typically these are written to a http.Request +*/ +type IPAMVlansCreateParams struct { + + /*Data*/ + Data *models.WritableVLAN + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlans create params +func (o *IPAMVlansCreateParams) WithTimeout(timeout time.Duration) *IPAMVlansCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlans create params +func (o *IPAMVlansCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlans create params +func (o *IPAMVlansCreateParams) WithContext(ctx context.Context) *IPAMVlansCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlans create params +func (o *IPAMVlansCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlans create params +func (o *IPAMVlansCreateParams) WithHTTPClient(client *http.Client) *IPAMVlansCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlans create params +func (o *IPAMVlansCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vlans create params +func (o *IPAMVlansCreateParams) WithData(data *models.WritableVLAN) *IPAMVlansCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vlans create params +func (o *IPAMVlansCreateParams) SetData(data *models.WritableVLAN) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlansCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_create_responses.go new file mode 100644 index 0000000..fab3426 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVlansCreateReader is a Reader for the IPAMVlansCreate structure. +type IPAMVlansCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlansCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMVlansCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVlansCreateCreated creates a IPAMVlansCreateCreated with default headers values +func NewIPAMVlansCreateCreated() *IPAMVlansCreateCreated { + return &IPAMVlansCreateCreated{} +} + +/*IPAMVlansCreateCreated handles this case with default header values. + +IPAMVlansCreateCreated ipam vlans create created +*/ +type IPAMVlansCreateCreated struct { + Payload *models.WritableVLAN +} + +func (o *IPAMVlansCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/vlans/][%d] ipamVlansCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMVlansCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVLAN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_delete_parameters.go new file mode 100644 index 0000000..ad0ab87 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMVlansDeleteParams creates a new IPAMVlansDeleteParams object +// with the default values initialized. +func NewIPAMVlansDeleteParams() *IPAMVlansDeleteParams { + var () + return &IPAMVlansDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlansDeleteParamsWithTimeout creates a new IPAMVlansDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlansDeleteParamsWithTimeout(timeout time.Duration) *IPAMVlansDeleteParams { + var () + return &IPAMVlansDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMVlansDeleteParamsWithContext creates a new IPAMVlansDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlansDeleteParamsWithContext(ctx context.Context) *IPAMVlansDeleteParams { + var () + return &IPAMVlansDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMVlansDeleteParamsWithHTTPClient creates a new IPAMVlansDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlansDeleteParamsWithHTTPClient(client *http.Client) *IPAMVlansDeleteParams { + var () + return &IPAMVlansDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMVlansDeleteParams contains all the parameters to send to the API endpoint +for the ipam vlans delete operation typically these are written to a http.Request +*/ +type IPAMVlansDeleteParams struct { + + /*ID + A unique integer value identifying this VLAN. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlans delete params +func (o *IPAMVlansDeleteParams) WithTimeout(timeout time.Duration) *IPAMVlansDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlans delete params +func (o *IPAMVlansDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlans delete params +func (o *IPAMVlansDeleteParams) WithContext(ctx context.Context) *IPAMVlansDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlans delete params +func (o *IPAMVlansDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlans delete params +func (o *IPAMVlansDeleteParams) WithHTTPClient(client *http.Client) *IPAMVlansDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlans delete params +func (o *IPAMVlansDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam vlans delete params +func (o *IPAMVlansDeleteParams) WithID(id int64) *IPAMVlansDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlans delete params +func (o *IPAMVlansDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlansDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_delete_responses.go new file mode 100644 index 0000000..11f22d4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMVlansDeleteReader is a Reader for the IPAMVlansDelete structure. +type IPAMVlansDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlansDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMVlansDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVlansDeleteNoContent creates a IPAMVlansDeleteNoContent with default headers values +func NewIPAMVlansDeleteNoContent() *IPAMVlansDeleteNoContent { + return &IPAMVlansDeleteNoContent{} +} + +/*IPAMVlansDeleteNoContent handles this case with default header values. + +IPAMVlansDeleteNoContent ipam vlans delete no content +*/ +type IPAMVlansDeleteNoContent struct { +} + +func (o *IPAMVlansDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/vlans/{id}/][%d] ipamVlansDeleteNoContent ", 204) +} + +func (o *IPAMVlansDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_list_parameters.go new file mode 100644 index 0000000..652225c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_list_parameters.go @@ -0,0 +1,575 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMVlansListParams creates a new IPAMVlansListParams object +// with the default values initialized. +func NewIPAMVlansListParams() *IPAMVlansListParams { + var () + return &IPAMVlansListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlansListParamsWithTimeout creates a new IPAMVlansListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlansListParamsWithTimeout(timeout time.Duration) *IPAMVlansListParams { + var () + return &IPAMVlansListParams{ + + timeout: timeout, + } +} + +// NewIPAMVlansListParamsWithContext creates a new IPAMVlansListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlansListParamsWithContext(ctx context.Context) *IPAMVlansListParams { + var () + return &IPAMVlansListParams{ + + Context: ctx, + } +} + +// NewIPAMVlansListParamsWithHTTPClient creates a new IPAMVlansListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlansListParamsWithHTTPClient(client *http.Client) *IPAMVlansListParams { + var () + return &IPAMVlansListParams{ + HTTPClient: client, + } +} + +/*IPAMVlansListParams contains all the parameters to send to the API endpoint +for the ipam vlans list operation typically these are written to a http.Request +*/ +type IPAMVlansListParams struct { + + /*Group*/ + Group *string + /*GroupID*/ + GroupID *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Role*/ + Role *string + /*RoleID*/ + RoleID *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Status*/ + Status *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + /*Vid*/ + Vid *float64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlans list params +func (o *IPAMVlansListParams) WithTimeout(timeout time.Duration) *IPAMVlansListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlans list params +func (o *IPAMVlansListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlans list params +func (o *IPAMVlansListParams) WithContext(ctx context.Context) *IPAMVlansListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlans list params +func (o *IPAMVlansListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlans list params +func (o *IPAMVlansListParams) WithHTTPClient(client *http.Client) *IPAMVlansListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlans list params +func (o *IPAMVlansListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithGroup adds the group to the ipam vlans list params +func (o *IPAMVlansListParams) WithGroup(group *string) *IPAMVlansListParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the ipam vlans list params +func (o *IPAMVlansListParams) SetGroup(group *string) { + o.Group = group +} + +// WithGroupID adds the groupID to the ipam vlans list params +func (o *IPAMVlansListParams) WithGroupID(groupID *string) *IPAMVlansListParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the ipam vlans list params +func (o *IPAMVlansListParams) SetGroupID(groupID *string) { + o.GroupID = groupID +} + +// WithIDIn adds the iDIn to the ipam vlans list params +func (o *IPAMVlansListParams) WithIDIn(iDIn *string) *IPAMVlansListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the ipam vlans list params +func (o *IPAMVlansListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the ipam vlans list params +func (o *IPAMVlansListParams) WithLimit(limit *int64) *IPAMVlansListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam vlans list params +func (o *IPAMVlansListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the ipam vlans list params +func (o *IPAMVlansListParams) WithName(name *string) *IPAMVlansListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the ipam vlans list params +func (o *IPAMVlansListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the ipam vlans list params +func (o *IPAMVlansListParams) WithOffset(offset *int64) *IPAMVlansListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam vlans list params +func (o *IPAMVlansListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the ipam vlans list params +func (o *IPAMVlansListParams) WithQ(q *string) *IPAMVlansListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the ipam vlans list params +func (o *IPAMVlansListParams) SetQ(q *string) { + o.Q = q +} + +// WithRole adds the role to the ipam vlans list params +func (o *IPAMVlansListParams) WithRole(role *string) *IPAMVlansListParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the ipam vlans list params +func (o *IPAMVlansListParams) SetRole(role *string) { + o.Role = role +} + +// WithRoleID adds the roleID to the ipam vlans list params +func (o *IPAMVlansListParams) WithRoleID(roleID *string) *IPAMVlansListParams { + o.SetRoleID(roleID) + return o +} + +// SetRoleID adds the roleId to the ipam vlans list params +func (o *IPAMVlansListParams) SetRoleID(roleID *string) { + o.RoleID = roleID +} + +// WithSite adds the site to the ipam vlans list params +func (o *IPAMVlansListParams) WithSite(site *string) *IPAMVlansListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the ipam vlans list params +func (o *IPAMVlansListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the ipam vlans list params +func (o *IPAMVlansListParams) WithSiteID(siteID *string) *IPAMVlansListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the ipam vlans list params +func (o *IPAMVlansListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithStatus adds the status to the ipam vlans list params +func (o *IPAMVlansListParams) WithStatus(status *string) *IPAMVlansListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the ipam vlans list params +func (o *IPAMVlansListParams) SetStatus(status *string) { + o.Status = status +} + +// WithTenant adds the tenant to the ipam vlans list params +func (o *IPAMVlansListParams) WithTenant(tenant *string) *IPAMVlansListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the ipam vlans list params +func (o *IPAMVlansListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the ipam vlans list params +func (o *IPAMVlansListParams) WithTenantID(tenantID *string) *IPAMVlansListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the ipam vlans list params +func (o *IPAMVlansListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WithVid adds the vid to the ipam vlans list params +func (o *IPAMVlansListParams) WithVid(vid *float64) *IPAMVlansListParams { + o.SetVid(vid) + return o +} + +// SetVid adds the vid to the ipam vlans list params +func (o *IPAMVlansListParams) SetVid(vid *float64) { + o.Vid = vid +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlansListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); 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.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.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.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.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.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.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.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.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.Vid != nil { + + // query param vid + var qrVid float64 + if o.Vid != nil { + qrVid = *o.Vid + } + qVid := swag.FormatFloat64(qrVid) + if qVid != "" { + if err := r.SetQueryParam("vid", qVid); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_list_responses.go new file mode 100644 index 0000000..6b6c0c1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVlansListReader is a Reader for the IPAMVlansList structure. +type IPAMVlansListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlansListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlansListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVlansListOK creates a IPAMVlansListOK with default headers values +func NewIPAMVlansListOK() *IPAMVlansListOK { + return &IPAMVlansListOK{} +} + +/*IPAMVlansListOK handles this case with default header values. + +IPAMVlansListOK ipam vlans list o k +*/ +type IPAMVlansListOK struct { + Payload *models.IPAMVlansListOKBody +} + +func (o *IPAMVlansListOK) Error() string { + return fmt.Sprintf("[GET /ipam/vlans/][%d] ipamVlansListOK %+v", 200, o.Payload) +} + +func (o *IPAMVlansListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMVlansListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_partial_update_parameters.go new file mode 100644 index 0000000..3bb7a23 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMVlansPartialUpdateParams creates a new IPAMVlansPartialUpdateParams object +// with the default values initialized. +func NewIPAMVlansPartialUpdateParams() *IPAMVlansPartialUpdateParams { + var () + return &IPAMVlansPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlansPartialUpdateParamsWithTimeout creates a new IPAMVlansPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlansPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMVlansPartialUpdateParams { + var () + return &IPAMVlansPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMVlansPartialUpdateParamsWithContext creates a new IPAMVlansPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlansPartialUpdateParamsWithContext(ctx context.Context) *IPAMVlansPartialUpdateParams { + var () + return &IPAMVlansPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMVlansPartialUpdateParamsWithHTTPClient creates a new IPAMVlansPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlansPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMVlansPartialUpdateParams { + var () + return &IPAMVlansPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMVlansPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam vlans partial update operation typically these are written to a http.Request +*/ +type IPAMVlansPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableVLAN + /*ID + A unique integer value identifying this VLAN. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMVlansPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) WithContext(ctx context.Context) *IPAMVlansPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMVlansPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) WithData(data *models.WritableVLAN) *IPAMVlansPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) SetData(data *models.WritableVLAN) { + o.Data = data +} + +// WithID adds the id to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) WithID(id int64) *IPAMVlansPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlansPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_partial_update_responses.go new file mode 100644 index 0000000..0b064ae --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVlansPartialUpdateReader is a Reader for the IPAMVlansPartialUpdate structure. +type IPAMVlansPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlansPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlansPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVlansPartialUpdateOK creates a IPAMVlansPartialUpdateOK with default headers values +func NewIPAMVlansPartialUpdateOK() *IPAMVlansPartialUpdateOK { + return &IPAMVlansPartialUpdateOK{} +} + +/*IPAMVlansPartialUpdateOK handles this case with default header values. + +IPAMVlansPartialUpdateOK ipam vlans partial update o k +*/ +type IPAMVlansPartialUpdateOK struct { + Payload *models.WritableVLAN +} + +func (o *IPAMVlansPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/vlans/{id}/][%d] ipamVlansPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMVlansPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVLAN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_read_parameters.go new file mode 100644 index 0000000..e2de89b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMVlansReadParams creates a new IPAMVlansReadParams object +// with the default values initialized. +func NewIPAMVlansReadParams() *IPAMVlansReadParams { + var () + return &IPAMVlansReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlansReadParamsWithTimeout creates a new IPAMVlansReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlansReadParamsWithTimeout(timeout time.Duration) *IPAMVlansReadParams { + var () + return &IPAMVlansReadParams{ + + timeout: timeout, + } +} + +// NewIPAMVlansReadParamsWithContext creates a new IPAMVlansReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlansReadParamsWithContext(ctx context.Context) *IPAMVlansReadParams { + var () + return &IPAMVlansReadParams{ + + Context: ctx, + } +} + +// NewIPAMVlansReadParamsWithHTTPClient creates a new IPAMVlansReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlansReadParamsWithHTTPClient(client *http.Client) *IPAMVlansReadParams { + var () + return &IPAMVlansReadParams{ + HTTPClient: client, + } +} + +/*IPAMVlansReadParams contains all the parameters to send to the API endpoint +for the ipam vlans read operation typically these are written to a http.Request +*/ +type IPAMVlansReadParams struct { + + /*ID + A unique integer value identifying this VLAN. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlans read params +func (o *IPAMVlansReadParams) WithTimeout(timeout time.Duration) *IPAMVlansReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlans read params +func (o *IPAMVlansReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlans read params +func (o *IPAMVlansReadParams) WithContext(ctx context.Context) *IPAMVlansReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlans read params +func (o *IPAMVlansReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlans read params +func (o *IPAMVlansReadParams) WithHTTPClient(client *http.Client) *IPAMVlansReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlans read params +func (o *IPAMVlansReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam vlans read params +func (o *IPAMVlansReadParams) WithID(id int64) *IPAMVlansReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlans read params +func (o *IPAMVlansReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlansReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_read_responses.go new file mode 100644 index 0000000..f32ac9c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVlansReadReader is a Reader for the IPAMVlansRead structure. +type IPAMVlansReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlansReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlansReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVlansReadOK creates a IPAMVlansReadOK with default headers values +func NewIPAMVlansReadOK() *IPAMVlansReadOK { + return &IPAMVlansReadOK{} +} + +/*IPAMVlansReadOK handles this case with default header values. + +IPAMVlansReadOK ipam vlans read o k +*/ +type IPAMVlansReadOK struct { + Payload *models.VLAN +} + +func (o *IPAMVlansReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/vlans/{id}/][%d] ipamVlansReadOK %+v", 200, o.Payload) +} + +func (o *IPAMVlansReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VLAN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_update_parameters.go new file mode 100644 index 0000000..9768c16 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMVlansUpdateParams creates a new IPAMVlansUpdateParams object +// with the default values initialized. +func NewIPAMVlansUpdateParams() *IPAMVlansUpdateParams { + var () + return &IPAMVlansUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlansUpdateParamsWithTimeout creates a new IPAMVlansUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlansUpdateParamsWithTimeout(timeout time.Duration) *IPAMVlansUpdateParams { + var () + return &IPAMVlansUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMVlansUpdateParamsWithContext creates a new IPAMVlansUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlansUpdateParamsWithContext(ctx context.Context) *IPAMVlansUpdateParams { + var () + return &IPAMVlansUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMVlansUpdateParamsWithHTTPClient creates a new IPAMVlansUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlansUpdateParamsWithHTTPClient(client *http.Client) *IPAMVlansUpdateParams { + var () + return &IPAMVlansUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMVlansUpdateParams contains all the parameters to send to the API endpoint +for the ipam vlans update operation typically these are written to a http.Request +*/ +type IPAMVlansUpdateParams struct { + + /*Data*/ + Data *models.WritableVLAN + /*ID + A unique integer value identifying this VLAN. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlans update params +func (o *IPAMVlansUpdateParams) WithTimeout(timeout time.Duration) *IPAMVlansUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlans update params +func (o *IPAMVlansUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlans update params +func (o *IPAMVlansUpdateParams) WithContext(ctx context.Context) *IPAMVlansUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlans update params +func (o *IPAMVlansUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlans update params +func (o *IPAMVlansUpdateParams) WithHTTPClient(client *http.Client) *IPAMVlansUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlans update params +func (o *IPAMVlansUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vlans update params +func (o *IPAMVlansUpdateParams) WithData(data *models.WritableVLAN) *IPAMVlansUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vlans update params +func (o *IPAMVlansUpdateParams) SetData(data *models.WritableVLAN) { + o.Data = data +} + +// WithID adds the id to the ipam vlans update params +func (o *IPAMVlansUpdateParams) WithID(id int64) *IPAMVlansUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlans update params +func (o *IPAMVlansUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlansUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_update_responses.go new file mode 100644 index 0000000..8d7d1e7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvlans_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVlansUpdateReader is a Reader for the IPAMVlansUpdate structure. +type IPAMVlansUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlansUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlansUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVlansUpdateOK creates a IPAMVlansUpdateOK with default headers values +func NewIPAMVlansUpdateOK() *IPAMVlansUpdateOK { + return &IPAMVlansUpdateOK{} +} + +/*IPAMVlansUpdateOK handles this case with default header values. + +IPAMVlansUpdateOK ipam vlans update o k +*/ +type IPAMVlansUpdateOK struct { + Payload *models.WritableVLAN +} + +func (o *IPAMVlansUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/vlans/{id}/][%d] ipamVlansUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMVlansUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVLAN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_create_parameters.go new file mode 100644 index 0000000..45ba2af --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMVrfsCreateParams creates a new IPAMVrfsCreateParams object +// with the default values initialized. +func NewIPAMVrfsCreateParams() *IPAMVrfsCreateParams { + var () + return &IPAMVrfsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVrfsCreateParamsWithTimeout creates a new IPAMVrfsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVrfsCreateParamsWithTimeout(timeout time.Duration) *IPAMVrfsCreateParams { + var () + return &IPAMVrfsCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMVrfsCreateParamsWithContext creates a new IPAMVrfsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVrfsCreateParamsWithContext(ctx context.Context) *IPAMVrfsCreateParams { + var () + return &IPAMVrfsCreateParams{ + + Context: ctx, + } +} + +// NewIPAMVrfsCreateParamsWithHTTPClient creates a new IPAMVrfsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVrfsCreateParamsWithHTTPClient(client *http.Client) *IPAMVrfsCreateParams { + var () + return &IPAMVrfsCreateParams{ + HTTPClient: client, + } +} + +/*IPAMVrfsCreateParams contains all the parameters to send to the API endpoint +for the ipam vrfs create operation typically these are written to a http.Request +*/ +type IPAMVrfsCreateParams struct { + + /*Data*/ + Data *models.WritableVRF + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vrfs create params +func (o *IPAMVrfsCreateParams) WithTimeout(timeout time.Duration) *IPAMVrfsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vrfs create params +func (o *IPAMVrfsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vrfs create params +func (o *IPAMVrfsCreateParams) WithContext(ctx context.Context) *IPAMVrfsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vrfs create params +func (o *IPAMVrfsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vrfs create params +func (o *IPAMVrfsCreateParams) WithHTTPClient(client *http.Client) *IPAMVrfsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vrfs create params +func (o *IPAMVrfsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vrfs create params +func (o *IPAMVrfsCreateParams) WithData(data *models.WritableVRF) *IPAMVrfsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vrfs create params +func (o *IPAMVrfsCreateParams) SetData(data *models.WritableVRF) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVrfsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_create_responses.go new file mode 100644 index 0000000..70d70ee --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVrfsCreateReader is a Reader for the IPAMVrfsCreate structure. +type IPAMVrfsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVrfsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMVrfsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVrfsCreateCreated creates a IPAMVrfsCreateCreated with default headers values +func NewIPAMVrfsCreateCreated() *IPAMVrfsCreateCreated { + return &IPAMVrfsCreateCreated{} +} + +/*IPAMVrfsCreateCreated handles this case with default header values. + +IPAMVrfsCreateCreated ipam vrfs create created +*/ +type IPAMVrfsCreateCreated struct { + Payload *models.WritableVRF +} + +func (o *IPAMVrfsCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/vrfs/][%d] ipamVrfsCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMVrfsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVRF) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_delete_parameters.go new file mode 100644 index 0000000..f2d4b38 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMVrfsDeleteParams creates a new IPAMVrfsDeleteParams object +// with the default values initialized. +func NewIPAMVrfsDeleteParams() *IPAMVrfsDeleteParams { + var () + return &IPAMVrfsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVrfsDeleteParamsWithTimeout creates a new IPAMVrfsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVrfsDeleteParamsWithTimeout(timeout time.Duration) *IPAMVrfsDeleteParams { + var () + return &IPAMVrfsDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMVrfsDeleteParamsWithContext creates a new IPAMVrfsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVrfsDeleteParamsWithContext(ctx context.Context) *IPAMVrfsDeleteParams { + var () + return &IPAMVrfsDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMVrfsDeleteParamsWithHTTPClient creates a new IPAMVrfsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVrfsDeleteParamsWithHTTPClient(client *http.Client) *IPAMVrfsDeleteParams { + var () + return &IPAMVrfsDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMVrfsDeleteParams contains all the parameters to send to the API endpoint +for the ipam vrfs delete operation typically these are written to a http.Request +*/ +type IPAMVrfsDeleteParams struct { + + /*ID + A unique integer value identifying this VRF. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vrfs delete params +func (o *IPAMVrfsDeleteParams) WithTimeout(timeout time.Duration) *IPAMVrfsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vrfs delete params +func (o *IPAMVrfsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vrfs delete params +func (o *IPAMVrfsDeleteParams) WithContext(ctx context.Context) *IPAMVrfsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vrfs delete params +func (o *IPAMVrfsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vrfs delete params +func (o *IPAMVrfsDeleteParams) WithHTTPClient(client *http.Client) *IPAMVrfsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vrfs delete params +func (o *IPAMVrfsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam vrfs delete params +func (o *IPAMVrfsDeleteParams) WithID(id int64) *IPAMVrfsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vrfs delete params +func (o *IPAMVrfsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVrfsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_delete_responses.go new file mode 100644 index 0000000..4dc6950 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMVrfsDeleteReader is a Reader for the IPAMVrfsDelete structure. +type IPAMVrfsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVrfsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMVrfsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVrfsDeleteNoContent creates a IPAMVrfsDeleteNoContent with default headers values +func NewIPAMVrfsDeleteNoContent() *IPAMVrfsDeleteNoContent { + return &IPAMVrfsDeleteNoContent{} +} + +/*IPAMVrfsDeleteNoContent handles this case with default header values. + +IPAMVrfsDeleteNoContent ipam vrfs delete no content +*/ +type IPAMVrfsDeleteNoContent struct { +} + +func (o *IPAMVrfsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/vrfs/{id}/][%d] ipamVrfsDeleteNoContent ", 204) +} + +func (o *IPAMVrfsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_list_parameters.go new file mode 100644 index 0000000..d84f154 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_list_parameters.go @@ -0,0 +1,401 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMVrfsListParams creates a new IPAMVrfsListParams object +// with the default values initialized. +func NewIPAMVrfsListParams() *IPAMVrfsListParams { + var () + return &IPAMVrfsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVrfsListParamsWithTimeout creates a new IPAMVrfsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVrfsListParamsWithTimeout(timeout time.Duration) *IPAMVrfsListParams { + var () + return &IPAMVrfsListParams{ + + timeout: timeout, + } +} + +// NewIPAMVrfsListParamsWithContext creates a new IPAMVrfsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVrfsListParamsWithContext(ctx context.Context) *IPAMVrfsListParams { + var () + return &IPAMVrfsListParams{ + + Context: ctx, + } +} + +// NewIPAMVrfsListParamsWithHTTPClient creates a new IPAMVrfsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVrfsListParamsWithHTTPClient(client *http.Client) *IPAMVrfsListParams { + var () + return &IPAMVrfsListParams{ + HTTPClient: client, + } +} + +/*IPAMVrfsListParams contains all the parameters to send to the API endpoint +for the ipam vrfs list operation typically these are written to a http.Request +*/ +type IPAMVrfsListParams struct { + + /*EnforceUnique*/ + EnforceUnique *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Rd*/ + Rd *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithTimeout(timeout time.Duration) *IPAMVrfsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithContext(ctx context.Context) *IPAMVrfsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithHTTPClient(client *http.Client) *IPAMVrfsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEnforceUnique adds the enforceUnique to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithEnforceUnique(enforceUnique *string) *IPAMVrfsListParams { + o.SetEnforceUnique(enforceUnique) + return o +} + +// SetEnforceUnique adds the enforceUnique to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetEnforceUnique(enforceUnique *string) { + o.EnforceUnique = enforceUnique +} + +// WithIDIn adds the iDIn to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithIDIn(iDIn *string) *IPAMVrfsListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithLimit(limit *int64) *IPAMVrfsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithName(name *string) *IPAMVrfsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithOffset(offset *int64) *IPAMVrfsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithQ(q *string) *IPAMVrfsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetQ(q *string) { + o.Q = q +} + +// WithRd adds the rd to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithRd(rd *string) *IPAMVrfsListParams { + o.SetRd(rd) + return o +} + +// SetRd adds the rd to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetRd(rd *string) { + o.Rd = rd +} + +// WithTenant adds the tenant to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithTenant(tenant *string) *IPAMVrfsListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithTenantID(tenantID *string) *IPAMVrfsListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVrfsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EnforceUnique != nil { + + // query param enforce_unique + var qrEnforceUnique string + if o.EnforceUnique != nil { + qrEnforceUnique = *o.EnforceUnique + } + qEnforceUnique := qrEnforceUnique + if qEnforceUnique != "" { + if err := r.SetQueryParam("enforce_unique", qEnforceUnique); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); 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.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.Rd != nil { + + // query param rd + var qrRd string + if o.Rd != nil { + qrRd = *o.Rd + } + qRd := qrRd + if qRd != "" { + if err := r.SetQueryParam("rd", qRd); 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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_list_responses.go new file mode 100644 index 0000000..884edd2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVrfsListReader is a Reader for the IPAMVrfsList structure. +type IPAMVrfsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVrfsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVrfsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVrfsListOK creates a IPAMVrfsListOK with default headers values +func NewIPAMVrfsListOK() *IPAMVrfsListOK { + return &IPAMVrfsListOK{} +} + +/*IPAMVrfsListOK handles this case with default header values. + +IPAMVrfsListOK ipam vrfs list o k +*/ +type IPAMVrfsListOK struct { + Payload *models.IPAMVrfsListOKBody +} + +func (o *IPAMVrfsListOK) Error() string { + return fmt.Sprintf("[GET /ipam/vrfs/][%d] ipamVrfsListOK %+v", 200, o.Payload) +} + +func (o *IPAMVrfsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMVrfsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_partial_update_parameters.go new file mode 100644 index 0000000..b8847cd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMVrfsPartialUpdateParams creates a new IPAMVrfsPartialUpdateParams object +// with the default values initialized. +func NewIPAMVrfsPartialUpdateParams() *IPAMVrfsPartialUpdateParams { + var () + return &IPAMVrfsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVrfsPartialUpdateParamsWithTimeout creates a new IPAMVrfsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVrfsPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMVrfsPartialUpdateParams { + var () + return &IPAMVrfsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMVrfsPartialUpdateParamsWithContext creates a new IPAMVrfsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVrfsPartialUpdateParamsWithContext(ctx context.Context) *IPAMVrfsPartialUpdateParams { + var () + return &IPAMVrfsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMVrfsPartialUpdateParamsWithHTTPClient creates a new IPAMVrfsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVrfsPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMVrfsPartialUpdateParams { + var () + return &IPAMVrfsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMVrfsPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam vrfs partial update operation typically these are written to a http.Request +*/ +type IPAMVrfsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableVRF + /*ID + A unique integer value identifying this VRF. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMVrfsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) WithContext(ctx context.Context) *IPAMVrfsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMVrfsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) WithData(data *models.WritableVRF) *IPAMVrfsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) SetData(data *models.WritableVRF) { + o.Data = data +} + +// WithID adds the id to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) WithID(id int64) *IPAMVrfsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVrfsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_partial_update_responses.go new file mode 100644 index 0000000..2b18174 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVrfsPartialUpdateReader is a Reader for the IPAMVrfsPartialUpdate structure. +type IPAMVrfsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVrfsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVrfsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVrfsPartialUpdateOK creates a IPAMVrfsPartialUpdateOK with default headers values +func NewIPAMVrfsPartialUpdateOK() *IPAMVrfsPartialUpdateOK { + return &IPAMVrfsPartialUpdateOK{} +} + +/*IPAMVrfsPartialUpdateOK handles this case with default header values. + +IPAMVrfsPartialUpdateOK ipam vrfs partial update o k +*/ +type IPAMVrfsPartialUpdateOK struct { + Payload *models.WritableVRF +} + +func (o *IPAMVrfsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/vrfs/{id}/][%d] ipamVrfsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMVrfsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVRF) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_read_parameters.go new file mode 100644 index 0000000..4dfcd85 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMVrfsReadParams creates a new IPAMVrfsReadParams object +// with the default values initialized. +func NewIPAMVrfsReadParams() *IPAMVrfsReadParams { + var () + return &IPAMVrfsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVrfsReadParamsWithTimeout creates a new IPAMVrfsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVrfsReadParamsWithTimeout(timeout time.Duration) *IPAMVrfsReadParams { + var () + return &IPAMVrfsReadParams{ + + timeout: timeout, + } +} + +// NewIPAMVrfsReadParamsWithContext creates a new IPAMVrfsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVrfsReadParamsWithContext(ctx context.Context) *IPAMVrfsReadParams { + var () + return &IPAMVrfsReadParams{ + + Context: ctx, + } +} + +// NewIPAMVrfsReadParamsWithHTTPClient creates a new IPAMVrfsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVrfsReadParamsWithHTTPClient(client *http.Client) *IPAMVrfsReadParams { + var () + return &IPAMVrfsReadParams{ + HTTPClient: client, + } +} + +/*IPAMVrfsReadParams contains all the parameters to send to the API endpoint +for the ipam vrfs read operation typically these are written to a http.Request +*/ +type IPAMVrfsReadParams struct { + + /*ID + A unique integer value identifying this VRF. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vrfs read params +func (o *IPAMVrfsReadParams) WithTimeout(timeout time.Duration) *IPAMVrfsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vrfs read params +func (o *IPAMVrfsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vrfs read params +func (o *IPAMVrfsReadParams) WithContext(ctx context.Context) *IPAMVrfsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vrfs read params +func (o *IPAMVrfsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vrfs read params +func (o *IPAMVrfsReadParams) WithHTTPClient(client *http.Client) *IPAMVrfsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vrfs read params +func (o *IPAMVrfsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam vrfs read params +func (o *IPAMVrfsReadParams) WithID(id int64) *IPAMVrfsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vrfs read params +func (o *IPAMVrfsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVrfsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_read_responses.go new file mode 100644 index 0000000..56e6293 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVrfsReadReader is a Reader for the IPAMVrfsRead structure. +type IPAMVrfsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVrfsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVrfsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVrfsReadOK creates a IPAMVrfsReadOK with default headers values +func NewIPAMVrfsReadOK() *IPAMVrfsReadOK { + return &IPAMVrfsReadOK{} +} + +/*IPAMVrfsReadOK handles this case with default header values. + +IPAMVrfsReadOK ipam vrfs read o k +*/ +type IPAMVrfsReadOK struct { + Payload *models.VRF +} + +func (o *IPAMVrfsReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/vrfs/{id}/][%d] ipamVrfsReadOK %+v", 200, o.Payload) +} + +func (o *IPAMVrfsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VRF) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_update_parameters.go new file mode 100644 index 0000000..9d7ad62 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewIPAMVrfsUpdateParams creates a new IPAMVrfsUpdateParams object +// with the default values initialized. +func NewIPAMVrfsUpdateParams() *IPAMVrfsUpdateParams { + var () + return &IPAMVrfsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVrfsUpdateParamsWithTimeout creates a new IPAMVrfsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVrfsUpdateParamsWithTimeout(timeout time.Duration) *IPAMVrfsUpdateParams { + var () + return &IPAMVrfsUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMVrfsUpdateParamsWithContext creates a new IPAMVrfsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVrfsUpdateParamsWithContext(ctx context.Context) *IPAMVrfsUpdateParams { + var () + return &IPAMVrfsUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMVrfsUpdateParamsWithHTTPClient creates a new IPAMVrfsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVrfsUpdateParamsWithHTTPClient(client *http.Client) *IPAMVrfsUpdateParams { + var () + return &IPAMVrfsUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMVrfsUpdateParams contains all the parameters to send to the API endpoint +for the ipam vrfs update operation typically these are written to a http.Request +*/ +type IPAMVrfsUpdateParams struct { + + /*Data*/ + Data *models.WritableVRF + /*ID + A unique integer value identifying this VRF. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) WithTimeout(timeout time.Duration) *IPAMVrfsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) WithContext(ctx context.Context) *IPAMVrfsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) WithHTTPClient(client *http.Client) *IPAMVrfsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) WithData(data *models.WritableVRF) *IPAMVrfsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) SetData(data *models.WritableVRF) { + o.Data = data +} + +// WithID adds the id to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) WithID(id int64) *IPAMVrfsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVrfsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_update_responses.go new file mode 100644 index 0000000..972bf84 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/ipam/ip_amvrfs_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVrfsUpdateReader is a Reader for the IPAMVrfsUpdate structure. +type IPAMVrfsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVrfsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVrfsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVrfsUpdateOK creates a IPAMVrfsUpdateOK with default headers values +func NewIPAMVrfsUpdateOK() *IPAMVrfsUpdateOK { + return &IPAMVrfsUpdateOK{} +} + +/*IPAMVrfsUpdateOK handles this case with default header values. + +IPAMVrfsUpdateOK ipam vrfs update o k +*/ +type IPAMVrfsUpdateOK struct { + Payload *models.WritableVRF +} + +func (o *IPAMVrfsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/vrfs/{id}/][%d] ipamVrfsUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMVrfsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVRF) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/net_box_client.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/net_box_client.go new file mode 100644 index 0000000..dd3bbbe --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/net_box_client.go @@ -0,0 +1,171 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 client + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/client/circuits" + "github.com/digitalocean/go-netbox/netbox/client/dcim" + "github.com/digitalocean/go-netbox/netbox/client/extras" + "github.com/digitalocean/go-netbox/netbox/client/ipam" + "github.com/digitalocean/go-netbox/netbox/client/secrets" + "github.com/digitalocean/go-netbox/netbox/client/tenancy" + "github.com/digitalocean/go-netbox/netbox/client/virtualization" +) + +// Default net box HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "localhost:8000" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/api" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new net box HTTP client. +func NewHTTPClient(formats strfmt.Registry) *NetBox { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new net box HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *NetBox { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new net box client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *NetBox { + cli := new(NetBox) + cli.Transport = transport + + cli.Circuits = circuits.New(transport, formats) + + cli.Dcim = dcim.New(transport, formats) + + cli.Extras = extras.New(transport, formats) + + cli.IPAM = ipam.New(transport, formats) + + cli.Secrets = secrets.New(transport, formats) + + cli.Tenancy = tenancy.New(transport, formats) + + cli.Virtualization = virtualization.New(transport, formats) + + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// NetBox is a client for net box +type NetBox struct { + Circuits *circuits.Client + + Dcim *dcim.Client + + Extras *extras.Client + + IPAM *ipam.Client + + Secrets *secrets.Client + + Tenancy *tenancy.Client + + Virtualization *virtualization.Client + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *NetBox) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + + c.Circuits.SetTransport(transport) + + c.Dcim.SetTransport(transport) + + c.Extras.SetTransport(transport) + + c.IPAM.SetTransport(transport) + + c.Secrets.SetTransport(transport) + + c.Tenancy.SetTransport(transport) + + c.Virtualization.SetTransport(transport) + +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_choices_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_choices_list_parameters.go new file mode 100644 index 0000000..f195561 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_choices_list_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewSecretsChoicesListParams creates a new SecretsChoicesListParams object +// with the default values initialized. +func NewSecretsChoicesListParams() *SecretsChoicesListParams { + + return &SecretsChoicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsChoicesListParamsWithTimeout creates a new SecretsChoicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsChoicesListParamsWithTimeout(timeout time.Duration) *SecretsChoicesListParams { + + return &SecretsChoicesListParams{ + + timeout: timeout, + } +} + +// NewSecretsChoicesListParamsWithContext creates a new SecretsChoicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsChoicesListParamsWithContext(ctx context.Context) *SecretsChoicesListParams { + + return &SecretsChoicesListParams{ + + Context: ctx, + } +} + +// NewSecretsChoicesListParamsWithHTTPClient creates a new SecretsChoicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsChoicesListParamsWithHTTPClient(client *http.Client) *SecretsChoicesListParams { + + return &SecretsChoicesListParams{ + HTTPClient: client, + } +} + +/*SecretsChoicesListParams contains all the parameters to send to the API endpoint +for the secrets choices list operation typically these are written to a http.Request +*/ +type SecretsChoicesListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets choices list params +func (o *SecretsChoicesListParams) WithTimeout(timeout time.Duration) *SecretsChoicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets choices list params +func (o *SecretsChoicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets choices list params +func (o *SecretsChoicesListParams) WithContext(ctx context.Context) *SecretsChoicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets choices list params +func (o *SecretsChoicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets choices list params +func (o *SecretsChoicesListParams) WithHTTPClient(client *http.Client) *SecretsChoicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets choices list params +func (o *SecretsChoicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsChoicesListParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_choices_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_choices_list_responses.go new file mode 100644 index 0000000..6990d01 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_choices_list_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// SecretsChoicesListReader is a Reader for the SecretsChoicesList structure. +type SecretsChoicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsChoicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsChoicesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSecretsChoicesListOK creates a SecretsChoicesListOK with default headers values +func NewSecretsChoicesListOK() *SecretsChoicesListOK { + return &SecretsChoicesListOK{} +} + +/*SecretsChoicesListOK handles this case with default header values. + +SecretsChoicesListOK secrets choices list o k +*/ +type SecretsChoicesListOK struct { +} + +func (o *SecretsChoicesListOK) Error() string { + return fmt.Sprintf("[GET /secrets/_choices/][%d] secretsChoicesListOK ", 200) +} + +func (o *SecretsChoicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_choices_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_choices_read_parameters.go new file mode 100644 index 0000000..9f8e92d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_choices_read_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewSecretsChoicesReadParams creates a new SecretsChoicesReadParams object +// with the default values initialized. +func NewSecretsChoicesReadParams() *SecretsChoicesReadParams { + var () + return &SecretsChoicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsChoicesReadParamsWithTimeout creates a new SecretsChoicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsChoicesReadParamsWithTimeout(timeout time.Duration) *SecretsChoicesReadParams { + var () + return &SecretsChoicesReadParams{ + + timeout: timeout, + } +} + +// NewSecretsChoicesReadParamsWithContext creates a new SecretsChoicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsChoicesReadParamsWithContext(ctx context.Context) *SecretsChoicesReadParams { + var () + return &SecretsChoicesReadParams{ + + Context: ctx, + } +} + +// NewSecretsChoicesReadParamsWithHTTPClient creates a new SecretsChoicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsChoicesReadParamsWithHTTPClient(client *http.Client) *SecretsChoicesReadParams { + var () + return &SecretsChoicesReadParams{ + HTTPClient: client, + } +} + +/*SecretsChoicesReadParams contains all the parameters to send to the API endpoint +for the secrets choices read operation typically these are written to a http.Request +*/ +type SecretsChoicesReadParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets choices read params +func (o *SecretsChoicesReadParams) WithTimeout(timeout time.Duration) *SecretsChoicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets choices read params +func (o *SecretsChoicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets choices read params +func (o *SecretsChoicesReadParams) WithContext(ctx context.Context) *SecretsChoicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets choices read params +func (o *SecretsChoicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets choices read params +func (o *SecretsChoicesReadParams) WithHTTPClient(client *http.Client) *SecretsChoicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets choices read params +func (o *SecretsChoicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the secrets choices read params +func (o *SecretsChoicesReadParams) WithID(id string) *SecretsChoicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets choices read params +func (o *SecretsChoicesReadParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsChoicesReadParams) 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", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_choices_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_choices_read_responses.go new file mode 100644 index 0000000..e85f4f5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_choices_read_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// SecretsChoicesReadReader is a Reader for the SecretsChoicesRead structure. +type SecretsChoicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsChoicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsChoicesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSecretsChoicesReadOK creates a SecretsChoicesReadOK with default headers values +func NewSecretsChoicesReadOK() *SecretsChoicesReadOK { + return &SecretsChoicesReadOK{} +} + +/*SecretsChoicesReadOK handles this case with default header values. + +SecretsChoicesReadOK secrets choices read o k +*/ +type SecretsChoicesReadOK struct { +} + +func (o *SecretsChoicesReadOK) Error() string { + return fmt.Sprintf("[GET /secrets/_choices/{id}/][%d] secretsChoicesReadOK ", 200) +} + +func (o *SecretsChoicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_client.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_client.go new file mode 100644 index 0000000..43f4525 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_client.go @@ -0,0 +1,526 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new secrets API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for secrets API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +SecretsChoicesList secrets choices list API +*/ +func (a *Client) SecretsChoicesList(params *SecretsChoicesListParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsChoicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsChoicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets__choices_list", + Method: "GET", + PathPattern: "/secrets/_choices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsChoicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsChoicesListOK), nil + +} + +/* +SecretsChoicesRead secrets choices read API +*/ +func (a *Client) SecretsChoicesRead(params *SecretsChoicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsChoicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsChoicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets__choices_read", + Method: "GET", + PathPattern: "/secrets/_choices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsChoicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsChoicesReadOK), nil + +} + +/* +SecretsGenerateRsaKeyPairList This endpoint can be used to generate a new RSA key pair. The keys are returned in PEM format. + + { + "public_key": "", + "private_key": "" + } +*/ +func (a *Client) SecretsGenerateRsaKeyPairList(params *SecretsGenerateRsaKeyPairListParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsGenerateRsaKeyPairListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsGenerateRsaKeyPairListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_generate-rsa-key-pair_list", + Method: "GET", + PathPattern: "/secrets/generate-rsa-key-pair/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsGenerateRsaKeyPairListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsGenerateRsaKeyPairListOK), nil + +} + +/* +SecretsGetSessionKeyCreate Retrieve a temporary session key to use for encrypting and decrypting secrets via the API. The user's private RSA +key is POSTed with the name `private_key`. An example: + + curl -v -X POST -H "Authorization: Token " -H "Accept: application/json; indent=4" \ + --data-urlencode "private_key@" https://netbox/api/secrets/get-session-key/ + +This request will yield a base64-encoded session key to be included in an `X-Session-Key` header in future requests: + + { + "session_key": "+8t4SI6XikgVmB5+/urhozx9O5qCQANyOk1MNe6taRf=" + } + +This endpoint accepts one optional parameter: `preserve_key`. If True and a session key exists, the existing session +key will be returned instead of a new one. +*/ +func (a *Client) SecretsGetSessionKeyCreate(params *SecretsGetSessionKeyCreateParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsGetSessionKeyCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsGetSessionKeyCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_get-session-key_create", + Method: "POST", + PathPattern: "/secrets/get-session-key/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsGetSessionKeyCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsGetSessionKeyCreateCreated), nil + +} + +/* +SecretsSecretRolesCreate secrets secret roles create API +*/ +func (a *Client) SecretsSecretRolesCreate(params *SecretsSecretRolesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretRolesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretRolesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secret-roles_create", + Method: "POST", + PathPattern: "/secrets/secret-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretRolesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretRolesCreateCreated), nil + +} + +/* +SecretsSecretRolesDelete secrets secret roles delete API +*/ +func (a *Client) SecretsSecretRolesDelete(params *SecretsSecretRolesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretRolesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretRolesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secret-roles_delete", + Method: "DELETE", + PathPattern: "/secrets/secret-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretRolesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretRolesDeleteNoContent), nil + +} + +/* +SecretsSecretRolesList secrets secret roles list API +*/ +func (a *Client) SecretsSecretRolesList(params *SecretsSecretRolesListParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretRolesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretRolesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secret-roles_list", + Method: "GET", + PathPattern: "/secrets/secret-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretRolesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretRolesListOK), nil + +} + +/* +SecretsSecretRolesPartialUpdate secrets secret roles partial update API +*/ +func (a *Client) SecretsSecretRolesPartialUpdate(params *SecretsSecretRolesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretRolesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretRolesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secret-roles_partial_update", + Method: "PATCH", + PathPattern: "/secrets/secret-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretRolesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretRolesPartialUpdateOK), nil + +} + +/* +SecretsSecretRolesRead secrets secret roles read API +*/ +func (a *Client) SecretsSecretRolesRead(params *SecretsSecretRolesReadParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretRolesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretRolesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secret-roles_read", + Method: "GET", + PathPattern: "/secrets/secret-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretRolesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretRolesReadOK), nil + +} + +/* +SecretsSecretRolesUpdate secrets secret roles update API +*/ +func (a *Client) SecretsSecretRolesUpdate(params *SecretsSecretRolesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretRolesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretRolesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secret-roles_update", + Method: "PUT", + PathPattern: "/secrets/secret-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretRolesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretRolesUpdateOK), nil + +} + +/* +SecretsSecretsCreate secrets secrets create API +*/ +func (a *Client) SecretsSecretsCreate(params *SecretsSecretsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secrets_create", + Method: "POST", + PathPattern: "/secrets/secrets/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretsCreateCreated), nil + +} + +/* +SecretsSecretsDelete secrets secrets delete API +*/ +func (a *Client) SecretsSecretsDelete(params *SecretsSecretsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secrets_delete", + Method: "DELETE", + PathPattern: "/secrets/secrets/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretsDeleteNoContent), nil + +} + +/* +SecretsSecretsList secrets secrets list API +*/ +func (a *Client) SecretsSecretsList(params *SecretsSecretsListParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secrets_list", + Method: "GET", + PathPattern: "/secrets/secrets/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretsListOK), nil + +} + +/* +SecretsSecretsPartialUpdate secrets secrets partial update API +*/ +func (a *Client) SecretsSecretsPartialUpdate(params *SecretsSecretsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secrets_partial_update", + Method: "PATCH", + PathPattern: "/secrets/secrets/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretsPartialUpdateOK), nil + +} + +/* +SecretsSecretsRead secrets secrets read API +*/ +func (a *Client) SecretsSecretsRead(params *SecretsSecretsReadParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secrets_read", + Method: "GET", + PathPattern: "/secrets/secrets/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretsReadOK), nil + +} + +/* +SecretsSecretsUpdate secrets secrets update API +*/ +func (a *Client) SecretsSecretsUpdate(params *SecretsSecretsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secrets_update", + Method: "PUT", + PathPattern: "/secrets/secrets/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretsUpdateOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_generate_rsa_key_pair_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_generate_rsa_key_pair_list_parameters.go new file mode 100644 index 0000000..617c6d1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_generate_rsa_key_pair_list_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewSecretsGenerateRsaKeyPairListParams creates a new SecretsGenerateRsaKeyPairListParams object +// with the default values initialized. +func NewSecretsGenerateRsaKeyPairListParams() *SecretsGenerateRsaKeyPairListParams { + + return &SecretsGenerateRsaKeyPairListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsGenerateRsaKeyPairListParamsWithTimeout creates a new SecretsGenerateRsaKeyPairListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsGenerateRsaKeyPairListParamsWithTimeout(timeout time.Duration) *SecretsGenerateRsaKeyPairListParams { + + return &SecretsGenerateRsaKeyPairListParams{ + + timeout: timeout, + } +} + +// NewSecretsGenerateRsaKeyPairListParamsWithContext creates a new SecretsGenerateRsaKeyPairListParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsGenerateRsaKeyPairListParamsWithContext(ctx context.Context) *SecretsGenerateRsaKeyPairListParams { + + return &SecretsGenerateRsaKeyPairListParams{ + + Context: ctx, + } +} + +// NewSecretsGenerateRsaKeyPairListParamsWithHTTPClient creates a new SecretsGenerateRsaKeyPairListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsGenerateRsaKeyPairListParamsWithHTTPClient(client *http.Client) *SecretsGenerateRsaKeyPairListParams { + + return &SecretsGenerateRsaKeyPairListParams{ + HTTPClient: client, + } +} + +/*SecretsGenerateRsaKeyPairListParams contains all the parameters to send to the API endpoint +for the secrets generate rsa key pair list operation typically these are written to a http.Request +*/ +type SecretsGenerateRsaKeyPairListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets generate rsa key pair list params +func (o *SecretsGenerateRsaKeyPairListParams) WithTimeout(timeout time.Duration) *SecretsGenerateRsaKeyPairListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets generate rsa key pair list params +func (o *SecretsGenerateRsaKeyPairListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets generate rsa key pair list params +func (o *SecretsGenerateRsaKeyPairListParams) WithContext(ctx context.Context) *SecretsGenerateRsaKeyPairListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets generate rsa key pair list params +func (o *SecretsGenerateRsaKeyPairListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets generate rsa key pair list params +func (o *SecretsGenerateRsaKeyPairListParams) WithHTTPClient(client *http.Client) *SecretsGenerateRsaKeyPairListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets generate rsa key pair list params +func (o *SecretsGenerateRsaKeyPairListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsGenerateRsaKeyPairListParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_generate_rsa_key_pair_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_generate_rsa_key_pair_list_responses.go new file mode 100644 index 0000000..eac1128 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_generate_rsa_key_pair_list_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// SecretsGenerateRsaKeyPairListReader is a Reader for the SecretsGenerateRsaKeyPairList structure. +type SecretsGenerateRsaKeyPairListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsGenerateRsaKeyPairListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsGenerateRsaKeyPairListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSecretsGenerateRsaKeyPairListOK creates a SecretsGenerateRsaKeyPairListOK with default headers values +func NewSecretsGenerateRsaKeyPairListOK() *SecretsGenerateRsaKeyPairListOK { + return &SecretsGenerateRsaKeyPairListOK{} +} + +/*SecretsGenerateRsaKeyPairListOK handles this case with default header values. + +SecretsGenerateRsaKeyPairListOK secrets generate rsa key pair list o k +*/ +type SecretsGenerateRsaKeyPairListOK struct { +} + +func (o *SecretsGenerateRsaKeyPairListOK) Error() string { + return fmt.Sprintf("[GET /secrets/generate-rsa-key-pair/][%d] secretsGenerateRsaKeyPairListOK ", 200) +} + +func (o *SecretsGenerateRsaKeyPairListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_get_session_key_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_get_session_key_create_parameters.go new file mode 100644 index 0000000..1b6a820 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_get_session_key_create_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewSecretsGetSessionKeyCreateParams creates a new SecretsGetSessionKeyCreateParams object +// with the default values initialized. +func NewSecretsGetSessionKeyCreateParams() *SecretsGetSessionKeyCreateParams { + + return &SecretsGetSessionKeyCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsGetSessionKeyCreateParamsWithTimeout creates a new SecretsGetSessionKeyCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsGetSessionKeyCreateParamsWithTimeout(timeout time.Duration) *SecretsGetSessionKeyCreateParams { + + return &SecretsGetSessionKeyCreateParams{ + + timeout: timeout, + } +} + +// NewSecretsGetSessionKeyCreateParamsWithContext creates a new SecretsGetSessionKeyCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsGetSessionKeyCreateParamsWithContext(ctx context.Context) *SecretsGetSessionKeyCreateParams { + + return &SecretsGetSessionKeyCreateParams{ + + Context: ctx, + } +} + +// NewSecretsGetSessionKeyCreateParamsWithHTTPClient creates a new SecretsGetSessionKeyCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsGetSessionKeyCreateParamsWithHTTPClient(client *http.Client) *SecretsGetSessionKeyCreateParams { + + return &SecretsGetSessionKeyCreateParams{ + HTTPClient: client, + } +} + +/*SecretsGetSessionKeyCreateParams contains all the parameters to send to the API endpoint +for the secrets get session key create operation typically these are written to a http.Request +*/ +type SecretsGetSessionKeyCreateParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets get session key create params +func (o *SecretsGetSessionKeyCreateParams) WithTimeout(timeout time.Duration) *SecretsGetSessionKeyCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets get session key create params +func (o *SecretsGetSessionKeyCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets get session key create params +func (o *SecretsGetSessionKeyCreateParams) WithContext(ctx context.Context) *SecretsGetSessionKeyCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets get session key create params +func (o *SecretsGetSessionKeyCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets get session key create params +func (o *SecretsGetSessionKeyCreateParams) WithHTTPClient(client *http.Client) *SecretsGetSessionKeyCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets get session key create params +func (o *SecretsGetSessionKeyCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsGetSessionKeyCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_get_session_key_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_get_session_key_create_responses.go new file mode 100644 index 0000000..5e68480 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_get_session_key_create_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// SecretsGetSessionKeyCreateReader is a Reader for the SecretsGetSessionKeyCreate structure. +type SecretsGetSessionKeyCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsGetSessionKeyCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewSecretsGetSessionKeyCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSecretsGetSessionKeyCreateCreated creates a SecretsGetSessionKeyCreateCreated with default headers values +func NewSecretsGetSessionKeyCreateCreated() *SecretsGetSessionKeyCreateCreated { + return &SecretsGetSessionKeyCreateCreated{} +} + +/*SecretsGetSessionKeyCreateCreated handles this case with default header values. + +SecretsGetSessionKeyCreateCreated secrets get session key create created +*/ +type SecretsGetSessionKeyCreateCreated struct { +} + +func (o *SecretsGetSessionKeyCreateCreated) Error() string { + return fmt.Sprintf("[POST /secrets/get-session-key/][%d] secretsGetSessionKeyCreateCreated ", 201) +} + +func (o *SecretsGetSessionKeyCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_create_parameters.go new file mode 100644 index 0000000..9079873 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewSecretsSecretRolesCreateParams creates a new SecretsSecretRolesCreateParams object +// with the default values initialized. +func NewSecretsSecretRolesCreateParams() *SecretsSecretRolesCreateParams { + var () + return &SecretsSecretRolesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretRolesCreateParamsWithTimeout creates a new SecretsSecretRolesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretRolesCreateParamsWithTimeout(timeout time.Duration) *SecretsSecretRolesCreateParams { + var () + return &SecretsSecretRolesCreateParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretRolesCreateParamsWithContext creates a new SecretsSecretRolesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretRolesCreateParamsWithContext(ctx context.Context) *SecretsSecretRolesCreateParams { + var () + return &SecretsSecretRolesCreateParams{ + + Context: ctx, + } +} + +// NewSecretsSecretRolesCreateParamsWithHTTPClient creates a new SecretsSecretRolesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretRolesCreateParamsWithHTTPClient(client *http.Client) *SecretsSecretRolesCreateParams { + var () + return &SecretsSecretRolesCreateParams{ + HTTPClient: client, + } +} + +/*SecretsSecretRolesCreateParams contains all the parameters to send to the API endpoint +for the secrets secret roles create operation typically these are written to a http.Request +*/ +type SecretsSecretRolesCreateParams struct { + + /*Data*/ + Data *models.SecretRole + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secret roles create params +func (o *SecretsSecretRolesCreateParams) WithTimeout(timeout time.Duration) *SecretsSecretRolesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secret roles create params +func (o *SecretsSecretRolesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secret roles create params +func (o *SecretsSecretRolesCreateParams) WithContext(ctx context.Context) *SecretsSecretRolesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secret roles create params +func (o *SecretsSecretRolesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secret roles create params +func (o *SecretsSecretRolesCreateParams) WithHTTPClient(client *http.Client) *SecretsSecretRolesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secret roles create params +func (o *SecretsSecretRolesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the secrets secret roles create params +func (o *SecretsSecretRolesCreateParams) WithData(data *models.SecretRole) *SecretsSecretRolesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the secrets secret roles create params +func (o *SecretsSecretRolesCreateParams) SetData(data *models.SecretRole) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretRolesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_create_responses.go new file mode 100644 index 0000000..3e7f580 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// SecretsSecretRolesCreateReader is a Reader for the SecretsSecretRolesCreate structure. +type SecretsSecretRolesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretRolesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewSecretsSecretRolesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSecretsSecretRolesCreateCreated creates a SecretsSecretRolesCreateCreated with default headers values +func NewSecretsSecretRolesCreateCreated() *SecretsSecretRolesCreateCreated { + return &SecretsSecretRolesCreateCreated{} +} + +/*SecretsSecretRolesCreateCreated handles this case with default header values. + +SecretsSecretRolesCreateCreated secrets secret roles create created +*/ +type SecretsSecretRolesCreateCreated struct { + Payload *models.SecretRole +} + +func (o *SecretsSecretRolesCreateCreated) Error() string { + return fmt.Sprintf("[POST /secrets/secret-roles/][%d] secretsSecretRolesCreateCreated %+v", 201, o.Payload) +} + +func (o *SecretsSecretRolesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SecretRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_delete_parameters.go new file mode 100644 index 0000000..a817be2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewSecretsSecretRolesDeleteParams creates a new SecretsSecretRolesDeleteParams object +// with the default values initialized. +func NewSecretsSecretRolesDeleteParams() *SecretsSecretRolesDeleteParams { + var () + return &SecretsSecretRolesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretRolesDeleteParamsWithTimeout creates a new SecretsSecretRolesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretRolesDeleteParamsWithTimeout(timeout time.Duration) *SecretsSecretRolesDeleteParams { + var () + return &SecretsSecretRolesDeleteParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretRolesDeleteParamsWithContext creates a new SecretsSecretRolesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretRolesDeleteParamsWithContext(ctx context.Context) *SecretsSecretRolesDeleteParams { + var () + return &SecretsSecretRolesDeleteParams{ + + Context: ctx, + } +} + +// NewSecretsSecretRolesDeleteParamsWithHTTPClient creates a new SecretsSecretRolesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretRolesDeleteParamsWithHTTPClient(client *http.Client) *SecretsSecretRolesDeleteParams { + var () + return &SecretsSecretRolesDeleteParams{ + HTTPClient: client, + } +} + +/*SecretsSecretRolesDeleteParams contains all the parameters to send to the API endpoint +for the secrets secret roles delete operation typically these are written to a http.Request +*/ +type SecretsSecretRolesDeleteParams struct { + + /*ID + A unique integer value identifying this secret role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secret roles delete params +func (o *SecretsSecretRolesDeleteParams) WithTimeout(timeout time.Duration) *SecretsSecretRolesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secret roles delete params +func (o *SecretsSecretRolesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secret roles delete params +func (o *SecretsSecretRolesDeleteParams) WithContext(ctx context.Context) *SecretsSecretRolesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secret roles delete params +func (o *SecretsSecretRolesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secret roles delete params +func (o *SecretsSecretRolesDeleteParams) WithHTTPClient(client *http.Client) *SecretsSecretRolesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secret roles delete params +func (o *SecretsSecretRolesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the secrets secret roles delete params +func (o *SecretsSecretRolesDeleteParams) WithID(id int64) *SecretsSecretRolesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secret roles delete params +func (o *SecretsSecretRolesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretRolesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_delete_responses.go new file mode 100644 index 0000000..e8691fa --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// SecretsSecretRolesDeleteReader is a Reader for the SecretsSecretRolesDelete structure. +type SecretsSecretRolesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretRolesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewSecretsSecretRolesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSecretsSecretRolesDeleteNoContent creates a SecretsSecretRolesDeleteNoContent with default headers values +func NewSecretsSecretRolesDeleteNoContent() *SecretsSecretRolesDeleteNoContent { + return &SecretsSecretRolesDeleteNoContent{} +} + +/*SecretsSecretRolesDeleteNoContent handles this case with default header values. + +SecretsSecretRolesDeleteNoContent secrets secret roles delete no content +*/ +type SecretsSecretRolesDeleteNoContent struct { +} + +func (o *SecretsSecretRolesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /secrets/secret-roles/{id}/][%d] secretsSecretRolesDeleteNoContent ", 204) +} + +func (o *SecretsSecretRolesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_list_parameters.go new file mode 100644 index 0000000..3f348ef --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_list_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewSecretsSecretRolesListParams creates a new SecretsSecretRolesListParams object +// with the default values initialized. +func NewSecretsSecretRolesListParams() *SecretsSecretRolesListParams { + var () + return &SecretsSecretRolesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretRolesListParamsWithTimeout creates a new SecretsSecretRolesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretRolesListParamsWithTimeout(timeout time.Duration) *SecretsSecretRolesListParams { + var () + return &SecretsSecretRolesListParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretRolesListParamsWithContext creates a new SecretsSecretRolesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretRolesListParamsWithContext(ctx context.Context) *SecretsSecretRolesListParams { + var () + return &SecretsSecretRolesListParams{ + + Context: ctx, + } +} + +// NewSecretsSecretRolesListParamsWithHTTPClient creates a new SecretsSecretRolesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretRolesListParamsWithHTTPClient(client *http.Client) *SecretsSecretRolesListParams { + var () + return &SecretsSecretRolesListParams{ + HTTPClient: client, + } +} + +/*SecretsSecretRolesListParams contains all the parameters to send to the API endpoint +for the secrets secret roles list operation typically these are written to a http.Request +*/ +type SecretsSecretRolesListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) WithTimeout(timeout time.Duration) *SecretsSecretRolesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) WithContext(ctx context.Context) *SecretsSecretRolesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) WithHTTPClient(client *http.Client) *SecretsSecretRolesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) WithLimit(limit *int64) *SecretsSecretRolesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) WithName(name *string) *SecretsSecretRolesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) WithOffset(offset *int64) *SecretsSecretRolesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) WithSlug(slug *string) *SecretsSecretRolesListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretRolesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_list_responses.go new file mode 100644 index 0000000..5c9ef19 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// SecretsSecretRolesListReader is a Reader for the SecretsSecretRolesList structure. +type SecretsSecretRolesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretRolesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsSecretRolesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSecretsSecretRolesListOK creates a SecretsSecretRolesListOK with default headers values +func NewSecretsSecretRolesListOK() *SecretsSecretRolesListOK { + return &SecretsSecretRolesListOK{} +} + +/*SecretsSecretRolesListOK handles this case with default header values. + +SecretsSecretRolesListOK secrets secret roles list o k +*/ +type SecretsSecretRolesListOK struct { + Payload *models.SecretsSecretRolesListOKBody +} + +func (o *SecretsSecretRolesListOK) Error() string { + return fmt.Sprintf("[GET /secrets/secret-roles/][%d] secretsSecretRolesListOK %+v", 200, o.Payload) +} + +func (o *SecretsSecretRolesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SecretsSecretRolesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_partial_update_parameters.go new file mode 100644 index 0000000..8d5cc74 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewSecretsSecretRolesPartialUpdateParams creates a new SecretsSecretRolesPartialUpdateParams object +// with the default values initialized. +func NewSecretsSecretRolesPartialUpdateParams() *SecretsSecretRolesPartialUpdateParams { + var () + return &SecretsSecretRolesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretRolesPartialUpdateParamsWithTimeout creates a new SecretsSecretRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretRolesPartialUpdateParamsWithTimeout(timeout time.Duration) *SecretsSecretRolesPartialUpdateParams { + var () + return &SecretsSecretRolesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretRolesPartialUpdateParamsWithContext creates a new SecretsSecretRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretRolesPartialUpdateParamsWithContext(ctx context.Context) *SecretsSecretRolesPartialUpdateParams { + var () + return &SecretsSecretRolesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewSecretsSecretRolesPartialUpdateParamsWithHTTPClient creates a new SecretsSecretRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretRolesPartialUpdateParamsWithHTTPClient(client *http.Client) *SecretsSecretRolesPartialUpdateParams { + var () + return &SecretsSecretRolesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*SecretsSecretRolesPartialUpdateParams contains all the parameters to send to the API endpoint +for the secrets secret roles partial update operation typically these are written to a http.Request +*/ +type SecretsSecretRolesPartialUpdateParams struct { + + /*Data*/ + Data *models.SecretRole + /*ID + A unique integer value identifying this secret role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) WithTimeout(timeout time.Duration) *SecretsSecretRolesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) WithContext(ctx context.Context) *SecretsSecretRolesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) WithHTTPClient(client *http.Client) *SecretsSecretRolesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) WithData(data *models.SecretRole) *SecretsSecretRolesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) SetData(data *models.SecretRole) { + o.Data = data +} + +// WithID adds the id to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) WithID(id int64) *SecretsSecretRolesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretRolesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_partial_update_responses.go new file mode 100644 index 0000000..e32c3b9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// SecretsSecretRolesPartialUpdateReader is a Reader for the SecretsSecretRolesPartialUpdate structure. +type SecretsSecretRolesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretRolesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsSecretRolesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSecretsSecretRolesPartialUpdateOK creates a SecretsSecretRolesPartialUpdateOK with default headers values +func NewSecretsSecretRolesPartialUpdateOK() *SecretsSecretRolesPartialUpdateOK { + return &SecretsSecretRolesPartialUpdateOK{} +} + +/*SecretsSecretRolesPartialUpdateOK handles this case with default header values. + +SecretsSecretRolesPartialUpdateOK secrets secret roles partial update o k +*/ +type SecretsSecretRolesPartialUpdateOK struct { + Payload *models.SecretRole +} + +func (o *SecretsSecretRolesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /secrets/secret-roles/{id}/][%d] secretsSecretRolesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *SecretsSecretRolesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SecretRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_read_parameters.go new file mode 100644 index 0000000..2f77a4f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewSecretsSecretRolesReadParams creates a new SecretsSecretRolesReadParams object +// with the default values initialized. +func NewSecretsSecretRolesReadParams() *SecretsSecretRolesReadParams { + var () + return &SecretsSecretRolesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretRolesReadParamsWithTimeout creates a new SecretsSecretRolesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretRolesReadParamsWithTimeout(timeout time.Duration) *SecretsSecretRolesReadParams { + var () + return &SecretsSecretRolesReadParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretRolesReadParamsWithContext creates a new SecretsSecretRolesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretRolesReadParamsWithContext(ctx context.Context) *SecretsSecretRolesReadParams { + var () + return &SecretsSecretRolesReadParams{ + + Context: ctx, + } +} + +// NewSecretsSecretRolesReadParamsWithHTTPClient creates a new SecretsSecretRolesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretRolesReadParamsWithHTTPClient(client *http.Client) *SecretsSecretRolesReadParams { + var () + return &SecretsSecretRolesReadParams{ + HTTPClient: client, + } +} + +/*SecretsSecretRolesReadParams contains all the parameters to send to the API endpoint +for the secrets secret roles read operation typically these are written to a http.Request +*/ +type SecretsSecretRolesReadParams struct { + + /*ID + A unique integer value identifying this secret role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secret roles read params +func (o *SecretsSecretRolesReadParams) WithTimeout(timeout time.Duration) *SecretsSecretRolesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secret roles read params +func (o *SecretsSecretRolesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secret roles read params +func (o *SecretsSecretRolesReadParams) WithContext(ctx context.Context) *SecretsSecretRolesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secret roles read params +func (o *SecretsSecretRolesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secret roles read params +func (o *SecretsSecretRolesReadParams) WithHTTPClient(client *http.Client) *SecretsSecretRolesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secret roles read params +func (o *SecretsSecretRolesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the secrets secret roles read params +func (o *SecretsSecretRolesReadParams) WithID(id int64) *SecretsSecretRolesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secret roles read params +func (o *SecretsSecretRolesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretRolesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_read_responses.go new file mode 100644 index 0000000..1af11f6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// SecretsSecretRolesReadReader is a Reader for the SecretsSecretRolesRead structure. +type SecretsSecretRolesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretRolesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsSecretRolesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSecretsSecretRolesReadOK creates a SecretsSecretRolesReadOK with default headers values +func NewSecretsSecretRolesReadOK() *SecretsSecretRolesReadOK { + return &SecretsSecretRolesReadOK{} +} + +/*SecretsSecretRolesReadOK handles this case with default header values. + +SecretsSecretRolesReadOK secrets secret roles read o k +*/ +type SecretsSecretRolesReadOK struct { + Payload *models.SecretRole +} + +func (o *SecretsSecretRolesReadOK) Error() string { + return fmt.Sprintf("[GET /secrets/secret-roles/{id}/][%d] secretsSecretRolesReadOK %+v", 200, o.Payload) +} + +func (o *SecretsSecretRolesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SecretRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_update_parameters.go new file mode 100644 index 0000000..fbee6d4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewSecretsSecretRolesUpdateParams creates a new SecretsSecretRolesUpdateParams object +// with the default values initialized. +func NewSecretsSecretRolesUpdateParams() *SecretsSecretRolesUpdateParams { + var () + return &SecretsSecretRolesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretRolesUpdateParamsWithTimeout creates a new SecretsSecretRolesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretRolesUpdateParamsWithTimeout(timeout time.Duration) *SecretsSecretRolesUpdateParams { + var () + return &SecretsSecretRolesUpdateParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretRolesUpdateParamsWithContext creates a new SecretsSecretRolesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretRolesUpdateParamsWithContext(ctx context.Context) *SecretsSecretRolesUpdateParams { + var () + return &SecretsSecretRolesUpdateParams{ + + Context: ctx, + } +} + +// NewSecretsSecretRolesUpdateParamsWithHTTPClient creates a new SecretsSecretRolesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretRolesUpdateParamsWithHTTPClient(client *http.Client) *SecretsSecretRolesUpdateParams { + var () + return &SecretsSecretRolesUpdateParams{ + HTTPClient: client, + } +} + +/*SecretsSecretRolesUpdateParams contains all the parameters to send to the API endpoint +for the secrets secret roles update operation typically these are written to a http.Request +*/ +type SecretsSecretRolesUpdateParams struct { + + /*Data*/ + Data *models.SecretRole + /*ID + A unique integer value identifying this secret role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) WithTimeout(timeout time.Duration) *SecretsSecretRolesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) WithContext(ctx context.Context) *SecretsSecretRolesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) WithHTTPClient(client *http.Client) *SecretsSecretRolesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) WithData(data *models.SecretRole) *SecretsSecretRolesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) SetData(data *models.SecretRole) { + o.Data = data +} + +// WithID adds the id to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) WithID(id int64) *SecretsSecretRolesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretRolesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_update_responses.go new file mode 100644 index 0000000..335f724 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secret_roles_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// SecretsSecretRolesUpdateReader is a Reader for the SecretsSecretRolesUpdate structure. +type SecretsSecretRolesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretRolesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsSecretRolesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSecretsSecretRolesUpdateOK creates a SecretsSecretRolesUpdateOK with default headers values +func NewSecretsSecretRolesUpdateOK() *SecretsSecretRolesUpdateOK { + return &SecretsSecretRolesUpdateOK{} +} + +/*SecretsSecretRolesUpdateOK handles this case with default header values. + +SecretsSecretRolesUpdateOK secrets secret roles update o k +*/ +type SecretsSecretRolesUpdateOK struct { + Payload *models.SecretRole +} + +func (o *SecretsSecretRolesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /secrets/secret-roles/{id}/][%d] secretsSecretRolesUpdateOK %+v", 200, o.Payload) +} + +func (o *SecretsSecretRolesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SecretRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_create_parameters.go new file mode 100644 index 0000000..955ef7a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewSecretsSecretsCreateParams creates a new SecretsSecretsCreateParams object +// with the default values initialized. +func NewSecretsSecretsCreateParams() *SecretsSecretsCreateParams { + var () + return &SecretsSecretsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretsCreateParamsWithTimeout creates a new SecretsSecretsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretsCreateParamsWithTimeout(timeout time.Duration) *SecretsSecretsCreateParams { + var () + return &SecretsSecretsCreateParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretsCreateParamsWithContext creates a new SecretsSecretsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretsCreateParamsWithContext(ctx context.Context) *SecretsSecretsCreateParams { + var () + return &SecretsSecretsCreateParams{ + + Context: ctx, + } +} + +// NewSecretsSecretsCreateParamsWithHTTPClient creates a new SecretsSecretsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretsCreateParamsWithHTTPClient(client *http.Client) *SecretsSecretsCreateParams { + var () + return &SecretsSecretsCreateParams{ + HTTPClient: client, + } +} + +/*SecretsSecretsCreateParams contains all the parameters to send to the API endpoint +for the secrets secrets create operation typically these are written to a http.Request +*/ +type SecretsSecretsCreateParams struct { + + /*Data*/ + Data *models.WritableSecret + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secrets create params +func (o *SecretsSecretsCreateParams) WithTimeout(timeout time.Duration) *SecretsSecretsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secrets create params +func (o *SecretsSecretsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secrets create params +func (o *SecretsSecretsCreateParams) WithContext(ctx context.Context) *SecretsSecretsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secrets create params +func (o *SecretsSecretsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secrets create params +func (o *SecretsSecretsCreateParams) WithHTTPClient(client *http.Client) *SecretsSecretsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secrets create params +func (o *SecretsSecretsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the secrets secrets create params +func (o *SecretsSecretsCreateParams) WithData(data *models.WritableSecret) *SecretsSecretsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the secrets secrets create params +func (o *SecretsSecretsCreateParams) SetData(data *models.WritableSecret) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_create_responses.go new file mode 100644 index 0000000..7bfc702 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// SecretsSecretsCreateReader is a Reader for the SecretsSecretsCreate structure. +type SecretsSecretsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewSecretsSecretsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSecretsSecretsCreateCreated creates a SecretsSecretsCreateCreated with default headers values +func NewSecretsSecretsCreateCreated() *SecretsSecretsCreateCreated { + return &SecretsSecretsCreateCreated{} +} + +/*SecretsSecretsCreateCreated handles this case with default header values. + +SecretsSecretsCreateCreated secrets secrets create created +*/ +type SecretsSecretsCreateCreated struct { + Payload *models.WritableSecret +} + +func (o *SecretsSecretsCreateCreated) Error() string { + return fmt.Sprintf("[POST /secrets/secrets/][%d] secretsSecretsCreateCreated %+v", 201, o.Payload) +} + +func (o *SecretsSecretsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableSecret) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_delete_parameters.go new file mode 100644 index 0000000..b4d4592 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewSecretsSecretsDeleteParams creates a new SecretsSecretsDeleteParams object +// with the default values initialized. +func NewSecretsSecretsDeleteParams() *SecretsSecretsDeleteParams { + var () + return &SecretsSecretsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretsDeleteParamsWithTimeout creates a new SecretsSecretsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretsDeleteParamsWithTimeout(timeout time.Duration) *SecretsSecretsDeleteParams { + var () + return &SecretsSecretsDeleteParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretsDeleteParamsWithContext creates a new SecretsSecretsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretsDeleteParamsWithContext(ctx context.Context) *SecretsSecretsDeleteParams { + var () + return &SecretsSecretsDeleteParams{ + + Context: ctx, + } +} + +// NewSecretsSecretsDeleteParamsWithHTTPClient creates a new SecretsSecretsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretsDeleteParamsWithHTTPClient(client *http.Client) *SecretsSecretsDeleteParams { + var () + return &SecretsSecretsDeleteParams{ + HTTPClient: client, + } +} + +/*SecretsSecretsDeleteParams contains all the parameters to send to the API endpoint +for the secrets secrets delete operation typically these are written to a http.Request +*/ +type SecretsSecretsDeleteParams struct { + + /*ID + A unique integer value identifying this secret. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secrets delete params +func (o *SecretsSecretsDeleteParams) WithTimeout(timeout time.Duration) *SecretsSecretsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secrets delete params +func (o *SecretsSecretsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secrets delete params +func (o *SecretsSecretsDeleteParams) WithContext(ctx context.Context) *SecretsSecretsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secrets delete params +func (o *SecretsSecretsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secrets delete params +func (o *SecretsSecretsDeleteParams) WithHTTPClient(client *http.Client) *SecretsSecretsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secrets delete params +func (o *SecretsSecretsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the secrets secrets delete params +func (o *SecretsSecretsDeleteParams) WithID(id int64) *SecretsSecretsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secrets delete params +func (o *SecretsSecretsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_delete_responses.go new file mode 100644 index 0000000..d4f3a92 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// SecretsSecretsDeleteReader is a Reader for the SecretsSecretsDelete structure. +type SecretsSecretsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewSecretsSecretsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSecretsSecretsDeleteNoContent creates a SecretsSecretsDeleteNoContent with default headers values +func NewSecretsSecretsDeleteNoContent() *SecretsSecretsDeleteNoContent { + return &SecretsSecretsDeleteNoContent{} +} + +/*SecretsSecretsDeleteNoContent handles this case with default header values. + +SecretsSecretsDeleteNoContent secrets secrets delete no content +*/ +type SecretsSecretsDeleteNoContent struct { +} + +func (o *SecretsSecretsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /secrets/secrets/{id}/][%d] secretsSecretsDeleteNoContent ", 204) +} + +func (o *SecretsSecretsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_list_parameters.go new file mode 100644 index 0000000..0692ae4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_list_parameters.go @@ -0,0 +1,401 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewSecretsSecretsListParams creates a new SecretsSecretsListParams object +// with the default values initialized. +func NewSecretsSecretsListParams() *SecretsSecretsListParams { + var () + return &SecretsSecretsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretsListParamsWithTimeout creates a new SecretsSecretsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretsListParamsWithTimeout(timeout time.Duration) *SecretsSecretsListParams { + var () + return &SecretsSecretsListParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretsListParamsWithContext creates a new SecretsSecretsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretsListParamsWithContext(ctx context.Context) *SecretsSecretsListParams { + var () + return &SecretsSecretsListParams{ + + Context: ctx, + } +} + +// NewSecretsSecretsListParamsWithHTTPClient creates a new SecretsSecretsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretsListParamsWithHTTPClient(client *http.Client) *SecretsSecretsListParams { + var () + return &SecretsSecretsListParams{ + HTTPClient: client, + } +} + +/*SecretsSecretsListParams contains all the parameters to send to the API endpoint +for the secrets secrets list operation typically these are written to a http.Request +*/ +type SecretsSecretsListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Role*/ + Role *string + /*RoleID*/ + RoleID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secrets list params +func (o *SecretsSecretsListParams) WithTimeout(timeout time.Duration) *SecretsSecretsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secrets list params +func (o *SecretsSecretsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secrets list params +func (o *SecretsSecretsListParams) WithContext(ctx context.Context) *SecretsSecretsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secrets list params +func (o *SecretsSecretsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secrets list params +func (o *SecretsSecretsListParams) WithHTTPClient(client *http.Client) *SecretsSecretsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secrets list params +func (o *SecretsSecretsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the secrets secrets list params +func (o *SecretsSecretsListParams) WithDevice(device *string) *SecretsSecretsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the secrets secrets list params +func (o *SecretsSecretsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the secrets secrets list params +func (o *SecretsSecretsListParams) WithDeviceID(deviceID *string) *SecretsSecretsListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the secrets secrets list params +func (o *SecretsSecretsListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithIDIn adds the iDIn to the secrets secrets list params +func (o *SecretsSecretsListParams) WithIDIn(iDIn *string) *SecretsSecretsListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the secrets secrets list params +func (o *SecretsSecretsListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the secrets secrets list params +func (o *SecretsSecretsListParams) WithLimit(limit *int64) *SecretsSecretsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the secrets secrets list params +func (o *SecretsSecretsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the secrets secrets list params +func (o *SecretsSecretsListParams) WithName(name *string) *SecretsSecretsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the secrets secrets list params +func (o *SecretsSecretsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the secrets secrets list params +func (o *SecretsSecretsListParams) WithOffset(offset *int64) *SecretsSecretsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the secrets secrets list params +func (o *SecretsSecretsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the secrets secrets list params +func (o *SecretsSecretsListParams) WithQ(q *string) *SecretsSecretsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the secrets secrets list params +func (o *SecretsSecretsListParams) SetQ(q *string) { + o.Q = q +} + +// WithRole adds the role to the secrets secrets list params +func (o *SecretsSecretsListParams) WithRole(role *string) *SecretsSecretsListParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the secrets secrets list params +func (o *SecretsSecretsListParams) SetRole(role *string) { + o.Role = role +} + +// WithRoleID adds the roleID to the secrets secrets list params +func (o *SecretsSecretsListParams) WithRoleID(roleID *string) *SecretsSecretsListParams { + o.SetRoleID(roleID) + return o +} + +// SetRoleID adds the roleId to the secrets secrets list params +func (o *SecretsSecretsListParams) SetRoleID(roleID *string) { + o.RoleID = roleID +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); 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.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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_list_responses.go new file mode 100644 index 0000000..be87d65 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// SecretsSecretsListReader is a Reader for the SecretsSecretsList structure. +type SecretsSecretsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsSecretsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSecretsSecretsListOK creates a SecretsSecretsListOK with default headers values +func NewSecretsSecretsListOK() *SecretsSecretsListOK { + return &SecretsSecretsListOK{} +} + +/*SecretsSecretsListOK handles this case with default header values. + +SecretsSecretsListOK secrets secrets list o k +*/ +type SecretsSecretsListOK struct { + Payload *models.SecretsSecretsListOKBody +} + +func (o *SecretsSecretsListOK) Error() string { + return fmt.Sprintf("[GET /secrets/secrets/][%d] secretsSecretsListOK %+v", 200, o.Payload) +} + +func (o *SecretsSecretsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SecretsSecretsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_partial_update_parameters.go new file mode 100644 index 0000000..fcd0af3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewSecretsSecretsPartialUpdateParams creates a new SecretsSecretsPartialUpdateParams object +// with the default values initialized. +func NewSecretsSecretsPartialUpdateParams() *SecretsSecretsPartialUpdateParams { + var () + return &SecretsSecretsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretsPartialUpdateParamsWithTimeout creates a new SecretsSecretsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretsPartialUpdateParamsWithTimeout(timeout time.Duration) *SecretsSecretsPartialUpdateParams { + var () + return &SecretsSecretsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretsPartialUpdateParamsWithContext creates a new SecretsSecretsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretsPartialUpdateParamsWithContext(ctx context.Context) *SecretsSecretsPartialUpdateParams { + var () + return &SecretsSecretsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewSecretsSecretsPartialUpdateParamsWithHTTPClient creates a new SecretsSecretsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretsPartialUpdateParamsWithHTTPClient(client *http.Client) *SecretsSecretsPartialUpdateParams { + var () + return &SecretsSecretsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*SecretsSecretsPartialUpdateParams contains all the parameters to send to the API endpoint +for the secrets secrets partial update operation typically these are written to a http.Request +*/ +type SecretsSecretsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableSecret + /*ID + A unique integer value identifying this secret. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) WithTimeout(timeout time.Duration) *SecretsSecretsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) WithContext(ctx context.Context) *SecretsSecretsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) WithHTTPClient(client *http.Client) *SecretsSecretsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) WithData(data *models.WritableSecret) *SecretsSecretsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) SetData(data *models.WritableSecret) { + o.Data = data +} + +// WithID adds the id to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) WithID(id int64) *SecretsSecretsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_partial_update_responses.go new file mode 100644 index 0000000..283b1aa --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// SecretsSecretsPartialUpdateReader is a Reader for the SecretsSecretsPartialUpdate structure. +type SecretsSecretsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsSecretsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSecretsSecretsPartialUpdateOK creates a SecretsSecretsPartialUpdateOK with default headers values +func NewSecretsSecretsPartialUpdateOK() *SecretsSecretsPartialUpdateOK { + return &SecretsSecretsPartialUpdateOK{} +} + +/*SecretsSecretsPartialUpdateOK handles this case with default header values. + +SecretsSecretsPartialUpdateOK secrets secrets partial update o k +*/ +type SecretsSecretsPartialUpdateOK struct { + Payload *models.WritableSecret +} + +func (o *SecretsSecretsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /secrets/secrets/{id}/][%d] secretsSecretsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *SecretsSecretsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableSecret) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_read_parameters.go new file mode 100644 index 0000000..080922f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewSecretsSecretsReadParams creates a new SecretsSecretsReadParams object +// with the default values initialized. +func NewSecretsSecretsReadParams() *SecretsSecretsReadParams { + var () + return &SecretsSecretsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretsReadParamsWithTimeout creates a new SecretsSecretsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretsReadParamsWithTimeout(timeout time.Duration) *SecretsSecretsReadParams { + var () + return &SecretsSecretsReadParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretsReadParamsWithContext creates a new SecretsSecretsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretsReadParamsWithContext(ctx context.Context) *SecretsSecretsReadParams { + var () + return &SecretsSecretsReadParams{ + + Context: ctx, + } +} + +// NewSecretsSecretsReadParamsWithHTTPClient creates a new SecretsSecretsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretsReadParamsWithHTTPClient(client *http.Client) *SecretsSecretsReadParams { + var () + return &SecretsSecretsReadParams{ + HTTPClient: client, + } +} + +/*SecretsSecretsReadParams contains all the parameters to send to the API endpoint +for the secrets secrets read operation typically these are written to a http.Request +*/ +type SecretsSecretsReadParams struct { + + /*ID + A unique integer value identifying this secret. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secrets read params +func (o *SecretsSecretsReadParams) WithTimeout(timeout time.Duration) *SecretsSecretsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secrets read params +func (o *SecretsSecretsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secrets read params +func (o *SecretsSecretsReadParams) WithContext(ctx context.Context) *SecretsSecretsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secrets read params +func (o *SecretsSecretsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secrets read params +func (o *SecretsSecretsReadParams) WithHTTPClient(client *http.Client) *SecretsSecretsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secrets read params +func (o *SecretsSecretsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the secrets secrets read params +func (o *SecretsSecretsReadParams) WithID(id int64) *SecretsSecretsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secrets read params +func (o *SecretsSecretsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_read_responses.go new file mode 100644 index 0000000..2f7b82f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// SecretsSecretsReadReader is a Reader for the SecretsSecretsRead structure. +type SecretsSecretsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsSecretsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSecretsSecretsReadOK creates a SecretsSecretsReadOK with default headers values +func NewSecretsSecretsReadOK() *SecretsSecretsReadOK { + return &SecretsSecretsReadOK{} +} + +/*SecretsSecretsReadOK handles this case with default header values. + +SecretsSecretsReadOK secrets secrets read o k +*/ +type SecretsSecretsReadOK struct { + Payload *models.Secret +} + +func (o *SecretsSecretsReadOK) Error() string { + return fmt.Sprintf("[GET /secrets/secrets/{id}/][%d] secretsSecretsReadOK %+v", 200, o.Payload) +} + +func (o *SecretsSecretsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Secret) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_update_parameters.go new file mode 100644 index 0000000..9e0f8e6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewSecretsSecretsUpdateParams creates a new SecretsSecretsUpdateParams object +// with the default values initialized. +func NewSecretsSecretsUpdateParams() *SecretsSecretsUpdateParams { + var () + return &SecretsSecretsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretsUpdateParamsWithTimeout creates a new SecretsSecretsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretsUpdateParamsWithTimeout(timeout time.Duration) *SecretsSecretsUpdateParams { + var () + return &SecretsSecretsUpdateParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretsUpdateParamsWithContext creates a new SecretsSecretsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretsUpdateParamsWithContext(ctx context.Context) *SecretsSecretsUpdateParams { + var () + return &SecretsSecretsUpdateParams{ + + Context: ctx, + } +} + +// NewSecretsSecretsUpdateParamsWithHTTPClient creates a new SecretsSecretsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretsUpdateParamsWithHTTPClient(client *http.Client) *SecretsSecretsUpdateParams { + var () + return &SecretsSecretsUpdateParams{ + HTTPClient: client, + } +} + +/*SecretsSecretsUpdateParams contains all the parameters to send to the API endpoint +for the secrets secrets update operation typically these are written to a http.Request +*/ +type SecretsSecretsUpdateParams struct { + + /*Data*/ + Data *models.WritableSecret + /*ID + A unique integer value identifying this secret. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) WithTimeout(timeout time.Duration) *SecretsSecretsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) WithContext(ctx context.Context) *SecretsSecretsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) WithHTTPClient(client *http.Client) *SecretsSecretsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) WithData(data *models.WritableSecret) *SecretsSecretsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) SetData(data *models.WritableSecret) { + o.Data = data +} + +// WithID adds the id to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) WithID(id int64) *SecretsSecretsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_update_responses.go new file mode 100644 index 0000000..a956a68 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/secrets/secrets_secrets_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 secrets + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// SecretsSecretsUpdateReader is a Reader for the SecretsSecretsUpdate structure. +type SecretsSecretsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsSecretsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSecretsSecretsUpdateOK creates a SecretsSecretsUpdateOK with default headers values +func NewSecretsSecretsUpdateOK() *SecretsSecretsUpdateOK { + return &SecretsSecretsUpdateOK{} +} + +/*SecretsSecretsUpdateOK handles this case with default header values. + +SecretsSecretsUpdateOK secrets secrets update o k +*/ +type SecretsSecretsUpdateOK struct { + Payload *models.WritableSecret +} + +func (o *SecretsSecretsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /secrets/secrets/{id}/][%d] secretsSecretsUpdateOK %+v", 200, o.Payload) +} + +func (o *SecretsSecretsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableSecret) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_choices_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_choices_list_parameters.go new file mode 100644 index 0000000..65e9a94 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_choices_list_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewTenancyChoicesListParams creates a new TenancyChoicesListParams object +// with the default values initialized. +func NewTenancyChoicesListParams() *TenancyChoicesListParams { + + return &TenancyChoicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyChoicesListParamsWithTimeout creates a new TenancyChoicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyChoicesListParamsWithTimeout(timeout time.Duration) *TenancyChoicesListParams { + + return &TenancyChoicesListParams{ + + timeout: timeout, + } +} + +// NewTenancyChoicesListParamsWithContext creates a new TenancyChoicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyChoicesListParamsWithContext(ctx context.Context) *TenancyChoicesListParams { + + return &TenancyChoicesListParams{ + + Context: ctx, + } +} + +// NewTenancyChoicesListParamsWithHTTPClient creates a new TenancyChoicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyChoicesListParamsWithHTTPClient(client *http.Client) *TenancyChoicesListParams { + + return &TenancyChoicesListParams{ + HTTPClient: client, + } +} + +/*TenancyChoicesListParams contains all the parameters to send to the API endpoint +for the tenancy choices list operation typically these are written to a http.Request +*/ +type TenancyChoicesListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy choices list params +func (o *TenancyChoicesListParams) WithTimeout(timeout time.Duration) *TenancyChoicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy choices list params +func (o *TenancyChoicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy choices list params +func (o *TenancyChoicesListParams) WithContext(ctx context.Context) *TenancyChoicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy choices list params +func (o *TenancyChoicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy choices list params +func (o *TenancyChoicesListParams) WithHTTPClient(client *http.Client) *TenancyChoicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy choices list params +func (o *TenancyChoicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyChoicesListParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_choices_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_choices_list_responses.go new file mode 100644 index 0000000..b0bbe7b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_choices_list_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// TenancyChoicesListReader is a Reader for the TenancyChoicesList structure. +type TenancyChoicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyChoicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyChoicesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTenancyChoicesListOK creates a TenancyChoicesListOK with default headers values +func NewTenancyChoicesListOK() *TenancyChoicesListOK { + return &TenancyChoicesListOK{} +} + +/*TenancyChoicesListOK handles this case with default header values. + +TenancyChoicesListOK tenancy choices list o k +*/ +type TenancyChoicesListOK struct { +} + +func (o *TenancyChoicesListOK) Error() string { + return fmt.Sprintf("[GET /tenancy/_choices/][%d] tenancyChoicesListOK ", 200) +} + +func (o *TenancyChoicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_choices_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_choices_read_parameters.go new file mode 100644 index 0000000..9a325aa --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_choices_read_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewTenancyChoicesReadParams creates a new TenancyChoicesReadParams object +// with the default values initialized. +func NewTenancyChoicesReadParams() *TenancyChoicesReadParams { + var () + return &TenancyChoicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyChoicesReadParamsWithTimeout creates a new TenancyChoicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyChoicesReadParamsWithTimeout(timeout time.Duration) *TenancyChoicesReadParams { + var () + return &TenancyChoicesReadParams{ + + timeout: timeout, + } +} + +// NewTenancyChoicesReadParamsWithContext creates a new TenancyChoicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyChoicesReadParamsWithContext(ctx context.Context) *TenancyChoicesReadParams { + var () + return &TenancyChoicesReadParams{ + + Context: ctx, + } +} + +// NewTenancyChoicesReadParamsWithHTTPClient creates a new TenancyChoicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyChoicesReadParamsWithHTTPClient(client *http.Client) *TenancyChoicesReadParams { + var () + return &TenancyChoicesReadParams{ + HTTPClient: client, + } +} + +/*TenancyChoicesReadParams contains all the parameters to send to the API endpoint +for the tenancy choices read operation typically these are written to a http.Request +*/ +type TenancyChoicesReadParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy choices read params +func (o *TenancyChoicesReadParams) WithTimeout(timeout time.Duration) *TenancyChoicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy choices read params +func (o *TenancyChoicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy choices read params +func (o *TenancyChoicesReadParams) WithContext(ctx context.Context) *TenancyChoicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy choices read params +func (o *TenancyChoicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy choices read params +func (o *TenancyChoicesReadParams) WithHTTPClient(client *http.Client) *TenancyChoicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy choices read params +func (o *TenancyChoicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy choices read params +func (o *TenancyChoicesReadParams) WithID(id string) *TenancyChoicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy choices read params +func (o *TenancyChoicesReadParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyChoicesReadParams) 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", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_choices_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_choices_read_responses.go new file mode 100644 index 0000000..d48fa07 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_choices_read_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// TenancyChoicesReadReader is a Reader for the TenancyChoicesRead structure. +type TenancyChoicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyChoicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyChoicesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTenancyChoicesReadOK creates a TenancyChoicesReadOK with default headers values +func NewTenancyChoicesReadOK() *TenancyChoicesReadOK { + return &TenancyChoicesReadOK{} +} + +/*TenancyChoicesReadOK handles this case with default header values. + +TenancyChoicesReadOK tenancy choices read o k +*/ +type TenancyChoicesReadOK struct { +} + +func (o *TenancyChoicesReadOK) Error() string { + return fmt.Sprintf("[GET /tenancy/_choices/{id}/][%d] tenancyChoicesReadOK ", 200) +} + +func (o *TenancyChoicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_client.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_client.go new file mode 100644 index 0000000..455ac4d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_client.go @@ -0,0 +1,450 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new tenancy API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for tenancy API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +TenancyChoicesList tenancy choices list API +*/ +func (a *Client) TenancyChoicesList(params *TenancyChoicesListParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyChoicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyChoicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy__choices_list", + Method: "GET", + PathPattern: "/tenancy/_choices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyChoicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyChoicesListOK), nil + +} + +/* +TenancyChoicesRead tenancy choices read API +*/ +func (a *Client) TenancyChoicesRead(params *TenancyChoicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyChoicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyChoicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy__choices_read", + Method: "GET", + PathPattern: "/tenancy/_choices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyChoicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyChoicesReadOK), nil + +} + +/* +TenancyTenantGroupsCreate tenancy tenant groups create API +*/ +func (a *Client) TenancyTenantGroupsCreate(params *TenancyTenantGroupsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantGroupsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantGroupsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenant-groups_create", + Method: "POST", + PathPattern: "/tenancy/tenant-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantGroupsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantGroupsCreateCreated), nil + +} + +/* +TenancyTenantGroupsDelete tenancy tenant groups delete API +*/ +func (a *Client) TenancyTenantGroupsDelete(params *TenancyTenantGroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantGroupsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantGroupsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenant-groups_delete", + Method: "DELETE", + PathPattern: "/tenancy/tenant-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantGroupsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantGroupsDeleteNoContent), nil + +} + +/* +TenancyTenantGroupsList tenancy tenant groups list API +*/ +func (a *Client) TenancyTenantGroupsList(params *TenancyTenantGroupsListParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantGroupsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantGroupsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenant-groups_list", + Method: "GET", + PathPattern: "/tenancy/tenant-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantGroupsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantGroupsListOK), nil + +} + +/* +TenancyTenantGroupsPartialUpdate tenancy tenant groups partial update API +*/ +func (a *Client) TenancyTenantGroupsPartialUpdate(params *TenancyTenantGroupsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantGroupsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantGroupsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenant-groups_partial_update", + Method: "PATCH", + PathPattern: "/tenancy/tenant-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantGroupsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantGroupsPartialUpdateOK), nil + +} + +/* +TenancyTenantGroupsRead tenancy tenant groups read API +*/ +func (a *Client) TenancyTenantGroupsRead(params *TenancyTenantGroupsReadParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantGroupsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantGroupsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenant-groups_read", + Method: "GET", + PathPattern: "/tenancy/tenant-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantGroupsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantGroupsReadOK), nil + +} + +/* +TenancyTenantGroupsUpdate tenancy tenant groups update API +*/ +func (a *Client) TenancyTenantGroupsUpdate(params *TenancyTenantGroupsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantGroupsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantGroupsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenant-groups_update", + Method: "PUT", + PathPattern: "/tenancy/tenant-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantGroupsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantGroupsUpdateOK), nil + +} + +/* +TenancyTenantsCreate tenancy tenants create API +*/ +func (a *Client) TenancyTenantsCreate(params *TenancyTenantsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenants_create", + Method: "POST", + PathPattern: "/tenancy/tenants/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantsCreateCreated), nil + +} + +/* +TenancyTenantsDelete tenancy tenants delete API +*/ +func (a *Client) TenancyTenantsDelete(params *TenancyTenantsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenants_delete", + Method: "DELETE", + PathPattern: "/tenancy/tenants/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantsDeleteNoContent), nil + +} + +/* +TenancyTenantsList tenancy tenants list API +*/ +func (a *Client) TenancyTenantsList(params *TenancyTenantsListParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenants_list", + Method: "GET", + PathPattern: "/tenancy/tenants/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantsListOK), nil + +} + +/* +TenancyTenantsPartialUpdate tenancy tenants partial update API +*/ +func (a *Client) TenancyTenantsPartialUpdate(params *TenancyTenantsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenants_partial_update", + Method: "PATCH", + PathPattern: "/tenancy/tenants/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantsPartialUpdateOK), nil + +} + +/* +TenancyTenantsRead tenancy tenants read API +*/ +func (a *Client) TenancyTenantsRead(params *TenancyTenantsReadParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenants_read", + Method: "GET", + PathPattern: "/tenancy/tenants/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantsReadOK), nil + +} + +/* +TenancyTenantsUpdate tenancy tenants update API +*/ +func (a *Client) TenancyTenantsUpdate(params *TenancyTenantsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenants_update", + Method: "PUT", + PathPattern: "/tenancy/tenants/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantsUpdateOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_create_parameters.go new file mode 100644 index 0000000..e2da622 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewTenancyTenantGroupsCreateParams creates a new TenancyTenantGroupsCreateParams object +// with the default values initialized. +func NewTenancyTenantGroupsCreateParams() *TenancyTenantGroupsCreateParams { + var () + return &TenancyTenantGroupsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantGroupsCreateParamsWithTimeout creates a new TenancyTenantGroupsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantGroupsCreateParamsWithTimeout(timeout time.Duration) *TenancyTenantGroupsCreateParams { + var () + return &TenancyTenantGroupsCreateParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantGroupsCreateParamsWithContext creates a new TenancyTenantGroupsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantGroupsCreateParamsWithContext(ctx context.Context) *TenancyTenantGroupsCreateParams { + var () + return &TenancyTenantGroupsCreateParams{ + + Context: ctx, + } +} + +// NewTenancyTenantGroupsCreateParamsWithHTTPClient creates a new TenancyTenantGroupsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantGroupsCreateParamsWithHTTPClient(client *http.Client) *TenancyTenantGroupsCreateParams { + var () + return &TenancyTenantGroupsCreateParams{ + HTTPClient: client, + } +} + +/*TenancyTenantGroupsCreateParams contains all the parameters to send to the API endpoint +for the tenancy tenant groups create operation typically these are written to a http.Request +*/ +type TenancyTenantGroupsCreateParams struct { + + /*Data*/ + Data *models.TenantGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenant groups create params +func (o *TenancyTenantGroupsCreateParams) WithTimeout(timeout time.Duration) *TenancyTenantGroupsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenant groups create params +func (o *TenancyTenantGroupsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenant groups create params +func (o *TenancyTenantGroupsCreateParams) WithContext(ctx context.Context) *TenancyTenantGroupsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenant groups create params +func (o *TenancyTenantGroupsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenant groups create params +func (o *TenancyTenantGroupsCreateParams) WithHTTPClient(client *http.Client) *TenancyTenantGroupsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenant groups create params +func (o *TenancyTenantGroupsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy tenant groups create params +func (o *TenancyTenantGroupsCreateParams) WithData(data *models.TenantGroup) *TenancyTenantGroupsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy tenant groups create params +func (o *TenancyTenantGroupsCreateParams) SetData(data *models.TenantGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantGroupsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_create_responses.go new file mode 100644 index 0000000..9f21308 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// TenancyTenantGroupsCreateReader is a Reader for the TenancyTenantGroupsCreate structure. +type TenancyTenantGroupsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantGroupsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewTenancyTenantGroupsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTenancyTenantGroupsCreateCreated creates a TenancyTenantGroupsCreateCreated with default headers values +func NewTenancyTenantGroupsCreateCreated() *TenancyTenantGroupsCreateCreated { + return &TenancyTenantGroupsCreateCreated{} +} + +/*TenancyTenantGroupsCreateCreated handles this case with default header values. + +TenancyTenantGroupsCreateCreated tenancy tenant groups create created +*/ +type TenancyTenantGroupsCreateCreated struct { + Payload *models.TenantGroup +} + +func (o *TenancyTenantGroupsCreateCreated) Error() string { + return fmt.Sprintf("[POST /tenancy/tenant-groups/][%d] tenancyTenantGroupsCreateCreated %+v", 201, o.Payload) +} + +func (o *TenancyTenantGroupsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TenantGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_delete_parameters.go new file mode 100644 index 0000000..ceb93fa --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewTenancyTenantGroupsDeleteParams creates a new TenancyTenantGroupsDeleteParams object +// with the default values initialized. +func NewTenancyTenantGroupsDeleteParams() *TenancyTenantGroupsDeleteParams { + var () + return &TenancyTenantGroupsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantGroupsDeleteParamsWithTimeout creates a new TenancyTenantGroupsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantGroupsDeleteParamsWithTimeout(timeout time.Duration) *TenancyTenantGroupsDeleteParams { + var () + return &TenancyTenantGroupsDeleteParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantGroupsDeleteParamsWithContext creates a new TenancyTenantGroupsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantGroupsDeleteParamsWithContext(ctx context.Context) *TenancyTenantGroupsDeleteParams { + var () + return &TenancyTenantGroupsDeleteParams{ + + Context: ctx, + } +} + +// NewTenancyTenantGroupsDeleteParamsWithHTTPClient creates a new TenancyTenantGroupsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantGroupsDeleteParamsWithHTTPClient(client *http.Client) *TenancyTenantGroupsDeleteParams { + var () + return &TenancyTenantGroupsDeleteParams{ + HTTPClient: client, + } +} + +/*TenancyTenantGroupsDeleteParams contains all the parameters to send to the API endpoint +for the tenancy tenant groups delete operation typically these are written to a http.Request +*/ +type TenancyTenantGroupsDeleteParams struct { + + /*ID + A unique integer value identifying this tenant group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenant groups delete params +func (o *TenancyTenantGroupsDeleteParams) WithTimeout(timeout time.Duration) *TenancyTenantGroupsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenant groups delete params +func (o *TenancyTenantGroupsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenant groups delete params +func (o *TenancyTenantGroupsDeleteParams) WithContext(ctx context.Context) *TenancyTenantGroupsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenant groups delete params +func (o *TenancyTenantGroupsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenant groups delete params +func (o *TenancyTenantGroupsDeleteParams) WithHTTPClient(client *http.Client) *TenancyTenantGroupsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenant groups delete params +func (o *TenancyTenantGroupsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy tenant groups delete params +func (o *TenancyTenantGroupsDeleteParams) WithID(id int64) *TenancyTenantGroupsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenant groups delete params +func (o *TenancyTenantGroupsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantGroupsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_delete_responses.go new file mode 100644 index 0000000..37f99bc --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// TenancyTenantGroupsDeleteReader is a Reader for the TenancyTenantGroupsDelete structure. +type TenancyTenantGroupsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantGroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewTenancyTenantGroupsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTenancyTenantGroupsDeleteNoContent creates a TenancyTenantGroupsDeleteNoContent with default headers values +func NewTenancyTenantGroupsDeleteNoContent() *TenancyTenantGroupsDeleteNoContent { + return &TenancyTenantGroupsDeleteNoContent{} +} + +/*TenancyTenantGroupsDeleteNoContent handles this case with default header values. + +TenancyTenantGroupsDeleteNoContent tenancy tenant groups delete no content +*/ +type TenancyTenantGroupsDeleteNoContent struct { +} + +func (o *TenancyTenantGroupsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /tenancy/tenant-groups/{id}/][%d] tenancyTenantGroupsDeleteNoContent ", 204) +} + +func (o *TenancyTenantGroupsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_list_parameters.go new file mode 100644 index 0000000..5eaa4a3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_list_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewTenancyTenantGroupsListParams creates a new TenancyTenantGroupsListParams object +// with the default values initialized. +func NewTenancyTenantGroupsListParams() *TenancyTenantGroupsListParams { + var () + return &TenancyTenantGroupsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantGroupsListParamsWithTimeout creates a new TenancyTenantGroupsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantGroupsListParamsWithTimeout(timeout time.Duration) *TenancyTenantGroupsListParams { + var () + return &TenancyTenantGroupsListParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantGroupsListParamsWithContext creates a new TenancyTenantGroupsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantGroupsListParamsWithContext(ctx context.Context) *TenancyTenantGroupsListParams { + var () + return &TenancyTenantGroupsListParams{ + + Context: ctx, + } +} + +// NewTenancyTenantGroupsListParamsWithHTTPClient creates a new TenancyTenantGroupsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantGroupsListParamsWithHTTPClient(client *http.Client) *TenancyTenantGroupsListParams { + var () + return &TenancyTenantGroupsListParams{ + HTTPClient: client, + } +} + +/*TenancyTenantGroupsListParams contains all the parameters to send to the API endpoint +for the tenancy tenant groups list operation typically these are written to a http.Request +*/ +type TenancyTenantGroupsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithTimeout(timeout time.Duration) *TenancyTenantGroupsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithContext(ctx context.Context) *TenancyTenantGroupsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithHTTPClient(client *http.Client) *TenancyTenantGroupsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithLimit(limit *int64) *TenancyTenantGroupsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithName(name *string) *TenancyTenantGroupsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithOffset(offset *int64) *TenancyTenantGroupsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithSlug(slug *string) *TenancyTenantGroupsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_list_responses.go new file mode 100644 index 0000000..2de4173 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// TenancyTenantGroupsListReader is a Reader for the TenancyTenantGroupsList structure. +type TenancyTenantGroupsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantGroupsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyTenantGroupsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTenancyTenantGroupsListOK creates a TenancyTenantGroupsListOK with default headers values +func NewTenancyTenantGroupsListOK() *TenancyTenantGroupsListOK { + return &TenancyTenantGroupsListOK{} +} + +/*TenancyTenantGroupsListOK handles this case with default header values. + +TenancyTenantGroupsListOK tenancy tenant groups list o k +*/ +type TenancyTenantGroupsListOK struct { + Payload *models.TenancyTenantGroupsListOKBody +} + +func (o *TenancyTenantGroupsListOK) Error() string { + return fmt.Sprintf("[GET /tenancy/tenant-groups/][%d] tenancyTenantGroupsListOK %+v", 200, o.Payload) +} + +func (o *TenancyTenantGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TenancyTenantGroupsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_partial_update_parameters.go new file mode 100644 index 0000000..882a6c2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewTenancyTenantGroupsPartialUpdateParams creates a new TenancyTenantGroupsPartialUpdateParams object +// with the default values initialized. +func NewTenancyTenantGroupsPartialUpdateParams() *TenancyTenantGroupsPartialUpdateParams { + var () + return &TenancyTenantGroupsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantGroupsPartialUpdateParamsWithTimeout creates a new TenancyTenantGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantGroupsPartialUpdateParamsWithTimeout(timeout time.Duration) *TenancyTenantGroupsPartialUpdateParams { + var () + return &TenancyTenantGroupsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantGroupsPartialUpdateParamsWithContext creates a new TenancyTenantGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantGroupsPartialUpdateParamsWithContext(ctx context.Context) *TenancyTenantGroupsPartialUpdateParams { + var () + return &TenancyTenantGroupsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewTenancyTenantGroupsPartialUpdateParamsWithHTTPClient creates a new TenancyTenantGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantGroupsPartialUpdateParamsWithHTTPClient(client *http.Client) *TenancyTenantGroupsPartialUpdateParams { + var () + return &TenancyTenantGroupsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*TenancyTenantGroupsPartialUpdateParams contains all the parameters to send to the API endpoint +for the tenancy tenant groups partial update operation typically these are written to a http.Request +*/ +type TenancyTenantGroupsPartialUpdateParams struct { + + /*Data*/ + Data *models.TenantGroup + /*ID + A unique integer value identifying this tenant group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) WithTimeout(timeout time.Duration) *TenancyTenantGroupsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) WithContext(ctx context.Context) *TenancyTenantGroupsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) WithHTTPClient(client *http.Client) *TenancyTenantGroupsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) WithData(data *models.TenantGroup) *TenancyTenantGroupsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) SetData(data *models.TenantGroup) { + o.Data = data +} + +// WithID adds the id to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) WithID(id int64) *TenancyTenantGroupsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantGroupsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_partial_update_responses.go new file mode 100644 index 0000000..19444b8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// TenancyTenantGroupsPartialUpdateReader is a Reader for the TenancyTenantGroupsPartialUpdate structure. +type TenancyTenantGroupsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantGroupsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyTenantGroupsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTenancyTenantGroupsPartialUpdateOK creates a TenancyTenantGroupsPartialUpdateOK with default headers values +func NewTenancyTenantGroupsPartialUpdateOK() *TenancyTenantGroupsPartialUpdateOK { + return &TenancyTenantGroupsPartialUpdateOK{} +} + +/*TenancyTenantGroupsPartialUpdateOK handles this case with default header values. + +TenancyTenantGroupsPartialUpdateOK tenancy tenant groups partial update o k +*/ +type TenancyTenantGroupsPartialUpdateOK struct { + Payload *models.TenantGroup +} + +func (o *TenancyTenantGroupsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /tenancy/tenant-groups/{id}/][%d] tenancyTenantGroupsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *TenancyTenantGroupsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TenantGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_read_parameters.go new file mode 100644 index 0000000..67c8bb1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewTenancyTenantGroupsReadParams creates a new TenancyTenantGroupsReadParams object +// with the default values initialized. +func NewTenancyTenantGroupsReadParams() *TenancyTenantGroupsReadParams { + var () + return &TenancyTenantGroupsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantGroupsReadParamsWithTimeout creates a new TenancyTenantGroupsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantGroupsReadParamsWithTimeout(timeout time.Duration) *TenancyTenantGroupsReadParams { + var () + return &TenancyTenantGroupsReadParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantGroupsReadParamsWithContext creates a new TenancyTenantGroupsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantGroupsReadParamsWithContext(ctx context.Context) *TenancyTenantGroupsReadParams { + var () + return &TenancyTenantGroupsReadParams{ + + Context: ctx, + } +} + +// NewTenancyTenantGroupsReadParamsWithHTTPClient creates a new TenancyTenantGroupsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantGroupsReadParamsWithHTTPClient(client *http.Client) *TenancyTenantGroupsReadParams { + var () + return &TenancyTenantGroupsReadParams{ + HTTPClient: client, + } +} + +/*TenancyTenantGroupsReadParams contains all the parameters to send to the API endpoint +for the tenancy tenant groups read operation typically these are written to a http.Request +*/ +type TenancyTenantGroupsReadParams struct { + + /*ID + A unique integer value identifying this tenant group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenant groups read params +func (o *TenancyTenantGroupsReadParams) WithTimeout(timeout time.Duration) *TenancyTenantGroupsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenant groups read params +func (o *TenancyTenantGroupsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenant groups read params +func (o *TenancyTenantGroupsReadParams) WithContext(ctx context.Context) *TenancyTenantGroupsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenant groups read params +func (o *TenancyTenantGroupsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenant groups read params +func (o *TenancyTenantGroupsReadParams) WithHTTPClient(client *http.Client) *TenancyTenantGroupsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenant groups read params +func (o *TenancyTenantGroupsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy tenant groups read params +func (o *TenancyTenantGroupsReadParams) WithID(id int64) *TenancyTenantGroupsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenant groups read params +func (o *TenancyTenantGroupsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantGroupsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_read_responses.go new file mode 100644 index 0000000..364fe3b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// TenancyTenantGroupsReadReader is a Reader for the TenancyTenantGroupsRead structure. +type TenancyTenantGroupsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantGroupsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyTenantGroupsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTenancyTenantGroupsReadOK creates a TenancyTenantGroupsReadOK with default headers values +func NewTenancyTenantGroupsReadOK() *TenancyTenantGroupsReadOK { + return &TenancyTenantGroupsReadOK{} +} + +/*TenancyTenantGroupsReadOK handles this case with default header values. + +TenancyTenantGroupsReadOK tenancy tenant groups read o k +*/ +type TenancyTenantGroupsReadOK struct { + Payload *models.TenantGroup +} + +func (o *TenancyTenantGroupsReadOK) Error() string { + return fmt.Sprintf("[GET /tenancy/tenant-groups/{id}/][%d] tenancyTenantGroupsReadOK %+v", 200, o.Payload) +} + +func (o *TenancyTenantGroupsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TenantGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_update_parameters.go new file mode 100644 index 0000000..73bedae --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewTenancyTenantGroupsUpdateParams creates a new TenancyTenantGroupsUpdateParams object +// with the default values initialized. +func NewTenancyTenantGroupsUpdateParams() *TenancyTenantGroupsUpdateParams { + var () + return &TenancyTenantGroupsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantGroupsUpdateParamsWithTimeout creates a new TenancyTenantGroupsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantGroupsUpdateParamsWithTimeout(timeout time.Duration) *TenancyTenantGroupsUpdateParams { + var () + return &TenancyTenantGroupsUpdateParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantGroupsUpdateParamsWithContext creates a new TenancyTenantGroupsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantGroupsUpdateParamsWithContext(ctx context.Context) *TenancyTenantGroupsUpdateParams { + var () + return &TenancyTenantGroupsUpdateParams{ + + Context: ctx, + } +} + +// NewTenancyTenantGroupsUpdateParamsWithHTTPClient creates a new TenancyTenantGroupsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantGroupsUpdateParamsWithHTTPClient(client *http.Client) *TenancyTenantGroupsUpdateParams { + var () + return &TenancyTenantGroupsUpdateParams{ + HTTPClient: client, + } +} + +/*TenancyTenantGroupsUpdateParams contains all the parameters to send to the API endpoint +for the tenancy tenant groups update operation typically these are written to a http.Request +*/ +type TenancyTenantGroupsUpdateParams struct { + + /*Data*/ + Data *models.TenantGroup + /*ID + A unique integer value identifying this tenant group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) WithTimeout(timeout time.Duration) *TenancyTenantGroupsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) WithContext(ctx context.Context) *TenancyTenantGroupsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) WithHTTPClient(client *http.Client) *TenancyTenantGroupsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) WithData(data *models.TenantGroup) *TenancyTenantGroupsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) SetData(data *models.TenantGroup) { + o.Data = data +} + +// WithID adds the id to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) WithID(id int64) *TenancyTenantGroupsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantGroupsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_update_responses.go new file mode 100644 index 0000000..bcfea4b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// TenancyTenantGroupsUpdateReader is a Reader for the TenancyTenantGroupsUpdate structure. +type TenancyTenantGroupsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantGroupsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyTenantGroupsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTenancyTenantGroupsUpdateOK creates a TenancyTenantGroupsUpdateOK with default headers values +func NewTenancyTenantGroupsUpdateOK() *TenancyTenantGroupsUpdateOK { + return &TenancyTenantGroupsUpdateOK{} +} + +/*TenancyTenantGroupsUpdateOK handles this case with default header values. + +TenancyTenantGroupsUpdateOK tenancy tenant groups update o k +*/ +type TenancyTenantGroupsUpdateOK struct { + Payload *models.TenantGroup +} + +func (o *TenancyTenantGroupsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /tenancy/tenant-groups/{id}/][%d] tenancyTenantGroupsUpdateOK %+v", 200, o.Payload) +} + +func (o *TenancyTenantGroupsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TenantGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_create_parameters.go new file mode 100644 index 0000000..0d07794 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewTenancyTenantsCreateParams creates a new TenancyTenantsCreateParams object +// with the default values initialized. +func NewTenancyTenantsCreateParams() *TenancyTenantsCreateParams { + var () + return &TenancyTenantsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantsCreateParamsWithTimeout creates a new TenancyTenantsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantsCreateParamsWithTimeout(timeout time.Duration) *TenancyTenantsCreateParams { + var () + return &TenancyTenantsCreateParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantsCreateParamsWithContext creates a new TenancyTenantsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantsCreateParamsWithContext(ctx context.Context) *TenancyTenantsCreateParams { + var () + return &TenancyTenantsCreateParams{ + + Context: ctx, + } +} + +// NewTenancyTenantsCreateParamsWithHTTPClient creates a new TenancyTenantsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantsCreateParamsWithHTTPClient(client *http.Client) *TenancyTenantsCreateParams { + var () + return &TenancyTenantsCreateParams{ + HTTPClient: client, + } +} + +/*TenancyTenantsCreateParams contains all the parameters to send to the API endpoint +for the tenancy tenants create operation typically these are written to a http.Request +*/ +type TenancyTenantsCreateParams struct { + + /*Data*/ + Data *models.WritableTenant + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenants create params +func (o *TenancyTenantsCreateParams) WithTimeout(timeout time.Duration) *TenancyTenantsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenants create params +func (o *TenancyTenantsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenants create params +func (o *TenancyTenantsCreateParams) WithContext(ctx context.Context) *TenancyTenantsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenants create params +func (o *TenancyTenantsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenants create params +func (o *TenancyTenantsCreateParams) WithHTTPClient(client *http.Client) *TenancyTenantsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenants create params +func (o *TenancyTenantsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy tenants create params +func (o *TenancyTenantsCreateParams) WithData(data *models.WritableTenant) *TenancyTenantsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy tenants create params +func (o *TenancyTenantsCreateParams) SetData(data *models.WritableTenant) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_create_responses.go new file mode 100644 index 0000000..9a75edf --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// TenancyTenantsCreateReader is a Reader for the TenancyTenantsCreate structure. +type TenancyTenantsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewTenancyTenantsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTenancyTenantsCreateCreated creates a TenancyTenantsCreateCreated with default headers values +func NewTenancyTenantsCreateCreated() *TenancyTenantsCreateCreated { + return &TenancyTenantsCreateCreated{} +} + +/*TenancyTenantsCreateCreated handles this case with default header values. + +TenancyTenantsCreateCreated tenancy tenants create created +*/ +type TenancyTenantsCreateCreated struct { + Payload *models.WritableTenant +} + +func (o *TenancyTenantsCreateCreated) Error() string { + return fmt.Sprintf("[POST /tenancy/tenants/][%d] tenancyTenantsCreateCreated %+v", 201, o.Payload) +} + +func (o *TenancyTenantsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableTenant) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_delete_parameters.go new file mode 100644 index 0000000..543d4c2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewTenancyTenantsDeleteParams creates a new TenancyTenantsDeleteParams object +// with the default values initialized. +func NewTenancyTenantsDeleteParams() *TenancyTenantsDeleteParams { + var () + return &TenancyTenantsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantsDeleteParamsWithTimeout creates a new TenancyTenantsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantsDeleteParamsWithTimeout(timeout time.Duration) *TenancyTenantsDeleteParams { + var () + return &TenancyTenantsDeleteParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantsDeleteParamsWithContext creates a new TenancyTenantsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantsDeleteParamsWithContext(ctx context.Context) *TenancyTenantsDeleteParams { + var () + return &TenancyTenantsDeleteParams{ + + Context: ctx, + } +} + +// NewTenancyTenantsDeleteParamsWithHTTPClient creates a new TenancyTenantsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantsDeleteParamsWithHTTPClient(client *http.Client) *TenancyTenantsDeleteParams { + var () + return &TenancyTenantsDeleteParams{ + HTTPClient: client, + } +} + +/*TenancyTenantsDeleteParams contains all the parameters to send to the API endpoint +for the tenancy tenants delete operation typically these are written to a http.Request +*/ +type TenancyTenantsDeleteParams struct { + + /*ID + A unique integer value identifying this tenant. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenants delete params +func (o *TenancyTenantsDeleteParams) WithTimeout(timeout time.Duration) *TenancyTenantsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenants delete params +func (o *TenancyTenantsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenants delete params +func (o *TenancyTenantsDeleteParams) WithContext(ctx context.Context) *TenancyTenantsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenants delete params +func (o *TenancyTenantsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenants delete params +func (o *TenancyTenantsDeleteParams) WithHTTPClient(client *http.Client) *TenancyTenantsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenants delete params +func (o *TenancyTenantsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy tenants delete params +func (o *TenancyTenantsDeleteParams) WithID(id int64) *TenancyTenantsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenants delete params +func (o *TenancyTenantsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_delete_responses.go new file mode 100644 index 0000000..137da56 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// TenancyTenantsDeleteReader is a Reader for the TenancyTenantsDelete structure. +type TenancyTenantsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewTenancyTenantsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTenancyTenantsDeleteNoContent creates a TenancyTenantsDeleteNoContent with default headers values +func NewTenancyTenantsDeleteNoContent() *TenancyTenantsDeleteNoContent { + return &TenancyTenantsDeleteNoContent{} +} + +/*TenancyTenantsDeleteNoContent handles this case with default header values. + +TenancyTenantsDeleteNoContent tenancy tenants delete no content +*/ +type TenancyTenantsDeleteNoContent struct { +} + +func (o *TenancyTenantsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /tenancy/tenants/{id}/][%d] tenancyTenantsDeleteNoContent ", 204) +} + +func (o *TenancyTenantsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_list_parameters.go new file mode 100644 index 0000000..80e91ea --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_list_parameters.go @@ -0,0 +1,343 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewTenancyTenantsListParams creates a new TenancyTenantsListParams object +// with the default values initialized. +func NewTenancyTenantsListParams() *TenancyTenantsListParams { + var () + return &TenancyTenantsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantsListParamsWithTimeout creates a new TenancyTenantsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantsListParamsWithTimeout(timeout time.Duration) *TenancyTenantsListParams { + var () + return &TenancyTenantsListParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantsListParamsWithContext creates a new TenancyTenantsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantsListParamsWithContext(ctx context.Context) *TenancyTenantsListParams { + var () + return &TenancyTenantsListParams{ + + Context: ctx, + } +} + +// NewTenancyTenantsListParamsWithHTTPClient creates a new TenancyTenantsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantsListParamsWithHTTPClient(client *http.Client) *TenancyTenantsListParams { + var () + return &TenancyTenantsListParams{ + HTTPClient: client, + } +} + +/*TenancyTenantsListParams contains all the parameters to send to the API endpoint +for the tenancy tenants list operation typically these are written to a http.Request +*/ +type TenancyTenantsListParams struct { + + /*Group*/ + Group *string + /*GroupID*/ + GroupID *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithTimeout(timeout time.Duration) *TenancyTenantsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithContext(ctx context.Context) *TenancyTenantsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithHTTPClient(client *http.Client) *TenancyTenantsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithGroup adds the group to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithGroup(group *string) *TenancyTenantsListParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetGroup(group *string) { + o.Group = group +} + +// WithGroupID adds the groupID to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithGroupID(groupID *string) *TenancyTenantsListParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetGroupID(groupID *string) { + o.GroupID = groupID +} + +// WithIDIn adds the iDIn to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithIDIn(iDIn *string) *TenancyTenantsListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithLimit(limit *int64) *TenancyTenantsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithName(name *string) *TenancyTenantsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithOffset(offset *int64) *TenancyTenantsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithQ(q *string) *TenancyTenantsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetQ(q *string) { + o.Q = q +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); 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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_list_responses.go new file mode 100644 index 0000000..038e7af --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// TenancyTenantsListReader is a Reader for the TenancyTenantsList structure. +type TenancyTenantsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyTenantsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTenancyTenantsListOK creates a TenancyTenantsListOK with default headers values +func NewTenancyTenantsListOK() *TenancyTenantsListOK { + return &TenancyTenantsListOK{} +} + +/*TenancyTenantsListOK handles this case with default header values. + +TenancyTenantsListOK tenancy tenants list o k +*/ +type TenancyTenantsListOK struct { + Payload *models.TenancyTenantsListOKBody +} + +func (o *TenancyTenantsListOK) Error() string { + return fmt.Sprintf("[GET /tenancy/tenants/][%d] tenancyTenantsListOK %+v", 200, o.Payload) +} + +func (o *TenancyTenantsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TenancyTenantsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_partial_update_parameters.go new file mode 100644 index 0000000..30efff8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewTenancyTenantsPartialUpdateParams creates a new TenancyTenantsPartialUpdateParams object +// with the default values initialized. +func NewTenancyTenantsPartialUpdateParams() *TenancyTenantsPartialUpdateParams { + var () + return &TenancyTenantsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantsPartialUpdateParamsWithTimeout creates a new TenancyTenantsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantsPartialUpdateParamsWithTimeout(timeout time.Duration) *TenancyTenantsPartialUpdateParams { + var () + return &TenancyTenantsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantsPartialUpdateParamsWithContext creates a new TenancyTenantsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantsPartialUpdateParamsWithContext(ctx context.Context) *TenancyTenantsPartialUpdateParams { + var () + return &TenancyTenantsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewTenancyTenantsPartialUpdateParamsWithHTTPClient creates a new TenancyTenantsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantsPartialUpdateParamsWithHTTPClient(client *http.Client) *TenancyTenantsPartialUpdateParams { + var () + return &TenancyTenantsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*TenancyTenantsPartialUpdateParams contains all the parameters to send to the API endpoint +for the tenancy tenants partial update operation typically these are written to a http.Request +*/ +type TenancyTenantsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableTenant + /*ID + A unique integer value identifying this tenant. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) WithTimeout(timeout time.Duration) *TenancyTenantsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) WithContext(ctx context.Context) *TenancyTenantsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) WithHTTPClient(client *http.Client) *TenancyTenantsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) WithData(data *models.WritableTenant) *TenancyTenantsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) SetData(data *models.WritableTenant) { + o.Data = data +} + +// WithID adds the id to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) WithID(id int64) *TenancyTenantsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_partial_update_responses.go new file mode 100644 index 0000000..238bdd4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// TenancyTenantsPartialUpdateReader is a Reader for the TenancyTenantsPartialUpdate structure. +type TenancyTenantsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyTenantsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTenancyTenantsPartialUpdateOK creates a TenancyTenantsPartialUpdateOK with default headers values +func NewTenancyTenantsPartialUpdateOK() *TenancyTenantsPartialUpdateOK { + return &TenancyTenantsPartialUpdateOK{} +} + +/*TenancyTenantsPartialUpdateOK handles this case with default header values. + +TenancyTenantsPartialUpdateOK tenancy tenants partial update o k +*/ +type TenancyTenantsPartialUpdateOK struct { + Payload *models.WritableTenant +} + +func (o *TenancyTenantsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /tenancy/tenants/{id}/][%d] tenancyTenantsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *TenancyTenantsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableTenant) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_read_parameters.go new file mode 100644 index 0000000..51a9700 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewTenancyTenantsReadParams creates a new TenancyTenantsReadParams object +// with the default values initialized. +func NewTenancyTenantsReadParams() *TenancyTenantsReadParams { + var () + return &TenancyTenantsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantsReadParamsWithTimeout creates a new TenancyTenantsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantsReadParamsWithTimeout(timeout time.Duration) *TenancyTenantsReadParams { + var () + return &TenancyTenantsReadParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantsReadParamsWithContext creates a new TenancyTenantsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantsReadParamsWithContext(ctx context.Context) *TenancyTenantsReadParams { + var () + return &TenancyTenantsReadParams{ + + Context: ctx, + } +} + +// NewTenancyTenantsReadParamsWithHTTPClient creates a new TenancyTenantsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantsReadParamsWithHTTPClient(client *http.Client) *TenancyTenantsReadParams { + var () + return &TenancyTenantsReadParams{ + HTTPClient: client, + } +} + +/*TenancyTenantsReadParams contains all the parameters to send to the API endpoint +for the tenancy tenants read operation typically these are written to a http.Request +*/ +type TenancyTenantsReadParams struct { + + /*ID + A unique integer value identifying this tenant. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenants read params +func (o *TenancyTenantsReadParams) WithTimeout(timeout time.Duration) *TenancyTenantsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenants read params +func (o *TenancyTenantsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenants read params +func (o *TenancyTenantsReadParams) WithContext(ctx context.Context) *TenancyTenantsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenants read params +func (o *TenancyTenantsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenants read params +func (o *TenancyTenantsReadParams) WithHTTPClient(client *http.Client) *TenancyTenantsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenants read params +func (o *TenancyTenantsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy tenants read params +func (o *TenancyTenantsReadParams) WithID(id int64) *TenancyTenantsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenants read params +func (o *TenancyTenantsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_read_responses.go new file mode 100644 index 0000000..7d30c28 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// TenancyTenantsReadReader is a Reader for the TenancyTenantsRead structure. +type TenancyTenantsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyTenantsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTenancyTenantsReadOK creates a TenancyTenantsReadOK with default headers values +func NewTenancyTenantsReadOK() *TenancyTenantsReadOK { + return &TenancyTenantsReadOK{} +} + +/*TenancyTenantsReadOK handles this case with default header values. + +TenancyTenantsReadOK tenancy tenants read o k +*/ +type TenancyTenantsReadOK struct { + Payload *models.Tenant +} + +func (o *TenancyTenantsReadOK) Error() string { + return fmt.Sprintf("[GET /tenancy/tenants/{id}/][%d] tenancyTenantsReadOK %+v", 200, o.Payload) +} + +func (o *TenancyTenantsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Tenant) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_update_parameters.go new file mode 100644 index 0000000..a4c978e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewTenancyTenantsUpdateParams creates a new TenancyTenantsUpdateParams object +// with the default values initialized. +func NewTenancyTenantsUpdateParams() *TenancyTenantsUpdateParams { + var () + return &TenancyTenantsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantsUpdateParamsWithTimeout creates a new TenancyTenantsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantsUpdateParamsWithTimeout(timeout time.Duration) *TenancyTenantsUpdateParams { + var () + return &TenancyTenantsUpdateParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantsUpdateParamsWithContext creates a new TenancyTenantsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantsUpdateParamsWithContext(ctx context.Context) *TenancyTenantsUpdateParams { + var () + return &TenancyTenantsUpdateParams{ + + Context: ctx, + } +} + +// NewTenancyTenantsUpdateParamsWithHTTPClient creates a new TenancyTenantsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantsUpdateParamsWithHTTPClient(client *http.Client) *TenancyTenantsUpdateParams { + var () + return &TenancyTenantsUpdateParams{ + HTTPClient: client, + } +} + +/*TenancyTenantsUpdateParams contains all the parameters to send to the API endpoint +for the tenancy tenants update operation typically these are written to a http.Request +*/ +type TenancyTenantsUpdateParams struct { + + /*Data*/ + Data *models.WritableTenant + /*ID + A unique integer value identifying this tenant. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) WithTimeout(timeout time.Duration) *TenancyTenantsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) WithContext(ctx context.Context) *TenancyTenantsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) WithHTTPClient(client *http.Client) *TenancyTenantsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) WithData(data *models.WritableTenant) *TenancyTenantsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) SetData(data *models.WritableTenant) { + o.Data = data +} + +// WithID adds the id to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) WithID(id int64) *TenancyTenantsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_update_responses.go new file mode 100644 index 0000000..548dbd1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/tenancy/tenancy_tenants_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// TenancyTenantsUpdateReader is a Reader for the TenancyTenantsUpdate structure. +type TenancyTenantsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyTenantsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTenancyTenantsUpdateOK creates a TenancyTenantsUpdateOK with default headers values +func NewTenancyTenantsUpdateOK() *TenancyTenantsUpdateOK { + return &TenancyTenantsUpdateOK{} +} + +/*TenancyTenantsUpdateOK handles this case with default header values. + +TenancyTenantsUpdateOK tenancy tenants update o k +*/ +type TenancyTenantsUpdateOK struct { + Payload *models.WritableTenant +} + +func (o *TenancyTenantsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /tenancy/tenants/{id}/][%d] tenancyTenantsUpdateOK %+v", 200, o.Payload) +} + +func (o *TenancyTenantsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableTenant) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_choices_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_choices_list_parameters.go new file mode 100644 index 0000000..c163258 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_choices_list_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationChoicesListParams creates a new VirtualizationChoicesListParams object +// with the default values initialized. +func NewVirtualizationChoicesListParams() *VirtualizationChoicesListParams { + + return &VirtualizationChoicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationChoicesListParamsWithTimeout creates a new VirtualizationChoicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationChoicesListParamsWithTimeout(timeout time.Duration) *VirtualizationChoicesListParams { + + return &VirtualizationChoicesListParams{ + + timeout: timeout, + } +} + +// NewVirtualizationChoicesListParamsWithContext creates a new VirtualizationChoicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationChoicesListParamsWithContext(ctx context.Context) *VirtualizationChoicesListParams { + + return &VirtualizationChoicesListParams{ + + Context: ctx, + } +} + +// NewVirtualizationChoicesListParamsWithHTTPClient creates a new VirtualizationChoicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationChoicesListParamsWithHTTPClient(client *http.Client) *VirtualizationChoicesListParams { + + return &VirtualizationChoicesListParams{ + HTTPClient: client, + } +} + +/*VirtualizationChoicesListParams contains all the parameters to send to the API endpoint +for the virtualization choices list operation typically these are written to a http.Request +*/ +type VirtualizationChoicesListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization choices list params +func (o *VirtualizationChoicesListParams) WithTimeout(timeout time.Duration) *VirtualizationChoicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization choices list params +func (o *VirtualizationChoicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization choices list params +func (o *VirtualizationChoicesListParams) WithContext(ctx context.Context) *VirtualizationChoicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization choices list params +func (o *VirtualizationChoicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization choices list params +func (o *VirtualizationChoicesListParams) WithHTTPClient(client *http.Client) *VirtualizationChoicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization choices list params +func (o *VirtualizationChoicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationChoicesListParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_choices_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_choices_list_responses.go new file mode 100644 index 0000000..825915b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_choices_list_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// VirtualizationChoicesListReader is a Reader for the VirtualizationChoicesList structure. +type VirtualizationChoicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationChoicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationChoicesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationChoicesListOK creates a VirtualizationChoicesListOK with default headers values +func NewVirtualizationChoicesListOK() *VirtualizationChoicesListOK { + return &VirtualizationChoicesListOK{} +} + +/*VirtualizationChoicesListOK handles this case with default header values. + +VirtualizationChoicesListOK virtualization choices list o k +*/ +type VirtualizationChoicesListOK struct { +} + +func (o *VirtualizationChoicesListOK) Error() string { + return fmt.Sprintf("[GET /virtualization/_choices/][%d] virtualizationChoicesListOK ", 200) +} + +func (o *VirtualizationChoicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_choices_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_choices_read_parameters.go new file mode 100644 index 0000000..5936d95 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_choices_read_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationChoicesReadParams creates a new VirtualizationChoicesReadParams object +// with the default values initialized. +func NewVirtualizationChoicesReadParams() *VirtualizationChoicesReadParams { + var () + return &VirtualizationChoicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationChoicesReadParamsWithTimeout creates a new VirtualizationChoicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationChoicesReadParamsWithTimeout(timeout time.Duration) *VirtualizationChoicesReadParams { + var () + return &VirtualizationChoicesReadParams{ + + timeout: timeout, + } +} + +// NewVirtualizationChoicesReadParamsWithContext creates a new VirtualizationChoicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationChoicesReadParamsWithContext(ctx context.Context) *VirtualizationChoicesReadParams { + var () + return &VirtualizationChoicesReadParams{ + + Context: ctx, + } +} + +// NewVirtualizationChoicesReadParamsWithHTTPClient creates a new VirtualizationChoicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationChoicesReadParamsWithHTTPClient(client *http.Client) *VirtualizationChoicesReadParams { + var () + return &VirtualizationChoicesReadParams{ + HTTPClient: client, + } +} + +/*VirtualizationChoicesReadParams contains all the parameters to send to the API endpoint +for the virtualization choices read operation typically these are written to a http.Request +*/ +type VirtualizationChoicesReadParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization choices read params +func (o *VirtualizationChoicesReadParams) WithTimeout(timeout time.Duration) *VirtualizationChoicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization choices read params +func (o *VirtualizationChoicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization choices read params +func (o *VirtualizationChoicesReadParams) WithContext(ctx context.Context) *VirtualizationChoicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization choices read params +func (o *VirtualizationChoicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization choices read params +func (o *VirtualizationChoicesReadParams) WithHTTPClient(client *http.Client) *VirtualizationChoicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization choices read params +func (o *VirtualizationChoicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization choices read params +func (o *VirtualizationChoicesReadParams) WithID(id string) *VirtualizationChoicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization choices read params +func (o *VirtualizationChoicesReadParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationChoicesReadParams) 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", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_choices_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_choices_read_responses.go new file mode 100644 index 0000000..0b0e1c7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_choices_read_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// VirtualizationChoicesReadReader is a Reader for the VirtualizationChoicesRead structure. +type VirtualizationChoicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationChoicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationChoicesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationChoicesReadOK creates a VirtualizationChoicesReadOK with default headers values +func NewVirtualizationChoicesReadOK() *VirtualizationChoicesReadOK { + return &VirtualizationChoicesReadOK{} +} + +/*VirtualizationChoicesReadOK handles this case with default header values. + +VirtualizationChoicesReadOK virtualization choices read o k +*/ +type VirtualizationChoicesReadOK struct { +} + +func (o *VirtualizationChoicesReadOK) Error() string { + return fmt.Sprintf("[GET /virtualization/_choices/{id}/][%d] virtualizationChoicesReadOK ", 200) +} + +func (o *VirtualizationChoicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_client.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_client.go new file mode 100644 index 0000000..b6368d4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_client.go @@ -0,0 +1,972 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new virtualization API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for virtualization API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +VirtualizationChoicesList virtualization choices list API +*/ +func (a *Client) VirtualizationChoicesList(params *VirtualizationChoicesListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationChoicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationChoicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization__choices_list", + Method: "GET", + PathPattern: "/virtualization/_choices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationChoicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationChoicesListOK), nil + +} + +/* +VirtualizationChoicesRead virtualization choices read API +*/ +func (a *Client) VirtualizationChoicesRead(params *VirtualizationChoicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationChoicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationChoicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization__choices_read", + Method: "GET", + PathPattern: "/virtualization/_choices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationChoicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationChoicesReadOK), nil + +} + +/* +VirtualizationClusterGroupsCreate virtualization cluster groups create API +*/ +func (a *Client) VirtualizationClusterGroupsCreate(params *VirtualizationClusterGroupsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterGroupsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterGroupsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-groups_create", + Method: "POST", + PathPattern: "/virtualization/cluster-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterGroupsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterGroupsCreateCreated), nil + +} + +/* +VirtualizationClusterGroupsDelete virtualization cluster groups delete API +*/ +func (a *Client) VirtualizationClusterGroupsDelete(params *VirtualizationClusterGroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterGroupsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterGroupsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-groups_delete", + Method: "DELETE", + PathPattern: "/virtualization/cluster-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterGroupsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterGroupsDeleteNoContent), nil + +} + +/* +VirtualizationClusterGroupsList virtualization cluster groups list API +*/ +func (a *Client) VirtualizationClusterGroupsList(params *VirtualizationClusterGroupsListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterGroupsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterGroupsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-groups_list", + Method: "GET", + PathPattern: "/virtualization/cluster-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterGroupsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterGroupsListOK), nil + +} + +/* +VirtualizationClusterGroupsPartialUpdate virtualization cluster groups partial update API +*/ +func (a *Client) VirtualizationClusterGroupsPartialUpdate(params *VirtualizationClusterGroupsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterGroupsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterGroupsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-groups_partial_update", + Method: "PATCH", + PathPattern: "/virtualization/cluster-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterGroupsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterGroupsPartialUpdateOK), nil + +} + +/* +VirtualizationClusterGroupsRead virtualization cluster groups read API +*/ +func (a *Client) VirtualizationClusterGroupsRead(params *VirtualizationClusterGroupsReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterGroupsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterGroupsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-groups_read", + Method: "GET", + PathPattern: "/virtualization/cluster-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterGroupsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterGroupsReadOK), nil + +} + +/* +VirtualizationClusterGroupsUpdate virtualization cluster groups update API +*/ +func (a *Client) VirtualizationClusterGroupsUpdate(params *VirtualizationClusterGroupsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterGroupsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterGroupsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-groups_update", + Method: "PUT", + PathPattern: "/virtualization/cluster-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterGroupsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterGroupsUpdateOK), nil + +} + +/* +VirtualizationClusterTypesCreate virtualization cluster types create API +*/ +func (a *Client) VirtualizationClusterTypesCreate(params *VirtualizationClusterTypesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterTypesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterTypesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-types_create", + Method: "POST", + PathPattern: "/virtualization/cluster-types/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterTypesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterTypesCreateCreated), nil + +} + +/* +VirtualizationClusterTypesDelete virtualization cluster types delete API +*/ +func (a *Client) VirtualizationClusterTypesDelete(params *VirtualizationClusterTypesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterTypesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterTypesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-types_delete", + Method: "DELETE", + PathPattern: "/virtualization/cluster-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterTypesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterTypesDeleteNoContent), nil + +} + +/* +VirtualizationClusterTypesList virtualization cluster types list API +*/ +func (a *Client) VirtualizationClusterTypesList(params *VirtualizationClusterTypesListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterTypesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterTypesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-types_list", + Method: "GET", + PathPattern: "/virtualization/cluster-types/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterTypesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterTypesListOK), nil + +} + +/* +VirtualizationClusterTypesPartialUpdate virtualization cluster types partial update API +*/ +func (a *Client) VirtualizationClusterTypesPartialUpdate(params *VirtualizationClusterTypesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterTypesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterTypesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-types_partial_update", + Method: "PATCH", + PathPattern: "/virtualization/cluster-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterTypesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterTypesPartialUpdateOK), nil + +} + +/* +VirtualizationClusterTypesRead virtualization cluster types read API +*/ +func (a *Client) VirtualizationClusterTypesRead(params *VirtualizationClusterTypesReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterTypesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterTypesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-types_read", + Method: "GET", + PathPattern: "/virtualization/cluster-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterTypesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterTypesReadOK), nil + +} + +/* +VirtualizationClusterTypesUpdate virtualization cluster types update API +*/ +func (a *Client) VirtualizationClusterTypesUpdate(params *VirtualizationClusterTypesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterTypesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterTypesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-types_update", + Method: "PUT", + PathPattern: "/virtualization/cluster-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterTypesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterTypesUpdateOK), nil + +} + +/* +VirtualizationClustersCreate virtualization clusters create API +*/ +func (a *Client) VirtualizationClustersCreate(params *VirtualizationClustersCreateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClustersCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClustersCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_clusters_create", + Method: "POST", + PathPattern: "/virtualization/clusters/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClustersCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClustersCreateCreated), nil + +} + +/* +VirtualizationClustersDelete virtualization clusters delete API +*/ +func (a *Client) VirtualizationClustersDelete(params *VirtualizationClustersDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClustersDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClustersDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_clusters_delete", + Method: "DELETE", + PathPattern: "/virtualization/clusters/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClustersDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClustersDeleteNoContent), nil + +} + +/* +VirtualizationClustersList virtualization clusters list API +*/ +func (a *Client) VirtualizationClustersList(params *VirtualizationClustersListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClustersListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClustersListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_clusters_list", + Method: "GET", + PathPattern: "/virtualization/clusters/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClustersListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClustersListOK), nil + +} + +/* +VirtualizationClustersPartialUpdate virtualization clusters partial update API +*/ +func (a *Client) VirtualizationClustersPartialUpdate(params *VirtualizationClustersPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClustersPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClustersPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_clusters_partial_update", + Method: "PATCH", + PathPattern: "/virtualization/clusters/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClustersPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClustersPartialUpdateOK), nil + +} + +/* +VirtualizationClustersRead virtualization clusters read API +*/ +func (a *Client) VirtualizationClustersRead(params *VirtualizationClustersReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClustersReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClustersReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_clusters_read", + Method: "GET", + PathPattern: "/virtualization/clusters/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClustersReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClustersReadOK), nil + +} + +/* +VirtualizationClustersUpdate virtualization clusters update API +*/ +func (a *Client) VirtualizationClustersUpdate(params *VirtualizationClustersUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClustersUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClustersUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_clusters_update", + Method: "PUT", + PathPattern: "/virtualization/clusters/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClustersUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClustersUpdateOK), nil + +} + +/* +VirtualizationInterfacesCreate virtualization interfaces create API +*/ +func (a *Client) VirtualizationInterfacesCreate(params *VirtualizationInterfacesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationInterfacesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationInterfacesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_interfaces_create", + Method: "POST", + PathPattern: "/virtualization/interfaces/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationInterfacesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationInterfacesCreateCreated), nil + +} + +/* +VirtualizationInterfacesDelete virtualization interfaces delete API +*/ +func (a *Client) VirtualizationInterfacesDelete(params *VirtualizationInterfacesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationInterfacesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationInterfacesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_interfaces_delete", + Method: "DELETE", + PathPattern: "/virtualization/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationInterfacesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationInterfacesDeleteNoContent), nil + +} + +/* +VirtualizationInterfacesList virtualization interfaces list API +*/ +func (a *Client) VirtualizationInterfacesList(params *VirtualizationInterfacesListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationInterfacesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationInterfacesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_interfaces_list", + Method: "GET", + PathPattern: "/virtualization/interfaces/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationInterfacesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationInterfacesListOK), nil + +} + +/* +VirtualizationInterfacesPartialUpdate virtualization interfaces partial update API +*/ +func (a *Client) VirtualizationInterfacesPartialUpdate(params *VirtualizationInterfacesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationInterfacesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationInterfacesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_interfaces_partial_update", + Method: "PATCH", + PathPattern: "/virtualization/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationInterfacesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationInterfacesPartialUpdateOK), nil + +} + +/* +VirtualizationInterfacesRead virtualization interfaces read API +*/ +func (a *Client) VirtualizationInterfacesRead(params *VirtualizationInterfacesReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationInterfacesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationInterfacesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_interfaces_read", + Method: "GET", + PathPattern: "/virtualization/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationInterfacesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationInterfacesReadOK), nil + +} + +/* +VirtualizationInterfacesUpdate virtualization interfaces update API +*/ +func (a *Client) VirtualizationInterfacesUpdate(params *VirtualizationInterfacesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationInterfacesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationInterfacesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_interfaces_update", + Method: "PUT", + PathPattern: "/virtualization/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationInterfacesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationInterfacesUpdateOK), nil + +} + +/* +VirtualizationVirtualMachinesCreate virtualization virtual machines create API +*/ +func (a *Client) VirtualizationVirtualMachinesCreate(params *VirtualizationVirtualMachinesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationVirtualMachinesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationVirtualMachinesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_virtual-machines_create", + Method: "POST", + PathPattern: "/virtualization/virtual-machines/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationVirtualMachinesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationVirtualMachinesCreateCreated), nil + +} + +/* +VirtualizationVirtualMachinesDelete virtualization virtual machines delete API +*/ +func (a *Client) VirtualizationVirtualMachinesDelete(params *VirtualizationVirtualMachinesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationVirtualMachinesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationVirtualMachinesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_virtual-machines_delete", + Method: "DELETE", + PathPattern: "/virtualization/virtual-machines/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationVirtualMachinesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationVirtualMachinesDeleteNoContent), nil + +} + +/* +VirtualizationVirtualMachinesList virtualization virtual machines list API +*/ +func (a *Client) VirtualizationVirtualMachinesList(params *VirtualizationVirtualMachinesListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationVirtualMachinesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationVirtualMachinesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_virtual-machines_list", + Method: "GET", + PathPattern: "/virtualization/virtual-machines/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationVirtualMachinesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationVirtualMachinesListOK), nil + +} + +/* +VirtualizationVirtualMachinesPartialUpdate virtualization virtual machines partial update API +*/ +func (a *Client) VirtualizationVirtualMachinesPartialUpdate(params *VirtualizationVirtualMachinesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationVirtualMachinesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationVirtualMachinesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_virtual-machines_partial_update", + Method: "PATCH", + PathPattern: "/virtualization/virtual-machines/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationVirtualMachinesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationVirtualMachinesPartialUpdateOK), nil + +} + +/* +VirtualizationVirtualMachinesRead virtualization virtual machines read API +*/ +func (a *Client) VirtualizationVirtualMachinesRead(params *VirtualizationVirtualMachinesReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationVirtualMachinesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationVirtualMachinesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_virtual-machines_read", + Method: "GET", + PathPattern: "/virtualization/virtual-machines/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationVirtualMachinesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationVirtualMachinesReadOK), nil + +} + +/* +VirtualizationVirtualMachinesUpdate virtualization virtual machines update API +*/ +func (a *Client) VirtualizationVirtualMachinesUpdate(params *VirtualizationVirtualMachinesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationVirtualMachinesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationVirtualMachinesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_virtual-machines_update", + Method: "PUT", + PathPattern: "/virtualization/virtual-machines/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationVirtualMachinesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationVirtualMachinesUpdateOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_create_parameters.go new file mode 100644 index 0000000..a590acf --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewVirtualizationClusterGroupsCreateParams creates a new VirtualizationClusterGroupsCreateParams object +// with the default values initialized. +func NewVirtualizationClusterGroupsCreateParams() *VirtualizationClusterGroupsCreateParams { + var () + return &VirtualizationClusterGroupsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterGroupsCreateParamsWithTimeout creates a new VirtualizationClusterGroupsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterGroupsCreateParamsWithTimeout(timeout time.Duration) *VirtualizationClusterGroupsCreateParams { + var () + return &VirtualizationClusterGroupsCreateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterGroupsCreateParamsWithContext creates a new VirtualizationClusterGroupsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterGroupsCreateParamsWithContext(ctx context.Context) *VirtualizationClusterGroupsCreateParams { + var () + return &VirtualizationClusterGroupsCreateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterGroupsCreateParamsWithHTTPClient creates a new VirtualizationClusterGroupsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterGroupsCreateParamsWithHTTPClient(client *http.Client) *VirtualizationClusterGroupsCreateParams { + var () + return &VirtualizationClusterGroupsCreateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterGroupsCreateParams contains all the parameters to send to the API endpoint +for the virtualization cluster groups create operation typically these are written to a http.Request +*/ +type VirtualizationClusterGroupsCreateParams struct { + + /*Data*/ + Data *models.ClusterGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster groups create params +func (o *VirtualizationClusterGroupsCreateParams) WithTimeout(timeout time.Duration) *VirtualizationClusterGroupsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster groups create params +func (o *VirtualizationClusterGroupsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster groups create params +func (o *VirtualizationClusterGroupsCreateParams) WithContext(ctx context.Context) *VirtualizationClusterGroupsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster groups create params +func (o *VirtualizationClusterGroupsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster groups create params +func (o *VirtualizationClusterGroupsCreateParams) WithHTTPClient(client *http.Client) *VirtualizationClusterGroupsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster groups create params +func (o *VirtualizationClusterGroupsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization cluster groups create params +func (o *VirtualizationClusterGroupsCreateParams) WithData(data *models.ClusterGroup) *VirtualizationClusterGroupsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization cluster groups create params +func (o *VirtualizationClusterGroupsCreateParams) SetData(data *models.ClusterGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterGroupsCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_create_responses.go new file mode 100644 index 0000000..e524dfa --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationClusterGroupsCreateReader is a Reader for the VirtualizationClusterGroupsCreate structure. +type VirtualizationClusterGroupsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterGroupsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewVirtualizationClusterGroupsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClusterGroupsCreateCreated creates a VirtualizationClusterGroupsCreateCreated with default headers values +func NewVirtualizationClusterGroupsCreateCreated() *VirtualizationClusterGroupsCreateCreated { + return &VirtualizationClusterGroupsCreateCreated{} +} + +/*VirtualizationClusterGroupsCreateCreated handles this case with default header values. + +VirtualizationClusterGroupsCreateCreated virtualization cluster groups create created +*/ +type VirtualizationClusterGroupsCreateCreated struct { + Payload *models.ClusterGroup +} + +func (o *VirtualizationClusterGroupsCreateCreated) Error() string { + return fmt.Sprintf("[POST /virtualization/cluster-groups/][%d] virtualizationClusterGroupsCreateCreated %+v", 201, o.Payload) +} + +func (o *VirtualizationClusterGroupsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_delete_parameters.go new file mode 100644 index 0000000..6650a4b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationClusterGroupsDeleteParams creates a new VirtualizationClusterGroupsDeleteParams object +// with the default values initialized. +func NewVirtualizationClusterGroupsDeleteParams() *VirtualizationClusterGroupsDeleteParams { + var () + return &VirtualizationClusterGroupsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterGroupsDeleteParamsWithTimeout creates a new VirtualizationClusterGroupsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterGroupsDeleteParamsWithTimeout(timeout time.Duration) *VirtualizationClusterGroupsDeleteParams { + var () + return &VirtualizationClusterGroupsDeleteParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterGroupsDeleteParamsWithContext creates a new VirtualizationClusterGroupsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterGroupsDeleteParamsWithContext(ctx context.Context) *VirtualizationClusterGroupsDeleteParams { + var () + return &VirtualizationClusterGroupsDeleteParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterGroupsDeleteParamsWithHTTPClient creates a new VirtualizationClusterGroupsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterGroupsDeleteParamsWithHTTPClient(client *http.Client) *VirtualizationClusterGroupsDeleteParams { + var () + return &VirtualizationClusterGroupsDeleteParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterGroupsDeleteParams contains all the parameters to send to the API endpoint +for the virtualization cluster groups delete operation typically these are written to a http.Request +*/ +type VirtualizationClusterGroupsDeleteParams struct { + + /*ID + A unique integer value identifying this cluster group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster groups delete params +func (o *VirtualizationClusterGroupsDeleteParams) WithTimeout(timeout time.Duration) *VirtualizationClusterGroupsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster groups delete params +func (o *VirtualizationClusterGroupsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster groups delete params +func (o *VirtualizationClusterGroupsDeleteParams) WithContext(ctx context.Context) *VirtualizationClusterGroupsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster groups delete params +func (o *VirtualizationClusterGroupsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster groups delete params +func (o *VirtualizationClusterGroupsDeleteParams) WithHTTPClient(client *http.Client) *VirtualizationClusterGroupsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster groups delete params +func (o *VirtualizationClusterGroupsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization cluster groups delete params +func (o *VirtualizationClusterGroupsDeleteParams) WithID(id int64) *VirtualizationClusterGroupsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster groups delete params +func (o *VirtualizationClusterGroupsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterGroupsDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_delete_responses.go new file mode 100644 index 0000000..f692975 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// VirtualizationClusterGroupsDeleteReader is a Reader for the VirtualizationClusterGroupsDelete structure. +type VirtualizationClusterGroupsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterGroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewVirtualizationClusterGroupsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClusterGroupsDeleteNoContent creates a VirtualizationClusterGroupsDeleteNoContent with default headers values +func NewVirtualizationClusterGroupsDeleteNoContent() *VirtualizationClusterGroupsDeleteNoContent { + return &VirtualizationClusterGroupsDeleteNoContent{} +} + +/*VirtualizationClusterGroupsDeleteNoContent handles this case with default header values. + +VirtualizationClusterGroupsDeleteNoContent virtualization cluster groups delete no content +*/ +type VirtualizationClusterGroupsDeleteNoContent struct { +} + +func (o *VirtualizationClusterGroupsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /virtualization/cluster-groups/{id}/][%d] virtualizationClusterGroupsDeleteNoContent ", 204) +} + +func (o *VirtualizationClusterGroupsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_list_parameters.go new file mode 100644 index 0000000..69ec092 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_list_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationClusterGroupsListParams creates a new VirtualizationClusterGroupsListParams object +// with the default values initialized. +func NewVirtualizationClusterGroupsListParams() *VirtualizationClusterGroupsListParams { + var () + return &VirtualizationClusterGroupsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterGroupsListParamsWithTimeout creates a new VirtualizationClusterGroupsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterGroupsListParamsWithTimeout(timeout time.Duration) *VirtualizationClusterGroupsListParams { + var () + return &VirtualizationClusterGroupsListParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterGroupsListParamsWithContext creates a new VirtualizationClusterGroupsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterGroupsListParamsWithContext(ctx context.Context) *VirtualizationClusterGroupsListParams { + var () + return &VirtualizationClusterGroupsListParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterGroupsListParamsWithHTTPClient creates a new VirtualizationClusterGroupsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterGroupsListParamsWithHTTPClient(client *http.Client) *VirtualizationClusterGroupsListParams { + var () + return &VirtualizationClusterGroupsListParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterGroupsListParams contains all the parameters to send to the API endpoint +for the virtualization cluster groups list operation typically these are written to a http.Request +*/ +type VirtualizationClusterGroupsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithTimeout(timeout time.Duration) *VirtualizationClusterGroupsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithContext(ctx context.Context) *VirtualizationClusterGroupsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithHTTPClient(client *http.Client) *VirtualizationClusterGroupsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithLimit(limit *int64) *VirtualizationClusterGroupsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithName(name *string) *VirtualizationClusterGroupsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithOffset(offset *int64) *VirtualizationClusterGroupsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithSlug(slug *string) *VirtualizationClusterGroupsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_list_responses.go new file mode 100644 index 0000000..d024019 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationClusterGroupsListReader is a Reader for the VirtualizationClusterGroupsList structure. +type VirtualizationClusterGroupsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterGroupsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClusterGroupsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClusterGroupsListOK creates a VirtualizationClusterGroupsListOK with default headers values +func NewVirtualizationClusterGroupsListOK() *VirtualizationClusterGroupsListOK { + return &VirtualizationClusterGroupsListOK{} +} + +/*VirtualizationClusterGroupsListOK handles this case with default header values. + +VirtualizationClusterGroupsListOK virtualization cluster groups list o k +*/ +type VirtualizationClusterGroupsListOK struct { + Payload *models.VirtualizationClusterGroupsListOKBody +} + +func (o *VirtualizationClusterGroupsListOK) Error() string { + return fmt.Sprintf("[GET /virtualization/cluster-groups/][%d] virtualizationClusterGroupsListOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClusterGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VirtualizationClusterGroupsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_partial_update_parameters.go new file mode 100644 index 0000000..7f83baa --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewVirtualizationClusterGroupsPartialUpdateParams creates a new VirtualizationClusterGroupsPartialUpdateParams object +// with the default values initialized. +func NewVirtualizationClusterGroupsPartialUpdateParams() *VirtualizationClusterGroupsPartialUpdateParams { + var () + return &VirtualizationClusterGroupsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterGroupsPartialUpdateParamsWithTimeout creates a new VirtualizationClusterGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterGroupsPartialUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationClusterGroupsPartialUpdateParams { + var () + return &VirtualizationClusterGroupsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterGroupsPartialUpdateParamsWithContext creates a new VirtualizationClusterGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterGroupsPartialUpdateParamsWithContext(ctx context.Context) *VirtualizationClusterGroupsPartialUpdateParams { + var () + return &VirtualizationClusterGroupsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterGroupsPartialUpdateParamsWithHTTPClient creates a new VirtualizationClusterGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterGroupsPartialUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationClusterGroupsPartialUpdateParams { + var () + return &VirtualizationClusterGroupsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterGroupsPartialUpdateParams contains all the parameters to send to the API endpoint +for the virtualization cluster groups partial update operation typically these are written to a http.Request +*/ +type VirtualizationClusterGroupsPartialUpdateParams struct { + + /*Data*/ + Data *models.ClusterGroup + /*ID + A unique integer value identifying this cluster group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationClusterGroupsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) WithContext(ctx context.Context) *VirtualizationClusterGroupsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationClusterGroupsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) WithData(data *models.ClusterGroup) *VirtualizationClusterGroupsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) SetData(data *models.ClusterGroup) { + o.Data = data +} + +// WithID adds the id to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) WithID(id int64) *VirtualizationClusterGroupsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterGroupsPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_partial_update_responses.go new file mode 100644 index 0000000..4056d75 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationClusterGroupsPartialUpdateReader is a Reader for the VirtualizationClusterGroupsPartialUpdate structure. +type VirtualizationClusterGroupsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterGroupsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClusterGroupsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClusterGroupsPartialUpdateOK creates a VirtualizationClusterGroupsPartialUpdateOK with default headers values +func NewVirtualizationClusterGroupsPartialUpdateOK() *VirtualizationClusterGroupsPartialUpdateOK { + return &VirtualizationClusterGroupsPartialUpdateOK{} +} + +/*VirtualizationClusterGroupsPartialUpdateOK handles this case with default header values. + +VirtualizationClusterGroupsPartialUpdateOK virtualization cluster groups partial update o k +*/ +type VirtualizationClusterGroupsPartialUpdateOK struct { + Payload *models.ClusterGroup +} + +func (o *VirtualizationClusterGroupsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /virtualization/cluster-groups/{id}/][%d] virtualizationClusterGroupsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClusterGroupsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_read_parameters.go new file mode 100644 index 0000000..d6e2cf8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationClusterGroupsReadParams creates a new VirtualizationClusterGroupsReadParams object +// with the default values initialized. +func NewVirtualizationClusterGroupsReadParams() *VirtualizationClusterGroupsReadParams { + var () + return &VirtualizationClusterGroupsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterGroupsReadParamsWithTimeout creates a new VirtualizationClusterGroupsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterGroupsReadParamsWithTimeout(timeout time.Duration) *VirtualizationClusterGroupsReadParams { + var () + return &VirtualizationClusterGroupsReadParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterGroupsReadParamsWithContext creates a new VirtualizationClusterGroupsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterGroupsReadParamsWithContext(ctx context.Context) *VirtualizationClusterGroupsReadParams { + var () + return &VirtualizationClusterGroupsReadParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterGroupsReadParamsWithHTTPClient creates a new VirtualizationClusterGroupsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterGroupsReadParamsWithHTTPClient(client *http.Client) *VirtualizationClusterGroupsReadParams { + var () + return &VirtualizationClusterGroupsReadParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterGroupsReadParams contains all the parameters to send to the API endpoint +for the virtualization cluster groups read operation typically these are written to a http.Request +*/ +type VirtualizationClusterGroupsReadParams struct { + + /*ID + A unique integer value identifying this cluster group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster groups read params +func (o *VirtualizationClusterGroupsReadParams) WithTimeout(timeout time.Duration) *VirtualizationClusterGroupsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster groups read params +func (o *VirtualizationClusterGroupsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster groups read params +func (o *VirtualizationClusterGroupsReadParams) WithContext(ctx context.Context) *VirtualizationClusterGroupsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster groups read params +func (o *VirtualizationClusterGroupsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster groups read params +func (o *VirtualizationClusterGroupsReadParams) WithHTTPClient(client *http.Client) *VirtualizationClusterGroupsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster groups read params +func (o *VirtualizationClusterGroupsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization cluster groups read params +func (o *VirtualizationClusterGroupsReadParams) WithID(id int64) *VirtualizationClusterGroupsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster groups read params +func (o *VirtualizationClusterGroupsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterGroupsReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_read_responses.go new file mode 100644 index 0000000..db0c616 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationClusterGroupsReadReader is a Reader for the VirtualizationClusterGroupsRead structure. +type VirtualizationClusterGroupsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterGroupsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClusterGroupsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClusterGroupsReadOK creates a VirtualizationClusterGroupsReadOK with default headers values +func NewVirtualizationClusterGroupsReadOK() *VirtualizationClusterGroupsReadOK { + return &VirtualizationClusterGroupsReadOK{} +} + +/*VirtualizationClusterGroupsReadOK handles this case with default header values. + +VirtualizationClusterGroupsReadOK virtualization cluster groups read o k +*/ +type VirtualizationClusterGroupsReadOK struct { + Payload *models.ClusterGroup +} + +func (o *VirtualizationClusterGroupsReadOK) Error() string { + return fmt.Sprintf("[GET /virtualization/cluster-groups/{id}/][%d] virtualizationClusterGroupsReadOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClusterGroupsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_update_parameters.go new file mode 100644 index 0000000..607ac97 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewVirtualizationClusterGroupsUpdateParams creates a new VirtualizationClusterGroupsUpdateParams object +// with the default values initialized. +func NewVirtualizationClusterGroupsUpdateParams() *VirtualizationClusterGroupsUpdateParams { + var () + return &VirtualizationClusterGroupsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterGroupsUpdateParamsWithTimeout creates a new VirtualizationClusterGroupsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterGroupsUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationClusterGroupsUpdateParams { + var () + return &VirtualizationClusterGroupsUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterGroupsUpdateParamsWithContext creates a new VirtualizationClusterGroupsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterGroupsUpdateParamsWithContext(ctx context.Context) *VirtualizationClusterGroupsUpdateParams { + var () + return &VirtualizationClusterGroupsUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterGroupsUpdateParamsWithHTTPClient creates a new VirtualizationClusterGroupsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterGroupsUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationClusterGroupsUpdateParams { + var () + return &VirtualizationClusterGroupsUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterGroupsUpdateParams contains all the parameters to send to the API endpoint +for the virtualization cluster groups update operation typically these are written to a http.Request +*/ +type VirtualizationClusterGroupsUpdateParams struct { + + /*Data*/ + Data *models.ClusterGroup + /*ID + A unique integer value identifying this cluster group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationClusterGroupsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) WithContext(ctx context.Context) *VirtualizationClusterGroupsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationClusterGroupsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) WithData(data *models.ClusterGroup) *VirtualizationClusterGroupsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) SetData(data *models.ClusterGroup) { + o.Data = data +} + +// WithID adds the id to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) WithID(id int64) *VirtualizationClusterGroupsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterGroupsUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_update_responses.go new file mode 100644 index 0000000..d520331 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationClusterGroupsUpdateReader is a Reader for the VirtualizationClusterGroupsUpdate structure. +type VirtualizationClusterGroupsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterGroupsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClusterGroupsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClusterGroupsUpdateOK creates a VirtualizationClusterGroupsUpdateOK with default headers values +func NewVirtualizationClusterGroupsUpdateOK() *VirtualizationClusterGroupsUpdateOK { + return &VirtualizationClusterGroupsUpdateOK{} +} + +/*VirtualizationClusterGroupsUpdateOK handles this case with default header values. + +VirtualizationClusterGroupsUpdateOK virtualization cluster groups update o k +*/ +type VirtualizationClusterGroupsUpdateOK struct { + Payload *models.ClusterGroup +} + +func (o *VirtualizationClusterGroupsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /virtualization/cluster-groups/{id}/][%d] virtualizationClusterGroupsUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClusterGroupsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_create_parameters.go new file mode 100644 index 0000000..e235ea5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewVirtualizationClusterTypesCreateParams creates a new VirtualizationClusterTypesCreateParams object +// with the default values initialized. +func NewVirtualizationClusterTypesCreateParams() *VirtualizationClusterTypesCreateParams { + var () + return &VirtualizationClusterTypesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterTypesCreateParamsWithTimeout creates a new VirtualizationClusterTypesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterTypesCreateParamsWithTimeout(timeout time.Duration) *VirtualizationClusterTypesCreateParams { + var () + return &VirtualizationClusterTypesCreateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterTypesCreateParamsWithContext creates a new VirtualizationClusterTypesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterTypesCreateParamsWithContext(ctx context.Context) *VirtualizationClusterTypesCreateParams { + var () + return &VirtualizationClusterTypesCreateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterTypesCreateParamsWithHTTPClient creates a new VirtualizationClusterTypesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterTypesCreateParamsWithHTTPClient(client *http.Client) *VirtualizationClusterTypesCreateParams { + var () + return &VirtualizationClusterTypesCreateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterTypesCreateParams contains all the parameters to send to the API endpoint +for the virtualization cluster types create operation typically these are written to a http.Request +*/ +type VirtualizationClusterTypesCreateParams struct { + + /*Data*/ + Data *models.ClusterType + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster types create params +func (o *VirtualizationClusterTypesCreateParams) WithTimeout(timeout time.Duration) *VirtualizationClusterTypesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster types create params +func (o *VirtualizationClusterTypesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster types create params +func (o *VirtualizationClusterTypesCreateParams) WithContext(ctx context.Context) *VirtualizationClusterTypesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster types create params +func (o *VirtualizationClusterTypesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster types create params +func (o *VirtualizationClusterTypesCreateParams) WithHTTPClient(client *http.Client) *VirtualizationClusterTypesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster types create params +func (o *VirtualizationClusterTypesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization cluster types create params +func (o *VirtualizationClusterTypesCreateParams) WithData(data *models.ClusterType) *VirtualizationClusterTypesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization cluster types create params +func (o *VirtualizationClusterTypesCreateParams) SetData(data *models.ClusterType) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterTypesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_create_responses.go new file mode 100644 index 0000000..0993ab1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationClusterTypesCreateReader is a Reader for the VirtualizationClusterTypesCreate structure. +type VirtualizationClusterTypesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterTypesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewVirtualizationClusterTypesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClusterTypesCreateCreated creates a VirtualizationClusterTypesCreateCreated with default headers values +func NewVirtualizationClusterTypesCreateCreated() *VirtualizationClusterTypesCreateCreated { + return &VirtualizationClusterTypesCreateCreated{} +} + +/*VirtualizationClusterTypesCreateCreated handles this case with default header values. + +VirtualizationClusterTypesCreateCreated virtualization cluster types create created +*/ +type VirtualizationClusterTypesCreateCreated struct { + Payload *models.ClusterType +} + +func (o *VirtualizationClusterTypesCreateCreated) Error() string { + return fmt.Sprintf("[POST /virtualization/cluster-types/][%d] virtualizationClusterTypesCreateCreated %+v", 201, o.Payload) +} + +func (o *VirtualizationClusterTypesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_delete_parameters.go new file mode 100644 index 0000000..1f25901 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationClusterTypesDeleteParams creates a new VirtualizationClusterTypesDeleteParams object +// with the default values initialized. +func NewVirtualizationClusterTypesDeleteParams() *VirtualizationClusterTypesDeleteParams { + var () + return &VirtualizationClusterTypesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterTypesDeleteParamsWithTimeout creates a new VirtualizationClusterTypesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterTypesDeleteParamsWithTimeout(timeout time.Duration) *VirtualizationClusterTypesDeleteParams { + var () + return &VirtualizationClusterTypesDeleteParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterTypesDeleteParamsWithContext creates a new VirtualizationClusterTypesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterTypesDeleteParamsWithContext(ctx context.Context) *VirtualizationClusterTypesDeleteParams { + var () + return &VirtualizationClusterTypesDeleteParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterTypesDeleteParamsWithHTTPClient creates a new VirtualizationClusterTypesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterTypesDeleteParamsWithHTTPClient(client *http.Client) *VirtualizationClusterTypesDeleteParams { + var () + return &VirtualizationClusterTypesDeleteParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterTypesDeleteParams contains all the parameters to send to the API endpoint +for the virtualization cluster types delete operation typically these are written to a http.Request +*/ +type VirtualizationClusterTypesDeleteParams struct { + + /*ID + A unique integer value identifying this cluster type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster types delete params +func (o *VirtualizationClusterTypesDeleteParams) WithTimeout(timeout time.Duration) *VirtualizationClusterTypesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster types delete params +func (o *VirtualizationClusterTypesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster types delete params +func (o *VirtualizationClusterTypesDeleteParams) WithContext(ctx context.Context) *VirtualizationClusterTypesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster types delete params +func (o *VirtualizationClusterTypesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster types delete params +func (o *VirtualizationClusterTypesDeleteParams) WithHTTPClient(client *http.Client) *VirtualizationClusterTypesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster types delete params +func (o *VirtualizationClusterTypesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization cluster types delete params +func (o *VirtualizationClusterTypesDeleteParams) WithID(id int64) *VirtualizationClusterTypesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster types delete params +func (o *VirtualizationClusterTypesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterTypesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_delete_responses.go new file mode 100644 index 0000000..521bbdc --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// VirtualizationClusterTypesDeleteReader is a Reader for the VirtualizationClusterTypesDelete structure. +type VirtualizationClusterTypesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterTypesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewVirtualizationClusterTypesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClusterTypesDeleteNoContent creates a VirtualizationClusterTypesDeleteNoContent with default headers values +func NewVirtualizationClusterTypesDeleteNoContent() *VirtualizationClusterTypesDeleteNoContent { + return &VirtualizationClusterTypesDeleteNoContent{} +} + +/*VirtualizationClusterTypesDeleteNoContent handles this case with default header values. + +VirtualizationClusterTypesDeleteNoContent virtualization cluster types delete no content +*/ +type VirtualizationClusterTypesDeleteNoContent struct { +} + +func (o *VirtualizationClusterTypesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /virtualization/cluster-types/{id}/][%d] virtualizationClusterTypesDeleteNoContent ", 204) +} + +func (o *VirtualizationClusterTypesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_list_parameters.go new file mode 100644 index 0000000..cf4d454 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_list_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationClusterTypesListParams creates a new VirtualizationClusterTypesListParams object +// with the default values initialized. +func NewVirtualizationClusterTypesListParams() *VirtualizationClusterTypesListParams { + var () + return &VirtualizationClusterTypesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterTypesListParamsWithTimeout creates a new VirtualizationClusterTypesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterTypesListParamsWithTimeout(timeout time.Duration) *VirtualizationClusterTypesListParams { + var () + return &VirtualizationClusterTypesListParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterTypesListParamsWithContext creates a new VirtualizationClusterTypesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterTypesListParamsWithContext(ctx context.Context) *VirtualizationClusterTypesListParams { + var () + return &VirtualizationClusterTypesListParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterTypesListParamsWithHTTPClient creates a new VirtualizationClusterTypesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterTypesListParamsWithHTTPClient(client *http.Client) *VirtualizationClusterTypesListParams { + var () + return &VirtualizationClusterTypesListParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterTypesListParams contains all the parameters to send to the API endpoint +for the virtualization cluster types list operation typically these are written to a http.Request +*/ +type VirtualizationClusterTypesListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) WithTimeout(timeout time.Duration) *VirtualizationClusterTypesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) WithContext(ctx context.Context) *VirtualizationClusterTypesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) WithHTTPClient(client *http.Client) *VirtualizationClusterTypesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) WithLimit(limit *int64) *VirtualizationClusterTypesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) WithName(name *string) *VirtualizationClusterTypesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) WithOffset(offset *int64) *VirtualizationClusterTypesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) WithSlug(slug *string) *VirtualizationClusterTypesListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterTypesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_list_responses.go new file mode 100644 index 0000000..71e1448 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationClusterTypesListReader is a Reader for the VirtualizationClusterTypesList structure. +type VirtualizationClusterTypesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterTypesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClusterTypesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClusterTypesListOK creates a VirtualizationClusterTypesListOK with default headers values +func NewVirtualizationClusterTypesListOK() *VirtualizationClusterTypesListOK { + return &VirtualizationClusterTypesListOK{} +} + +/*VirtualizationClusterTypesListOK handles this case with default header values. + +VirtualizationClusterTypesListOK virtualization cluster types list o k +*/ +type VirtualizationClusterTypesListOK struct { + Payload *models.VirtualizationClusterTypesListOKBody +} + +func (o *VirtualizationClusterTypesListOK) Error() string { + return fmt.Sprintf("[GET /virtualization/cluster-types/][%d] virtualizationClusterTypesListOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClusterTypesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VirtualizationClusterTypesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_partial_update_parameters.go new file mode 100644 index 0000000..5ed9188 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewVirtualizationClusterTypesPartialUpdateParams creates a new VirtualizationClusterTypesPartialUpdateParams object +// with the default values initialized. +func NewVirtualizationClusterTypesPartialUpdateParams() *VirtualizationClusterTypesPartialUpdateParams { + var () + return &VirtualizationClusterTypesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterTypesPartialUpdateParamsWithTimeout creates a new VirtualizationClusterTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterTypesPartialUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationClusterTypesPartialUpdateParams { + var () + return &VirtualizationClusterTypesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterTypesPartialUpdateParamsWithContext creates a new VirtualizationClusterTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterTypesPartialUpdateParamsWithContext(ctx context.Context) *VirtualizationClusterTypesPartialUpdateParams { + var () + return &VirtualizationClusterTypesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterTypesPartialUpdateParamsWithHTTPClient creates a new VirtualizationClusterTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterTypesPartialUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationClusterTypesPartialUpdateParams { + var () + return &VirtualizationClusterTypesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterTypesPartialUpdateParams contains all the parameters to send to the API endpoint +for the virtualization cluster types partial update operation typically these are written to a http.Request +*/ +type VirtualizationClusterTypesPartialUpdateParams struct { + + /*Data*/ + Data *models.ClusterType + /*ID + A unique integer value identifying this cluster type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationClusterTypesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) WithContext(ctx context.Context) *VirtualizationClusterTypesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationClusterTypesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) WithData(data *models.ClusterType) *VirtualizationClusterTypesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) SetData(data *models.ClusterType) { + o.Data = data +} + +// WithID adds the id to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) WithID(id int64) *VirtualizationClusterTypesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterTypesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_partial_update_responses.go new file mode 100644 index 0000000..433095b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationClusterTypesPartialUpdateReader is a Reader for the VirtualizationClusterTypesPartialUpdate structure. +type VirtualizationClusterTypesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterTypesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClusterTypesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClusterTypesPartialUpdateOK creates a VirtualizationClusterTypesPartialUpdateOK with default headers values +func NewVirtualizationClusterTypesPartialUpdateOK() *VirtualizationClusterTypesPartialUpdateOK { + return &VirtualizationClusterTypesPartialUpdateOK{} +} + +/*VirtualizationClusterTypesPartialUpdateOK handles this case with default header values. + +VirtualizationClusterTypesPartialUpdateOK virtualization cluster types partial update o k +*/ +type VirtualizationClusterTypesPartialUpdateOK struct { + Payload *models.ClusterType +} + +func (o *VirtualizationClusterTypesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /virtualization/cluster-types/{id}/][%d] virtualizationClusterTypesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClusterTypesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_read_parameters.go new file mode 100644 index 0000000..e8813a7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationClusterTypesReadParams creates a new VirtualizationClusterTypesReadParams object +// with the default values initialized. +func NewVirtualizationClusterTypesReadParams() *VirtualizationClusterTypesReadParams { + var () + return &VirtualizationClusterTypesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterTypesReadParamsWithTimeout creates a new VirtualizationClusterTypesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterTypesReadParamsWithTimeout(timeout time.Duration) *VirtualizationClusterTypesReadParams { + var () + return &VirtualizationClusterTypesReadParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterTypesReadParamsWithContext creates a new VirtualizationClusterTypesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterTypesReadParamsWithContext(ctx context.Context) *VirtualizationClusterTypesReadParams { + var () + return &VirtualizationClusterTypesReadParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterTypesReadParamsWithHTTPClient creates a new VirtualizationClusterTypesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterTypesReadParamsWithHTTPClient(client *http.Client) *VirtualizationClusterTypesReadParams { + var () + return &VirtualizationClusterTypesReadParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterTypesReadParams contains all the parameters to send to the API endpoint +for the virtualization cluster types read operation typically these are written to a http.Request +*/ +type VirtualizationClusterTypesReadParams struct { + + /*ID + A unique integer value identifying this cluster type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster types read params +func (o *VirtualizationClusterTypesReadParams) WithTimeout(timeout time.Duration) *VirtualizationClusterTypesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster types read params +func (o *VirtualizationClusterTypesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster types read params +func (o *VirtualizationClusterTypesReadParams) WithContext(ctx context.Context) *VirtualizationClusterTypesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster types read params +func (o *VirtualizationClusterTypesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster types read params +func (o *VirtualizationClusterTypesReadParams) WithHTTPClient(client *http.Client) *VirtualizationClusterTypesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster types read params +func (o *VirtualizationClusterTypesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization cluster types read params +func (o *VirtualizationClusterTypesReadParams) WithID(id int64) *VirtualizationClusterTypesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster types read params +func (o *VirtualizationClusterTypesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterTypesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_read_responses.go new file mode 100644 index 0000000..0b76a2a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationClusterTypesReadReader is a Reader for the VirtualizationClusterTypesRead structure. +type VirtualizationClusterTypesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterTypesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClusterTypesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClusterTypesReadOK creates a VirtualizationClusterTypesReadOK with default headers values +func NewVirtualizationClusterTypesReadOK() *VirtualizationClusterTypesReadOK { + return &VirtualizationClusterTypesReadOK{} +} + +/*VirtualizationClusterTypesReadOK handles this case with default header values. + +VirtualizationClusterTypesReadOK virtualization cluster types read o k +*/ +type VirtualizationClusterTypesReadOK struct { + Payload *models.ClusterType +} + +func (o *VirtualizationClusterTypesReadOK) Error() string { + return fmt.Sprintf("[GET /virtualization/cluster-types/{id}/][%d] virtualizationClusterTypesReadOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClusterTypesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_update_parameters.go new file mode 100644 index 0000000..3c610e4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewVirtualizationClusterTypesUpdateParams creates a new VirtualizationClusterTypesUpdateParams object +// with the default values initialized. +func NewVirtualizationClusterTypesUpdateParams() *VirtualizationClusterTypesUpdateParams { + var () + return &VirtualizationClusterTypesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterTypesUpdateParamsWithTimeout creates a new VirtualizationClusterTypesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterTypesUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationClusterTypesUpdateParams { + var () + return &VirtualizationClusterTypesUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterTypesUpdateParamsWithContext creates a new VirtualizationClusterTypesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterTypesUpdateParamsWithContext(ctx context.Context) *VirtualizationClusterTypesUpdateParams { + var () + return &VirtualizationClusterTypesUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterTypesUpdateParamsWithHTTPClient creates a new VirtualizationClusterTypesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterTypesUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationClusterTypesUpdateParams { + var () + return &VirtualizationClusterTypesUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterTypesUpdateParams contains all the parameters to send to the API endpoint +for the virtualization cluster types update operation typically these are written to a http.Request +*/ +type VirtualizationClusterTypesUpdateParams struct { + + /*Data*/ + Data *models.ClusterType + /*ID + A unique integer value identifying this cluster type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationClusterTypesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) WithContext(ctx context.Context) *VirtualizationClusterTypesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationClusterTypesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) WithData(data *models.ClusterType) *VirtualizationClusterTypesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) SetData(data *models.ClusterType) { + o.Data = data +} + +// WithID adds the id to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) WithID(id int64) *VirtualizationClusterTypesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterTypesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_update_responses.go new file mode 100644 index 0000000..30ec8b2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_cluster_types_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationClusterTypesUpdateReader is a Reader for the VirtualizationClusterTypesUpdate structure. +type VirtualizationClusterTypesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterTypesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClusterTypesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClusterTypesUpdateOK creates a VirtualizationClusterTypesUpdateOK with default headers values +func NewVirtualizationClusterTypesUpdateOK() *VirtualizationClusterTypesUpdateOK { + return &VirtualizationClusterTypesUpdateOK{} +} + +/*VirtualizationClusterTypesUpdateOK handles this case with default header values. + +VirtualizationClusterTypesUpdateOK virtualization cluster types update o k +*/ +type VirtualizationClusterTypesUpdateOK struct { + Payload *models.ClusterType +} + +func (o *VirtualizationClusterTypesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /virtualization/cluster-types/{id}/][%d] virtualizationClusterTypesUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClusterTypesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_create_parameters.go new file mode 100644 index 0000000..4bada44 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewVirtualizationClustersCreateParams creates a new VirtualizationClustersCreateParams object +// with the default values initialized. +func NewVirtualizationClustersCreateParams() *VirtualizationClustersCreateParams { + var () + return &VirtualizationClustersCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClustersCreateParamsWithTimeout creates a new VirtualizationClustersCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClustersCreateParamsWithTimeout(timeout time.Duration) *VirtualizationClustersCreateParams { + var () + return &VirtualizationClustersCreateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClustersCreateParamsWithContext creates a new VirtualizationClustersCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClustersCreateParamsWithContext(ctx context.Context) *VirtualizationClustersCreateParams { + var () + return &VirtualizationClustersCreateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClustersCreateParamsWithHTTPClient creates a new VirtualizationClustersCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClustersCreateParamsWithHTTPClient(client *http.Client) *VirtualizationClustersCreateParams { + var () + return &VirtualizationClustersCreateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClustersCreateParams contains all the parameters to send to the API endpoint +for the virtualization clusters create operation typically these are written to a http.Request +*/ +type VirtualizationClustersCreateParams struct { + + /*Data*/ + Data *models.WritableCluster + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization clusters create params +func (o *VirtualizationClustersCreateParams) WithTimeout(timeout time.Duration) *VirtualizationClustersCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization clusters create params +func (o *VirtualizationClustersCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization clusters create params +func (o *VirtualizationClustersCreateParams) WithContext(ctx context.Context) *VirtualizationClustersCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization clusters create params +func (o *VirtualizationClustersCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization clusters create params +func (o *VirtualizationClustersCreateParams) WithHTTPClient(client *http.Client) *VirtualizationClustersCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization clusters create params +func (o *VirtualizationClustersCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization clusters create params +func (o *VirtualizationClustersCreateParams) WithData(data *models.WritableCluster) *VirtualizationClustersCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization clusters create params +func (o *VirtualizationClustersCreateParams) SetData(data *models.WritableCluster) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClustersCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_create_responses.go new file mode 100644 index 0000000..c53ceac --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationClustersCreateReader is a Reader for the VirtualizationClustersCreate structure. +type VirtualizationClustersCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClustersCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewVirtualizationClustersCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClustersCreateCreated creates a VirtualizationClustersCreateCreated with default headers values +func NewVirtualizationClustersCreateCreated() *VirtualizationClustersCreateCreated { + return &VirtualizationClustersCreateCreated{} +} + +/*VirtualizationClustersCreateCreated handles this case with default header values. + +VirtualizationClustersCreateCreated virtualization clusters create created +*/ +type VirtualizationClustersCreateCreated struct { + Payload *models.WritableCluster +} + +func (o *VirtualizationClustersCreateCreated) Error() string { + return fmt.Sprintf("[POST /virtualization/clusters/][%d] virtualizationClustersCreateCreated %+v", 201, o.Payload) +} + +func (o *VirtualizationClustersCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCluster) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_delete_parameters.go new file mode 100644 index 0000000..50dac18 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationClustersDeleteParams creates a new VirtualizationClustersDeleteParams object +// with the default values initialized. +func NewVirtualizationClustersDeleteParams() *VirtualizationClustersDeleteParams { + var () + return &VirtualizationClustersDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClustersDeleteParamsWithTimeout creates a new VirtualizationClustersDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClustersDeleteParamsWithTimeout(timeout time.Duration) *VirtualizationClustersDeleteParams { + var () + return &VirtualizationClustersDeleteParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClustersDeleteParamsWithContext creates a new VirtualizationClustersDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClustersDeleteParamsWithContext(ctx context.Context) *VirtualizationClustersDeleteParams { + var () + return &VirtualizationClustersDeleteParams{ + + Context: ctx, + } +} + +// NewVirtualizationClustersDeleteParamsWithHTTPClient creates a new VirtualizationClustersDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClustersDeleteParamsWithHTTPClient(client *http.Client) *VirtualizationClustersDeleteParams { + var () + return &VirtualizationClustersDeleteParams{ + HTTPClient: client, + } +} + +/*VirtualizationClustersDeleteParams contains all the parameters to send to the API endpoint +for the virtualization clusters delete operation typically these are written to a http.Request +*/ +type VirtualizationClustersDeleteParams struct { + + /*ID + A unique integer value identifying this cluster. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization clusters delete params +func (o *VirtualizationClustersDeleteParams) WithTimeout(timeout time.Duration) *VirtualizationClustersDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization clusters delete params +func (o *VirtualizationClustersDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization clusters delete params +func (o *VirtualizationClustersDeleteParams) WithContext(ctx context.Context) *VirtualizationClustersDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization clusters delete params +func (o *VirtualizationClustersDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization clusters delete params +func (o *VirtualizationClustersDeleteParams) WithHTTPClient(client *http.Client) *VirtualizationClustersDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization clusters delete params +func (o *VirtualizationClustersDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization clusters delete params +func (o *VirtualizationClustersDeleteParams) WithID(id int64) *VirtualizationClustersDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization clusters delete params +func (o *VirtualizationClustersDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClustersDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_delete_responses.go new file mode 100644 index 0000000..1725e2e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// VirtualizationClustersDeleteReader is a Reader for the VirtualizationClustersDelete structure. +type VirtualizationClustersDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClustersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewVirtualizationClustersDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClustersDeleteNoContent creates a VirtualizationClustersDeleteNoContent with default headers values +func NewVirtualizationClustersDeleteNoContent() *VirtualizationClustersDeleteNoContent { + return &VirtualizationClustersDeleteNoContent{} +} + +/*VirtualizationClustersDeleteNoContent handles this case with default header values. + +VirtualizationClustersDeleteNoContent virtualization clusters delete no content +*/ +type VirtualizationClustersDeleteNoContent struct { +} + +func (o *VirtualizationClustersDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /virtualization/clusters/{id}/][%d] virtualizationClustersDeleteNoContent ", 204) +} + +func (o *VirtualizationClustersDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_list_parameters.go new file mode 100644 index 0000000..c1fd970 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_list_parameters.go @@ -0,0 +1,459 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationClustersListParams creates a new VirtualizationClustersListParams object +// with the default values initialized. +func NewVirtualizationClustersListParams() *VirtualizationClustersListParams { + var () + return &VirtualizationClustersListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClustersListParamsWithTimeout creates a new VirtualizationClustersListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClustersListParamsWithTimeout(timeout time.Duration) *VirtualizationClustersListParams { + var () + return &VirtualizationClustersListParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClustersListParamsWithContext creates a new VirtualizationClustersListParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClustersListParamsWithContext(ctx context.Context) *VirtualizationClustersListParams { + var () + return &VirtualizationClustersListParams{ + + Context: ctx, + } +} + +// NewVirtualizationClustersListParamsWithHTTPClient creates a new VirtualizationClustersListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClustersListParamsWithHTTPClient(client *http.Client) *VirtualizationClustersListParams { + var () + return &VirtualizationClustersListParams{ + HTTPClient: client, + } +} + +/*VirtualizationClustersListParams contains all the parameters to send to the API endpoint +for the virtualization clusters list operation typically these are written to a http.Request +*/ +type VirtualizationClustersListParams struct { + + /*Group*/ + Group *string + /*GroupID*/ + GroupID *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Type*/ + Type *string + /*TypeID*/ + TypeID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithTimeout(timeout time.Duration) *VirtualizationClustersListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithContext(ctx context.Context) *VirtualizationClustersListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithHTTPClient(client *http.Client) *VirtualizationClustersListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithGroup adds the group to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithGroup(group *string) *VirtualizationClustersListParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetGroup(group *string) { + o.Group = group +} + +// WithGroupID adds the groupID to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithGroupID(groupID *string) *VirtualizationClustersListParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetGroupID(groupID *string) { + o.GroupID = groupID +} + +// WithIDIn adds the iDIn to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithIDIn(iDIn *string) *VirtualizationClustersListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithLimit(limit *int64) *VirtualizationClustersListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithName(name *string) *VirtualizationClustersListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithOffset(offset *int64) *VirtualizationClustersListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithQ(q *string) *VirtualizationClustersListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetQ(q *string) { + o.Q = q +} + +// WithSite adds the site to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithSite(site *string) *VirtualizationClustersListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithSiteID(siteID *string) *VirtualizationClustersListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithType adds the typeVar to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithType(typeVar *string) *VirtualizationClustersListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WithTypeID adds the typeID to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithTypeID(typeID *string) *VirtualizationClustersListParams { + o.SetTypeID(typeID) + return o +} + +// SetTypeID adds the typeId to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetTypeID(typeID *string) { + o.TypeID = typeID +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClustersListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); 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.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.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.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.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if o.TypeID != nil { + + // query param type_id + var qrTypeID string + if o.TypeID != nil { + qrTypeID = *o.TypeID + } + qTypeID := qrTypeID + if qTypeID != "" { + if err := r.SetQueryParam("type_id", qTypeID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_list_responses.go new file mode 100644 index 0000000..c61053f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationClustersListReader is a Reader for the VirtualizationClustersList structure. +type VirtualizationClustersListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClustersListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClustersListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClustersListOK creates a VirtualizationClustersListOK with default headers values +func NewVirtualizationClustersListOK() *VirtualizationClustersListOK { + return &VirtualizationClustersListOK{} +} + +/*VirtualizationClustersListOK handles this case with default header values. + +VirtualizationClustersListOK virtualization clusters list o k +*/ +type VirtualizationClustersListOK struct { + Payload *models.VirtualizationClustersListOKBody +} + +func (o *VirtualizationClustersListOK) Error() string { + return fmt.Sprintf("[GET /virtualization/clusters/][%d] virtualizationClustersListOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClustersListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VirtualizationClustersListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_partial_update_parameters.go new file mode 100644 index 0000000..1d9a3a8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewVirtualizationClustersPartialUpdateParams creates a new VirtualizationClustersPartialUpdateParams object +// with the default values initialized. +func NewVirtualizationClustersPartialUpdateParams() *VirtualizationClustersPartialUpdateParams { + var () + return &VirtualizationClustersPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClustersPartialUpdateParamsWithTimeout creates a new VirtualizationClustersPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClustersPartialUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationClustersPartialUpdateParams { + var () + return &VirtualizationClustersPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClustersPartialUpdateParamsWithContext creates a new VirtualizationClustersPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClustersPartialUpdateParamsWithContext(ctx context.Context) *VirtualizationClustersPartialUpdateParams { + var () + return &VirtualizationClustersPartialUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClustersPartialUpdateParamsWithHTTPClient creates a new VirtualizationClustersPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClustersPartialUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationClustersPartialUpdateParams { + var () + return &VirtualizationClustersPartialUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClustersPartialUpdateParams contains all the parameters to send to the API endpoint +for the virtualization clusters partial update operation typically these are written to a http.Request +*/ +type VirtualizationClustersPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableCluster + /*ID + A unique integer value identifying this cluster. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationClustersPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) WithContext(ctx context.Context) *VirtualizationClustersPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationClustersPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) WithData(data *models.WritableCluster) *VirtualizationClustersPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) SetData(data *models.WritableCluster) { + o.Data = data +} + +// WithID adds the id to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) WithID(id int64) *VirtualizationClustersPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClustersPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_partial_update_responses.go new file mode 100644 index 0000000..8539f28 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationClustersPartialUpdateReader is a Reader for the VirtualizationClustersPartialUpdate structure. +type VirtualizationClustersPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClustersPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClustersPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClustersPartialUpdateOK creates a VirtualizationClustersPartialUpdateOK with default headers values +func NewVirtualizationClustersPartialUpdateOK() *VirtualizationClustersPartialUpdateOK { + return &VirtualizationClustersPartialUpdateOK{} +} + +/*VirtualizationClustersPartialUpdateOK handles this case with default header values. + +VirtualizationClustersPartialUpdateOK virtualization clusters partial update o k +*/ +type VirtualizationClustersPartialUpdateOK struct { + Payload *models.WritableCluster +} + +func (o *VirtualizationClustersPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /virtualization/clusters/{id}/][%d] virtualizationClustersPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClustersPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCluster) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_read_parameters.go new file mode 100644 index 0000000..65f3a01 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationClustersReadParams creates a new VirtualizationClustersReadParams object +// with the default values initialized. +func NewVirtualizationClustersReadParams() *VirtualizationClustersReadParams { + var () + return &VirtualizationClustersReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClustersReadParamsWithTimeout creates a new VirtualizationClustersReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClustersReadParamsWithTimeout(timeout time.Duration) *VirtualizationClustersReadParams { + var () + return &VirtualizationClustersReadParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClustersReadParamsWithContext creates a new VirtualizationClustersReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClustersReadParamsWithContext(ctx context.Context) *VirtualizationClustersReadParams { + var () + return &VirtualizationClustersReadParams{ + + Context: ctx, + } +} + +// NewVirtualizationClustersReadParamsWithHTTPClient creates a new VirtualizationClustersReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClustersReadParamsWithHTTPClient(client *http.Client) *VirtualizationClustersReadParams { + var () + return &VirtualizationClustersReadParams{ + HTTPClient: client, + } +} + +/*VirtualizationClustersReadParams contains all the parameters to send to the API endpoint +for the virtualization clusters read operation typically these are written to a http.Request +*/ +type VirtualizationClustersReadParams struct { + + /*ID + A unique integer value identifying this cluster. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization clusters read params +func (o *VirtualizationClustersReadParams) WithTimeout(timeout time.Duration) *VirtualizationClustersReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization clusters read params +func (o *VirtualizationClustersReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization clusters read params +func (o *VirtualizationClustersReadParams) WithContext(ctx context.Context) *VirtualizationClustersReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization clusters read params +func (o *VirtualizationClustersReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization clusters read params +func (o *VirtualizationClustersReadParams) WithHTTPClient(client *http.Client) *VirtualizationClustersReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization clusters read params +func (o *VirtualizationClustersReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization clusters read params +func (o *VirtualizationClustersReadParams) WithID(id int64) *VirtualizationClustersReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization clusters read params +func (o *VirtualizationClustersReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClustersReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_read_responses.go new file mode 100644 index 0000000..b309b87 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationClustersReadReader is a Reader for the VirtualizationClustersRead structure. +type VirtualizationClustersReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClustersReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClustersReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClustersReadOK creates a VirtualizationClustersReadOK with default headers values +func NewVirtualizationClustersReadOK() *VirtualizationClustersReadOK { + return &VirtualizationClustersReadOK{} +} + +/*VirtualizationClustersReadOK handles this case with default header values. + +VirtualizationClustersReadOK virtualization clusters read o k +*/ +type VirtualizationClustersReadOK struct { + Payload *models.Cluster +} + +func (o *VirtualizationClustersReadOK) Error() string { + return fmt.Sprintf("[GET /virtualization/clusters/{id}/][%d] virtualizationClustersReadOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClustersReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Cluster) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_update_parameters.go new file mode 100644 index 0000000..484c4bd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewVirtualizationClustersUpdateParams creates a new VirtualizationClustersUpdateParams object +// with the default values initialized. +func NewVirtualizationClustersUpdateParams() *VirtualizationClustersUpdateParams { + var () + return &VirtualizationClustersUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClustersUpdateParamsWithTimeout creates a new VirtualizationClustersUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClustersUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationClustersUpdateParams { + var () + return &VirtualizationClustersUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClustersUpdateParamsWithContext creates a new VirtualizationClustersUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClustersUpdateParamsWithContext(ctx context.Context) *VirtualizationClustersUpdateParams { + var () + return &VirtualizationClustersUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClustersUpdateParamsWithHTTPClient creates a new VirtualizationClustersUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClustersUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationClustersUpdateParams { + var () + return &VirtualizationClustersUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClustersUpdateParams contains all the parameters to send to the API endpoint +for the virtualization clusters update operation typically these are written to a http.Request +*/ +type VirtualizationClustersUpdateParams struct { + + /*Data*/ + Data *models.WritableCluster + /*ID + A unique integer value identifying this cluster. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationClustersUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) WithContext(ctx context.Context) *VirtualizationClustersUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationClustersUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) WithData(data *models.WritableCluster) *VirtualizationClustersUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) SetData(data *models.WritableCluster) { + o.Data = data +} + +// WithID adds the id to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) WithID(id int64) *VirtualizationClustersUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClustersUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_update_responses.go new file mode 100644 index 0000000..3e969db --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_clusters_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationClustersUpdateReader is a Reader for the VirtualizationClustersUpdate structure. +type VirtualizationClustersUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClustersUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClustersUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationClustersUpdateOK creates a VirtualizationClustersUpdateOK with default headers values +func NewVirtualizationClustersUpdateOK() *VirtualizationClustersUpdateOK { + return &VirtualizationClustersUpdateOK{} +} + +/*VirtualizationClustersUpdateOK handles this case with default header values. + +VirtualizationClustersUpdateOK virtualization clusters update o k +*/ +type VirtualizationClustersUpdateOK struct { + Payload *models.WritableCluster +} + +func (o *VirtualizationClustersUpdateOK) Error() string { + return fmt.Sprintf("[PUT /virtualization/clusters/{id}/][%d] virtualizationClustersUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClustersUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCluster) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_create_parameters.go new file mode 100644 index 0000000..1d3cb0c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewVirtualizationInterfacesCreateParams creates a new VirtualizationInterfacesCreateParams object +// with the default values initialized. +func NewVirtualizationInterfacesCreateParams() *VirtualizationInterfacesCreateParams { + var () + return &VirtualizationInterfacesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationInterfacesCreateParamsWithTimeout creates a new VirtualizationInterfacesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationInterfacesCreateParamsWithTimeout(timeout time.Duration) *VirtualizationInterfacesCreateParams { + var () + return &VirtualizationInterfacesCreateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationInterfacesCreateParamsWithContext creates a new VirtualizationInterfacesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationInterfacesCreateParamsWithContext(ctx context.Context) *VirtualizationInterfacesCreateParams { + var () + return &VirtualizationInterfacesCreateParams{ + + Context: ctx, + } +} + +// NewVirtualizationInterfacesCreateParamsWithHTTPClient creates a new VirtualizationInterfacesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationInterfacesCreateParamsWithHTTPClient(client *http.Client) *VirtualizationInterfacesCreateParams { + var () + return &VirtualizationInterfacesCreateParams{ + HTTPClient: client, + } +} + +/*VirtualizationInterfacesCreateParams contains all the parameters to send to the API endpoint +for the virtualization interfaces create operation typically these are written to a http.Request +*/ +type VirtualizationInterfacesCreateParams struct { + + /*Data*/ + Data *models.WritableInterface + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization interfaces create params +func (o *VirtualizationInterfacesCreateParams) WithTimeout(timeout time.Duration) *VirtualizationInterfacesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization interfaces create params +func (o *VirtualizationInterfacesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization interfaces create params +func (o *VirtualizationInterfacesCreateParams) WithContext(ctx context.Context) *VirtualizationInterfacesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization interfaces create params +func (o *VirtualizationInterfacesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization interfaces create params +func (o *VirtualizationInterfacesCreateParams) WithHTTPClient(client *http.Client) *VirtualizationInterfacesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization interfaces create params +func (o *VirtualizationInterfacesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization interfaces create params +func (o *VirtualizationInterfacesCreateParams) WithData(data *models.WritableInterface) *VirtualizationInterfacesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization interfaces create params +func (o *VirtualizationInterfacesCreateParams) SetData(data *models.WritableInterface) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationInterfacesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_create_responses.go new file mode 100644 index 0000000..4aed325 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationInterfacesCreateReader is a Reader for the VirtualizationInterfacesCreate structure. +type VirtualizationInterfacesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationInterfacesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewVirtualizationInterfacesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationInterfacesCreateCreated creates a VirtualizationInterfacesCreateCreated with default headers values +func NewVirtualizationInterfacesCreateCreated() *VirtualizationInterfacesCreateCreated { + return &VirtualizationInterfacesCreateCreated{} +} + +/*VirtualizationInterfacesCreateCreated handles this case with default header values. + +VirtualizationInterfacesCreateCreated virtualization interfaces create created +*/ +type VirtualizationInterfacesCreateCreated struct { + Payload *models.WritableInterface +} + +func (o *VirtualizationInterfacesCreateCreated) Error() string { + return fmt.Sprintf("[POST /virtualization/interfaces/][%d] virtualizationInterfacesCreateCreated %+v", 201, o.Payload) +} + +func (o *VirtualizationInterfacesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterface) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_delete_parameters.go new file mode 100644 index 0000000..b8b9861 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationInterfacesDeleteParams creates a new VirtualizationInterfacesDeleteParams object +// with the default values initialized. +func NewVirtualizationInterfacesDeleteParams() *VirtualizationInterfacesDeleteParams { + var () + return &VirtualizationInterfacesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationInterfacesDeleteParamsWithTimeout creates a new VirtualizationInterfacesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationInterfacesDeleteParamsWithTimeout(timeout time.Duration) *VirtualizationInterfacesDeleteParams { + var () + return &VirtualizationInterfacesDeleteParams{ + + timeout: timeout, + } +} + +// NewVirtualizationInterfacesDeleteParamsWithContext creates a new VirtualizationInterfacesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationInterfacesDeleteParamsWithContext(ctx context.Context) *VirtualizationInterfacesDeleteParams { + var () + return &VirtualizationInterfacesDeleteParams{ + + Context: ctx, + } +} + +// NewVirtualizationInterfacesDeleteParamsWithHTTPClient creates a new VirtualizationInterfacesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationInterfacesDeleteParamsWithHTTPClient(client *http.Client) *VirtualizationInterfacesDeleteParams { + var () + return &VirtualizationInterfacesDeleteParams{ + HTTPClient: client, + } +} + +/*VirtualizationInterfacesDeleteParams contains all the parameters to send to the API endpoint +for the virtualization interfaces delete operation typically these are written to a http.Request +*/ +type VirtualizationInterfacesDeleteParams struct { + + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization interfaces delete params +func (o *VirtualizationInterfacesDeleteParams) WithTimeout(timeout time.Duration) *VirtualizationInterfacesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization interfaces delete params +func (o *VirtualizationInterfacesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization interfaces delete params +func (o *VirtualizationInterfacesDeleteParams) WithContext(ctx context.Context) *VirtualizationInterfacesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization interfaces delete params +func (o *VirtualizationInterfacesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization interfaces delete params +func (o *VirtualizationInterfacesDeleteParams) WithHTTPClient(client *http.Client) *VirtualizationInterfacesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization interfaces delete params +func (o *VirtualizationInterfacesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization interfaces delete params +func (o *VirtualizationInterfacesDeleteParams) WithID(id int64) *VirtualizationInterfacesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization interfaces delete params +func (o *VirtualizationInterfacesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationInterfacesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_delete_responses.go new file mode 100644 index 0000000..3a86961 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// VirtualizationInterfacesDeleteReader is a Reader for the VirtualizationInterfacesDelete structure. +type VirtualizationInterfacesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationInterfacesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewVirtualizationInterfacesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationInterfacesDeleteNoContent creates a VirtualizationInterfacesDeleteNoContent with default headers values +func NewVirtualizationInterfacesDeleteNoContent() *VirtualizationInterfacesDeleteNoContent { + return &VirtualizationInterfacesDeleteNoContent{} +} + +/*VirtualizationInterfacesDeleteNoContent handles this case with default header values. + +VirtualizationInterfacesDeleteNoContent virtualization interfaces delete no content +*/ +type VirtualizationInterfacesDeleteNoContent struct { +} + +func (o *VirtualizationInterfacesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /virtualization/interfaces/{id}/][%d] virtualizationInterfacesDeleteNoContent ", 204) +} + +func (o *VirtualizationInterfacesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_list_parameters.go new file mode 100644 index 0000000..3f0b716 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_list_parameters.go @@ -0,0 +1,369 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationInterfacesListParams creates a new VirtualizationInterfacesListParams object +// with the default values initialized. +func NewVirtualizationInterfacesListParams() *VirtualizationInterfacesListParams { + var () + return &VirtualizationInterfacesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationInterfacesListParamsWithTimeout creates a new VirtualizationInterfacesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationInterfacesListParamsWithTimeout(timeout time.Duration) *VirtualizationInterfacesListParams { + var () + return &VirtualizationInterfacesListParams{ + + timeout: timeout, + } +} + +// NewVirtualizationInterfacesListParamsWithContext creates a new VirtualizationInterfacesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationInterfacesListParamsWithContext(ctx context.Context) *VirtualizationInterfacesListParams { + var () + return &VirtualizationInterfacesListParams{ + + Context: ctx, + } +} + +// NewVirtualizationInterfacesListParamsWithHTTPClient creates a new VirtualizationInterfacesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationInterfacesListParamsWithHTTPClient(client *http.Client) *VirtualizationInterfacesListParams { + var () + return &VirtualizationInterfacesListParams{ + HTTPClient: client, + } +} + +/*VirtualizationInterfacesListParams contains all the parameters to send to the API endpoint +for the virtualization interfaces list operation typically these are written to a http.Request +*/ +type VirtualizationInterfacesListParams struct { + + /*Enabled*/ + Enabled *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*MacAddress*/ + MacAddress *string + /*Mtu*/ + Mtu *float64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*VirtualMachine*/ + VirtualMachine *string + /*VirtualMachineID*/ + VirtualMachineID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithTimeout(timeout time.Duration) *VirtualizationInterfacesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithContext(ctx context.Context) *VirtualizationInterfacesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithHTTPClient(client *http.Client) *VirtualizationInterfacesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEnabled adds the enabled to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithEnabled(enabled *string) *VirtualizationInterfacesListParams { + o.SetEnabled(enabled) + return o +} + +// SetEnabled adds the enabled to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetEnabled(enabled *string) { + o.Enabled = enabled +} + +// WithLimit adds the limit to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithLimit(limit *int64) *VirtualizationInterfacesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithMacAddress adds the macAddress to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithMacAddress(macAddress *string) *VirtualizationInterfacesListParams { + o.SetMacAddress(macAddress) + return o +} + +// SetMacAddress adds the macAddress to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetMacAddress(macAddress *string) { + o.MacAddress = macAddress +} + +// WithMtu adds the mtu to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithMtu(mtu *float64) *VirtualizationInterfacesListParams { + o.SetMtu(mtu) + return o +} + +// SetMtu adds the mtu to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetMtu(mtu *float64) { + o.Mtu = mtu +} + +// WithName adds the name to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithName(name *string) *VirtualizationInterfacesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithOffset(offset *int64) *VirtualizationInterfacesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithVirtualMachine adds the virtualMachine to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithVirtualMachine(virtualMachine *string) *VirtualizationInterfacesListParams { + o.SetVirtualMachine(virtualMachine) + return o +} + +// SetVirtualMachine adds the virtualMachine to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetVirtualMachine(virtualMachine *string) { + o.VirtualMachine = virtualMachine +} + +// WithVirtualMachineID adds the virtualMachineID to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithVirtualMachineID(virtualMachineID *string) *VirtualizationInterfacesListParams { + o.SetVirtualMachineID(virtualMachineID) + return o +} + +// SetVirtualMachineID adds the virtualMachineId to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetVirtualMachineID(virtualMachineID *string) { + o.VirtualMachineID = virtualMachineID +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationInterfacesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Enabled != nil { + + // query param enabled + var qrEnabled string + if o.Enabled != nil { + qrEnabled = *o.Enabled + } + qEnabled := qrEnabled + if qEnabled != "" { + if err := r.SetQueryParam("enabled", qEnabled); 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.MacAddress != nil { + + // query param mac_address + var qrMacAddress string + if o.MacAddress != nil { + qrMacAddress = *o.MacAddress + } + qMacAddress := qrMacAddress + if qMacAddress != "" { + if err := r.SetQueryParam("mac_address", qMacAddress); err != nil { + return err + } + } + + } + + if o.Mtu != nil { + + // query param mtu + var qrMtu float64 + if o.Mtu != nil { + qrMtu = *o.Mtu + } + qMtu := swag.FormatFloat64(qrMtu) + if qMtu != "" { + if err := r.SetQueryParam("mtu", qMtu); 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.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.VirtualMachine != nil { + + // query param virtual_machine + var qrVirtualMachine string + if o.VirtualMachine != nil { + qrVirtualMachine = *o.VirtualMachine + } + qVirtualMachine := qrVirtualMachine + if qVirtualMachine != "" { + if err := r.SetQueryParam("virtual_machine", qVirtualMachine); err != nil { + return err + } + } + + } + + if o.VirtualMachineID != nil { + + // query param virtual_machine_id + var qrVirtualMachineID string + if o.VirtualMachineID != nil { + qrVirtualMachineID = *o.VirtualMachineID + } + qVirtualMachineID := qrVirtualMachineID + if qVirtualMachineID != "" { + if err := r.SetQueryParam("virtual_machine_id", qVirtualMachineID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_list_responses.go new file mode 100644 index 0000000..5746fc3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationInterfacesListReader is a Reader for the VirtualizationInterfacesList structure. +type VirtualizationInterfacesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationInterfacesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationInterfacesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationInterfacesListOK creates a VirtualizationInterfacesListOK with default headers values +func NewVirtualizationInterfacesListOK() *VirtualizationInterfacesListOK { + return &VirtualizationInterfacesListOK{} +} + +/*VirtualizationInterfacesListOK handles this case with default header values. + +VirtualizationInterfacesListOK virtualization interfaces list o k +*/ +type VirtualizationInterfacesListOK struct { + Payload *models.VirtualizationInterfacesListOKBody +} + +func (o *VirtualizationInterfacesListOK) Error() string { + return fmt.Sprintf("[GET /virtualization/interfaces/][%d] virtualizationInterfacesListOK %+v", 200, o.Payload) +} + +func (o *VirtualizationInterfacesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VirtualizationInterfacesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_partial_update_parameters.go new file mode 100644 index 0000000..20ca38e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewVirtualizationInterfacesPartialUpdateParams creates a new VirtualizationInterfacesPartialUpdateParams object +// with the default values initialized. +func NewVirtualizationInterfacesPartialUpdateParams() *VirtualizationInterfacesPartialUpdateParams { + var () + return &VirtualizationInterfacesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationInterfacesPartialUpdateParamsWithTimeout creates a new VirtualizationInterfacesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationInterfacesPartialUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationInterfacesPartialUpdateParams { + var () + return &VirtualizationInterfacesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationInterfacesPartialUpdateParamsWithContext creates a new VirtualizationInterfacesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationInterfacesPartialUpdateParamsWithContext(ctx context.Context) *VirtualizationInterfacesPartialUpdateParams { + var () + return &VirtualizationInterfacesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationInterfacesPartialUpdateParamsWithHTTPClient creates a new VirtualizationInterfacesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationInterfacesPartialUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationInterfacesPartialUpdateParams { + var () + return &VirtualizationInterfacesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationInterfacesPartialUpdateParams contains all the parameters to send to the API endpoint +for the virtualization interfaces partial update operation typically these are written to a http.Request +*/ +type VirtualizationInterfacesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableInterface + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationInterfacesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) WithContext(ctx context.Context) *VirtualizationInterfacesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationInterfacesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) WithData(data *models.WritableInterface) *VirtualizationInterfacesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) SetData(data *models.WritableInterface) { + o.Data = data +} + +// WithID adds the id to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) WithID(id int64) *VirtualizationInterfacesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationInterfacesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_partial_update_responses.go new file mode 100644 index 0000000..4d3c73e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationInterfacesPartialUpdateReader is a Reader for the VirtualizationInterfacesPartialUpdate structure. +type VirtualizationInterfacesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationInterfacesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationInterfacesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationInterfacesPartialUpdateOK creates a VirtualizationInterfacesPartialUpdateOK with default headers values +func NewVirtualizationInterfacesPartialUpdateOK() *VirtualizationInterfacesPartialUpdateOK { + return &VirtualizationInterfacesPartialUpdateOK{} +} + +/*VirtualizationInterfacesPartialUpdateOK handles this case with default header values. + +VirtualizationInterfacesPartialUpdateOK virtualization interfaces partial update o k +*/ +type VirtualizationInterfacesPartialUpdateOK struct { + Payload *models.WritableInterface +} + +func (o *VirtualizationInterfacesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /virtualization/interfaces/{id}/][%d] virtualizationInterfacesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationInterfacesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterface) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_read_parameters.go new file mode 100644 index 0000000..40dc3d7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationInterfacesReadParams creates a new VirtualizationInterfacesReadParams object +// with the default values initialized. +func NewVirtualizationInterfacesReadParams() *VirtualizationInterfacesReadParams { + var () + return &VirtualizationInterfacesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationInterfacesReadParamsWithTimeout creates a new VirtualizationInterfacesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationInterfacesReadParamsWithTimeout(timeout time.Duration) *VirtualizationInterfacesReadParams { + var () + return &VirtualizationInterfacesReadParams{ + + timeout: timeout, + } +} + +// NewVirtualizationInterfacesReadParamsWithContext creates a new VirtualizationInterfacesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationInterfacesReadParamsWithContext(ctx context.Context) *VirtualizationInterfacesReadParams { + var () + return &VirtualizationInterfacesReadParams{ + + Context: ctx, + } +} + +// NewVirtualizationInterfacesReadParamsWithHTTPClient creates a new VirtualizationInterfacesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationInterfacesReadParamsWithHTTPClient(client *http.Client) *VirtualizationInterfacesReadParams { + var () + return &VirtualizationInterfacesReadParams{ + HTTPClient: client, + } +} + +/*VirtualizationInterfacesReadParams contains all the parameters to send to the API endpoint +for the virtualization interfaces read operation typically these are written to a http.Request +*/ +type VirtualizationInterfacesReadParams struct { + + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization interfaces read params +func (o *VirtualizationInterfacesReadParams) WithTimeout(timeout time.Duration) *VirtualizationInterfacesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization interfaces read params +func (o *VirtualizationInterfacesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization interfaces read params +func (o *VirtualizationInterfacesReadParams) WithContext(ctx context.Context) *VirtualizationInterfacesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization interfaces read params +func (o *VirtualizationInterfacesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization interfaces read params +func (o *VirtualizationInterfacesReadParams) WithHTTPClient(client *http.Client) *VirtualizationInterfacesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization interfaces read params +func (o *VirtualizationInterfacesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization interfaces read params +func (o *VirtualizationInterfacesReadParams) WithID(id int64) *VirtualizationInterfacesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization interfaces read params +func (o *VirtualizationInterfacesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationInterfacesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_read_responses.go new file mode 100644 index 0000000..3201e07 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationInterfacesReadReader is a Reader for the VirtualizationInterfacesRead structure. +type VirtualizationInterfacesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationInterfacesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationInterfacesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationInterfacesReadOK creates a VirtualizationInterfacesReadOK with default headers values +func NewVirtualizationInterfacesReadOK() *VirtualizationInterfacesReadOK { + return &VirtualizationInterfacesReadOK{} +} + +/*VirtualizationInterfacesReadOK handles this case with default header values. + +VirtualizationInterfacesReadOK virtualization interfaces read o k +*/ +type VirtualizationInterfacesReadOK struct { + Payload *models.Interface +} + +func (o *VirtualizationInterfacesReadOK) Error() string { + return fmt.Sprintf("[GET /virtualization/interfaces/{id}/][%d] virtualizationInterfacesReadOK %+v", 200, o.Payload) +} + +func (o *VirtualizationInterfacesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Interface) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_update_parameters.go new file mode 100644 index 0000000..f9010f1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewVirtualizationInterfacesUpdateParams creates a new VirtualizationInterfacesUpdateParams object +// with the default values initialized. +func NewVirtualizationInterfacesUpdateParams() *VirtualizationInterfacesUpdateParams { + var () + return &VirtualizationInterfacesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationInterfacesUpdateParamsWithTimeout creates a new VirtualizationInterfacesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationInterfacesUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationInterfacesUpdateParams { + var () + return &VirtualizationInterfacesUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationInterfacesUpdateParamsWithContext creates a new VirtualizationInterfacesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationInterfacesUpdateParamsWithContext(ctx context.Context) *VirtualizationInterfacesUpdateParams { + var () + return &VirtualizationInterfacesUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationInterfacesUpdateParamsWithHTTPClient creates a new VirtualizationInterfacesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationInterfacesUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationInterfacesUpdateParams { + var () + return &VirtualizationInterfacesUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationInterfacesUpdateParams contains all the parameters to send to the API endpoint +for the virtualization interfaces update operation typically these are written to a http.Request +*/ +type VirtualizationInterfacesUpdateParams struct { + + /*Data*/ + Data *models.WritableInterface + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationInterfacesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) WithContext(ctx context.Context) *VirtualizationInterfacesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationInterfacesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) WithData(data *models.WritableInterface) *VirtualizationInterfacesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) SetData(data *models.WritableInterface) { + o.Data = data +} + +// WithID adds the id to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) WithID(id int64) *VirtualizationInterfacesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationInterfacesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_update_responses.go new file mode 100644 index 0000000..09f56f4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_interfaces_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationInterfacesUpdateReader is a Reader for the VirtualizationInterfacesUpdate structure. +type VirtualizationInterfacesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationInterfacesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationInterfacesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationInterfacesUpdateOK creates a VirtualizationInterfacesUpdateOK with default headers values +func NewVirtualizationInterfacesUpdateOK() *VirtualizationInterfacesUpdateOK { + return &VirtualizationInterfacesUpdateOK{} +} + +/*VirtualizationInterfacesUpdateOK handles this case with default header values. + +VirtualizationInterfacesUpdateOK virtualization interfaces update o k +*/ +type VirtualizationInterfacesUpdateOK struct { + Payload *models.WritableInterface +} + +func (o *VirtualizationInterfacesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /virtualization/interfaces/{id}/][%d] virtualizationInterfacesUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationInterfacesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterface) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_create_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_create_parameters.go new file mode 100644 index 0000000..18ca35d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_create_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewVirtualizationVirtualMachinesCreateParams creates a new VirtualizationVirtualMachinesCreateParams object +// with the default values initialized. +func NewVirtualizationVirtualMachinesCreateParams() *VirtualizationVirtualMachinesCreateParams { + var () + return &VirtualizationVirtualMachinesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationVirtualMachinesCreateParamsWithTimeout creates a new VirtualizationVirtualMachinesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationVirtualMachinesCreateParamsWithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesCreateParams { + var () + return &VirtualizationVirtualMachinesCreateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationVirtualMachinesCreateParamsWithContext creates a new VirtualizationVirtualMachinesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationVirtualMachinesCreateParamsWithContext(ctx context.Context) *VirtualizationVirtualMachinesCreateParams { + var () + return &VirtualizationVirtualMachinesCreateParams{ + + Context: ctx, + } +} + +// NewVirtualizationVirtualMachinesCreateParamsWithHTTPClient creates a new VirtualizationVirtualMachinesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationVirtualMachinesCreateParamsWithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesCreateParams { + var () + return &VirtualizationVirtualMachinesCreateParams{ + HTTPClient: client, + } +} + +/*VirtualizationVirtualMachinesCreateParams contains all the parameters to send to the API endpoint +for the virtualization virtual machines create operation typically these are written to a http.Request +*/ +type VirtualizationVirtualMachinesCreateParams struct { + + /*Data*/ + Data *models.WritableVirtualMachine + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization virtual machines create params +func (o *VirtualizationVirtualMachinesCreateParams) WithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization virtual machines create params +func (o *VirtualizationVirtualMachinesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization virtual machines create params +func (o *VirtualizationVirtualMachinesCreateParams) WithContext(ctx context.Context) *VirtualizationVirtualMachinesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization virtual machines create params +func (o *VirtualizationVirtualMachinesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization virtual machines create params +func (o *VirtualizationVirtualMachinesCreateParams) WithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization virtual machines create params +func (o *VirtualizationVirtualMachinesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization virtual machines create params +func (o *VirtualizationVirtualMachinesCreateParams) WithData(data *models.WritableVirtualMachine) *VirtualizationVirtualMachinesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization virtual machines create params +func (o *VirtualizationVirtualMachinesCreateParams) SetData(data *models.WritableVirtualMachine) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationVirtualMachinesCreateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_create_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_create_responses.go new file mode 100644 index 0000000..2098b99 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationVirtualMachinesCreateReader is a Reader for the VirtualizationVirtualMachinesCreate structure. +type VirtualizationVirtualMachinesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationVirtualMachinesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewVirtualizationVirtualMachinesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationVirtualMachinesCreateCreated creates a VirtualizationVirtualMachinesCreateCreated with default headers values +func NewVirtualizationVirtualMachinesCreateCreated() *VirtualizationVirtualMachinesCreateCreated { + return &VirtualizationVirtualMachinesCreateCreated{} +} + +/*VirtualizationVirtualMachinesCreateCreated handles this case with default header values. + +VirtualizationVirtualMachinesCreateCreated virtualization virtual machines create created +*/ +type VirtualizationVirtualMachinesCreateCreated struct { + Payload *models.WritableVirtualMachine +} + +func (o *VirtualizationVirtualMachinesCreateCreated) Error() string { + return fmt.Sprintf("[POST /virtualization/virtual-machines/][%d] virtualizationVirtualMachinesCreateCreated %+v", 201, o.Payload) +} + +func (o *VirtualizationVirtualMachinesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVirtualMachine) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_delete_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_delete_parameters.go new file mode 100644 index 0000000..b8bb7ca --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_delete_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationVirtualMachinesDeleteParams creates a new VirtualizationVirtualMachinesDeleteParams object +// with the default values initialized. +func NewVirtualizationVirtualMachinesDeleteParams() *VirtualizationVirtualMachinesDeleteParams { + var () + return &VirtualizationVirtualMachinesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationVirtualMachinesDeleteParamsWithTimeout creates a new VirtualizationVirtualMachinesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationVirtualMachinesDeleteParamsWithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesDeleteParams { + var () + return &VirtualizationVirtualMachinesDeleteParams{ + + timeout: timeout, + } +} + +// NewVirtualizationVirtualMachinesDeleteParamsWithContext creates a new VirtualizationVirtualMachinesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationVirtualMachinesDeleteParamsWithContext(ctx context.Context) *VirtualizationVirtualMachinesDeleteParams { + var () + return &VirtualizationVirtualMachinesDeleteParams{ + + Context: ctx, + } +} + +// NewVirtualizationVirtualMachinesDeleteParamsWithHTTPClient creates a new VirtualizationVirtualMachinesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationVirtualMachinesDeleteParamsWithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesDeleteParams { + var () + return &VirtualizationVirtualMachinesDeleteParams{ + HTTPClient: client, + } +} + +/*VirtualizationVirtualMachinesDeleteParams contains all the parameters to send to the API endpoint +for the virtualization virtual machines delete operation typically these are written to a http.Request +*/ +type VirtualizationVirtualMachinesDeleteParams struct { + + /*ID + A unique integer value identifying this virtual machine. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization virtual machines delete params +func (o *VirtualizationVirtualMachinesDeleteParams) WithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization virtual machines delete params +func (o *VirtualizationVirtualMachinesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization virtual machines delete params +func (o *VirtualizationVirtualMachinesDeleteParams) WithContext(ctx context.Context) *VirtualizationVirtualMachinesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization virtual machines delete params +func (o *VirtualizationVirtualMachinesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization virtual machines delete params +func (o *VirtualizationVirtualMachinesDeleteParams) WithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization virtual machines delete params +func (o *VirtualizationVirtualMachinesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization virtual machines delete params +func (o *VirtualizationVirtualMachinesDeleteParams) WithID(id int64) *VirtualizationVirtualMachinesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization virtual machines delete params +func (o *VirtualizationVirtualMachinesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationVirtualMachinesDeleteParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_delete_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_delete_responses.go new file mode 100644 index 0000000..246fce7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// VirtualizationVirtualMachinesDeleteReader is a Reader for the VirtualizationVirtualMachinesDelete structure. +type VirtualizationVirtualMachinesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationVirtualMachinesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewVirtualizationVirtualMachinesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationVirtualMachinesDeleteNoContent creates a VirtualizationVirtualMachinesDeleteNoContent with default headers values +func NewVirtualizationVirtualMachinesDeleteNoContent() *VirtualizationVirtualMachinesDeleteNoContent { + return &VirtualizationVirtualMachinesDeleteNoContent{} +} + +/*VirtualizationVirtualMachinesDeleteNoContent handles this case with default header values. + +VirtualizationVirtualMachinesDeleteNoContent virtualization virtual machines delete no content +*/ +type VirtualizationVirtualMachinesDeleteNoContent struct { +} + +func (o *VirtualizationVirtualMachinesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /virtualization/virtual-machines/{id}/][%d] virtualizationVirtualMachinesDeleteNoContent ", 204) +} + +func (o *VirtualizationVirtualMachinesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_list_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_list_parameters.go new file mode 100644 index 0000000..7330761 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_list_parameters.go @@ -0,0 +1,720 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationVirtualMachinesListParams creates a new VirtualizationVirtualMachinesListParams object +// with the default values initialized. +func NewVirtualizationVirtualMachinesListParams() *VirtualizationVirtualMachinesListParams { + var () + return &VirtualizationVirtualMachinesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationVirtualMachinesListParamsWithTimeout creates a new VirtualizationVirtualMachinesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationVirtualMachinesListParamsWithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesListParams { + var () + return &VirtualizationVirtualMachinesListParams{ + + timeout: timeout, + } +} + +// NewVirtualizationVirtualMachinesListParamsWithContext creates a new VirtualizationVirtualMachinesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationVirtualMachinesListParamsWithContext(ctx context.Context) *VirtualizationVirtualMachinesListParams { + var () + return &VirtualizationVirtualMachinesListParams{ + + Context: ctx, + } +} + +// NewVirtualizationVirtualMachinesListParamsWithHTTPClient creates a new VirtualizationVirtualMachinesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationVirtualMachinesListParamsWithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesListParams { + var () + return &VirtualizationVirtualMachinesListParams{ + HTTPClient: client, + } +} + +/*VirtualizationVirtualMachinesListParams contains all the parameters to send to the API endpoint +for the virtualization virtual machines list operation typically these are written to a http.Request +*/ +type VirtualizationVirtualMachinesListParams struct { + + /*Cluster*/ + Cluster *string + /*ClusterGroup*/ + ClusterGroup *string + /*ClusterGroupID*/ + ClusterGroupID *string + /*ClusterID*/ + ClusterID *string + /*ClusterType*/ + ClusterType *string + /*ClusterTypeID*/ + ClusterTypeID *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Platform*/ + Platform *string + /*PlatformID*/ + PlatformID *string + /*Q*/ + Q *string + /*Role*/ + Role *string + /*RoleID*/ + RoleID *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Status*/ + Status *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithContext(ctx context.Context) *VirtualizationVirtualMachinesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCluster adds the cluster to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithCluster(cluster *string) *VirtualizationVirtualMachinesListParams { + o.SetCluster(cluster) + return o +} + +// SetCluster adds the cluster to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetCluster(cluster *string) { + o.Cluster = cluster +} + +// WithClusterGroup adds the clusterGroup to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithClusterGroup(clusterGroup *string) *VirtualizationVirtualMachinesListParams { + o.SetClusterGroup(clusterGroup) + return o +} + +// SetClusterGroup adds the clusterGroup to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetClusterGroup(clusterGroup *string) { + o.ClusterGroup = clusterGroup +} + +// WithClusterGroupID adds the clusterGroupID to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithClusterGroupID(clusterGroupID *string) *VirtualizationVirtualMachinesListParams { + o.SetClusterGroupID(clusterGroupID) + return o +} + +// SetClusterGroupID adds the clusterGroupId to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetClusterGroupID(clusterGroupID *string) { + o.ClusterGroupID = clusterGroupID +} + +// WithClusterID adds the clusterID to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithClusterID(clusterID *string) *VirtualizationVirtualMachinesListParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetClusterID(clusterID *string) { + o.ClusterID = clusterID +} + +// WithClusterType adds the clusterType to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithClusterType(clusterType *string) *VirtualizationVirtualMachinesListParams { + o.SetClusterType(clusterType) + return o +} + +// SetClusterType adds the clusterType to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetClusterType(clusterType *string) { + o.ClusterType = clusterType +} + +// WithClusterTypeID adds the clusterTypeID to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithClusterTypeID(clusterTypeID *string) *VirtualizationVirtualMachinesListParams { + o.SetClusterTypeID(clusterTypeID) + return o +} + +// SetClusterTypeID adds the clusterTypeId to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetClusterTypeID(clusterTypeID *string) { + o.ClusterTypeID = clusterTypeID +} + +// WithIDIn adds the iDIn to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithIDIn(iDIn *string) *VirtualizationVirtualMachinesListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithLimit(limit *int64) *VirtualizationVirtualMachinesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithName(name *string) *VirtualizationVirtualMachinesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithOffset(offset *int64) *VirtualizationVirtualMachinesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPlatform adds the platform to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithPlatform(platform *string) *VirtualizationVirtualMachinesListParams { + o.SetPlatform(platform) + return o +} + +// SetPlatform adds the platform to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetPlatform(platform *string) { + o.Platform = platform +} + +// WithPlatformID adds the platformID to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithPlatformID(platformID *string) *VirtualizationVirtualMachinesListParams { + o.SetPlatformID(platformID) + return o +} + +// SetPlatformID adds the platformId to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetPlatformID(platformID *string) { + o.PlatformID = platformID +} + +// WithQ adds the q to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithQ(q *string) *VirtualizationVirtualMachinesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetQ(q *string) { + o.Q = q +} + +// WithRole adds the role to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithRole(role *string) *VirtualizationVirtualMachinesListParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetRole(role *string) { + o.Role = role +} + +// WithRoleID adds the roleID to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithRoleID(roleID *string) *VirtualizationVirtualMachinesListParams { + o.SetRoleID(roleID) + return o +} + +// SetRoleID adds the roleId to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetRoleID(roleID *string) { + o.RoleID = roleID +} + +// WithSite adds the site to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithSite(site *string) *VirtualizationVirtualMachinesListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithSiteID(siteID *string) *VirtualizationVirtualMachinesListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithStatus adds the status to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithStatus(status *string) *VirtualizationVirtualMachinesListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetStatus(status *string) { + o.Status = status +} + +// WithTenant adds the tenant to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithTenant(tenant *string) *VirtualizationVirtualMachinesListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithTenantID(tenantID *string) *VirtualizationVirtualMachinesListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationVirtualMachinesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cluster != nil { + + // query param cluster + var qrCluster string + if o.Cluster != nil { + qrCluster = *o.Cluster + } + qCluster := qrCluster + if qCluster != "" { + if err := r.SetQueryParam("cluster", qCluster); err != nil { + return err + } + } + + } + + if o.ClusterGroup != nil { + + // query param cluster_group + var qrClusterGroup string + if o.ClusterGroup != nil { + qrClusterGroup = *o.ClusterGroup + } + qClusterGroup := qrClusterGroup + if qClusterGroup != "" { + if err := r.SetQueryParam("cluster_group", qClusterGroup); err != nil { + return err + } + } + + } + + if o.ClusterGroupID != nil { + + // query param cluster_group_id + var qrClusterGroupID string + if o.ClusterGroupID != nil { + qrClusterGroupID = *o.ClusterGroupID + } + qClusterGroupID := qrClusterGroupID + if qClusterGroupID != "" { + if err := r.SetQueryParam("cluster_group_id", qClusterGroupID); err != nil { + return err + } + } + + } + + if o.ClusterID != nil { + + // query param cluster_id + var qrClusterID string + if o.ClusterID != nil { + qrClusterID = *o.ClusterID + } + qClusterID := qrClusterID + if qClusterID != "" { + if err := r.SetQueryParam("cluster_id", qClusterID); err != nil { + return err + } + } + + } + + if o.ClusterType != nil { + + // query param cluster_type + var qrClusterType string + if o.ClusterType != nil { + qrClusterType = *o.ClusterType + } + qClusterType := qrClusterType + if qClusterType != "" { + if err := r.SetQueryParam("cluster_type", qClusterType); err != nil { + return err + } + } + + } + + if o.ClusterTypeID != nil { + + // query param cluster_type_id + var qrClusterTypeID string + if o.ClusterTypeID != nil { + qrClusterTypeID = *o.ClusterTypeID + } + qClusterTypeID := qrClusterTypeID + if qClusterTypeID != "" { + if err := r.SetQueryParam("cluster_type_id", qClusterTypeID); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); 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.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.Platform != nil { + + // query param platform + var qrPlatform string + if o.Platform != nil { + qrPlatform = *o.Platform + } + qPlatform := qrPlatform + if qPlatform != "" { + if err := r.SetQueryParam("platform", qPlatform); err != nil { + return err + } + } + + } + + if o.PlatformID != nil { + + // query param platform_id + var qrPlatformID string + if o.PlatformID != nil { + qrPlatformID = *o.PlatformID + } + qPlatformID := qrPlatformID + if qPlatformID != "" { + if err := r.SetQueryParam("platform_id", qPlatformID); 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.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.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.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.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.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.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.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_list_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_list_responses.go new file mode 100644 index 0000000..c1793ec --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_list_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationVirtualMachinesListReader is a Reader for the VirtualizationVirtualMachinesList structure. +type VirtualizationVirtualMachinesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationVirtualMachinesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationVirtualMachinesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationVirtualMachinesListOK creates a VirtualizationVirtualMachinesListOK with default headers values +func NewVirtualizationVirtualMachinesListOK() *VirtualizationVirtualMachinesListOK { + return &VirtualizationVirtualMachinesListOK{} +} + +/*VirtualizationVirtualMachinesListOK handles this case with default header values. + +VirtualizationVirtualMachinesListOK virtualization virtual machines list o k +*/ +type VirtualizationVirtualMachinesListOK struct { + Payload *models.VirtualizationVirtualMachinesListOKBody +} + +func (o *VirtualizationVirtualMachinesListOK) Error() string { + return fmt.Sprintf("[GET /virtualization/virtual-machines/][%d] virtualizationVirtualMachinesListOK %+v", 200, o.Payload) +} + +func (o *VirtualizationVirtualMachinesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VirtualizationVirtualMachinesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_partial_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_partial_update_parameters.go new file mode 100644 index 0000000..ff186f3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_partial_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewVirtualizationVirtualMachinesPartialUpdateParams creates a new VirtualizationVirtualMachinesPartialUpdateParams object +// with the default values initialized. +func NewVirtualizationVirtualMachinesPartialUpdateParams() *VirtualizationVirtualMachinesPartialUpdateParams { + var () + return &VirtualizationVirtualMachinesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationVirtualMachinesPartialUpdateParamsWithTimeout creates a new VirtualizationVirtualMachinesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationVirtualMachinesPartialUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesPartialUpdateParams { + var () + return &VirtualizationVirtualMachinesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationVirtualMachinesPartialUpdateParamsWithContext creates a new VirtualizationVirtualMachinesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationVirtualMachinesPartialUpdateParamsWithContext(ctx context.Context) *VirtualizationVirtualMachinesPartialUpdateParams { + var () + return &VirtualizationVirtualMachinesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationVirtualMachinesPartialUpdateParamsWithHTTPClient creates a new VirtualizationVirtualMachinesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationVirtualMachinesPartialUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesPartialUpdateParams { + var () + return &VirtualizationVirtualMachinesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationVirtualMachinesPartialUpdateParams contains all the parameters to send to the API endpoint +for the virtualization virtual machines partial update operation typically these are written to a http.Request +*/ +type VirtualizationVirtualMachinesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableVirtualMachine + /*ID + A unique integer value identifying this virtual machine. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) WithContext(ctx context.Context) *VirtualizationVirtualMachinesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) WithData(data *models.WritableVirtualMachine) *VirtualizationVirtualMachinesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) SetData(data *models.WritableVirtualMachine) { + o.Data = data +} + +// WithID adds the id to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) WithID(id int64) *VirtualizationVirtualMachinesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationVirtualMachinesPartialUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_partial_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_partial_update_responses.go new file mode 100644 index 0000000..f68ed8e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationVirtualMachinesPartialUpdateReader is a Reader for the VirtualizationVirtualMachinesPartialUpdate structure. +type VirtualizationVirtualMachinesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationVirtualMachinesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationVirtualMachinesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationVirtualMachinesPartialUpdateOK creates a VirtualizationVirtualMachinesPartialUpdateOK with default headers values +func NewVirtualizationVirtualMachinesPartialUpdateOK() *VirtualizationVirtualMachinesPartialUpdateOK { + return &VirtualizationVirtualMachinesPartialUpdateOK{} +} + +/*VirtualizationVirtualMachinesPartialUpdateOK handles this case with default header values. + +VirtualizationVirtualMachinesPartialUpdateOK virtualization virtual machines partial update o k +*/ +type VirtualizationVirtualMachinesPartialUpdateOK struct { + Payload *models.WritableVirtualMachine +} + +func (o *VirtualizationVirtualMachinesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /virtualization/virtual-machines/{id}/][%d] virtualizationVirtualMachinesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationVirtualMachinesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVirtualMachine) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_read_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_read_parameters.go new file mode 100644 index 0000000..9d6888b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_read_parameters.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewVirtualizationVirtualMachinesReadParams creates a new VirtualizationVirtualMachinesReadParams object +// with the default values initialized. +func NewVirtualizationVirtualMachinesReadParams() *VirtualizationVirtualMachinesReadParams { + var () + return &VirtualizationVirtualMachinesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationVirtualMachinesReadParamsWithTimeout creates a new VirtualizationVirtualMachinesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationVirtualMachinesReadParamsWithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesReadParams { + var () + return &VirtualizationVirtualMachinesReadParams{ + + timeout: timeout, + } +} + +// NewVirtualizationVirtualMachinesReadParamsWithContext creates a new VirtualizationVirtualMachinesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationVirtualMachinesReadParamsWithContext(ctx context.Context) *VirtualizationVirtualMachinesReadParams { + var () + return &VirtualizationVirtualMachinesReadParams{ + + Context: ctx, + } +} + +// NewVirtualizationVirtualMachinesReadParamsWithHTTPClient creates a new VirtualizationVirtualMachinesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationVirtualMachinesReadParamsWithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesReadParams { + var () + return &VirtualizationVirtualMachinesReadParams{ + HTTPClient: client, + } +} + +/*VirtualizationVirtualMachinesReadParams contains all the parameters to send to the API endpoint +for the virtualization virtual machines read operation typically these are written to a http.Request +*/ +type VirtualizationVirtualMachinesReadParams struct { + + /*ID + A unique integer value identifying this virtual machine. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization virtual machines read params +func (o *VirtualizationVirtualMachinesReadParams) WithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization virtual machines read params +func (o *VirtualizationVirtualMachinesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization virtual machines read params +func (o *VirtualizationVirtualMachinesReadParams) WithContext(ctx context.Context) *VirtualizationVirtualMachinesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization virtual machines read params +func (o *VirtualizationVirtualMachinesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization virtual machines read params +func (o *VirtualizationVirtualMachinesReadParams) WithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization virtual machines read params +func (o *VirtualizationVirtualMachinesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization virtual machines read params +func (o *VirtualizationVirtualMachinesReadParams) WithID(id int64) *VirtualizationVirtualMachinesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization virtual machines read params +func (o *VirtualizationVirtualMachinesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationVirtualMachinesReadParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_read_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_read_responses.go new file mode 100644 index 0000000..3e8b2ee --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationVirtualMachinesReadReader is a Reader for the VirtualizationVirtualMachinesRead structure. +type VirtualizationVirtualMachinesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationVirtualMachinesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationVirtualMachinesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationVirtualMachinesReadOK creates a VirtualizationVirtualMachinesReadOK with default headers values +func NewVirtualizationVirtualMachinesReadOK() *VirtualizationVirtualMachinesReadOK { + return &VirtualizationVirtualMachinesReadOK{} +} + +/*VirtualizationVirtualMachinesReadOK handles this case with default header values. + +VirtualizationVirtualMachinesReadOK virtualization virtual machines read o k +*/ +type VirtualizationVirtualMachinesReadOK struct { + Payload *models.VirtualMachine +} + +func (o *VirtualizationVirtualMachinesReadOK) Error() string { + return fmt.Sprintf("[GET /virtualization/virtual-machines/{id}/][%d] virtualizationVirtualMachinesReadOK %+v", 200, o.Payload) +} + +func (o *VirtualizationVirtualMachinesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VirtualMachine) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_update_parameters.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_update_parameters.go new file mode 100644 index 0000000..1a0088b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_update_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewVirtualizationVirtualMachinesUpdateParams creates a new VirtualizationVirtualMachinesUpdateParams object +// with the default values initialized. +func NewVirtualizationVirtualMachinesUpdateParams() *VirtualizationVirtualMachinesUpdateParams { + var () + return &VirtualizationVirtualMachinesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationVirtualMachinesUpdateParamsWithTimeout creates a new VirtualizationVirtualMachinesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationVirtualMachinesUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesUpdateParams { + var () + return &VirtualizationVirtualMachinesUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationVirtualMachinesUpdateParamsWithContext creates a new VirtualizationVirtualMachinesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationVirtualMachinesUpdateParamsWithContext(ctx context.Context) *VirtualizationVirtualMachinesUpdateParams { + var () + return &VirtualizationVirtualMachinesUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationVirtualMachinesUpdateParamsWithHTTPClient creates a new VirtualizationVirtualMachinesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationVirtualMachinesUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesUpdateParams { + var () + return &VirtualizationVirtualMachinesUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationVirtualMachinesUpdateParams contains all the parameters to send to the API endpoint +for the virtualization virtual machines update operation typically these are written to a http.Request +*/ +type VirtualizationVirtualMachinesUpdateParams struct { + + /*Data*/ + Data *models.WritableVirtualMachine + /*ID + A unique integer value identifying this virtual machine. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) WithContext(ctx context.Context) *VirtualizationVirtualMachinesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) WithData(data *models.WritableVirtualMachine) *VirtualizationVirtualMachinesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) SetData(data *models.WritableVirtualMachine) { + o.Data = data +} + +// WithID adds the id to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) WithID(id int64) *VirtualizationVirtualMachinesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationVirtualMachinesUpdateParams) 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/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_update_responses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_update_responses.go new file mode 100644 index 0000000..e5abe21 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 virtualization + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/digitalocean/go-netbox/netbox/models" +) + +// VirtualizationVirtualMachinesUpdateReader is a Reader for the VirtualizationVirtualMachinesUpdate structure. +type VirtualizationVirtualMachinesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationVirtualMachinesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationVirtualMachinesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewVirtualizationVirtualMachinesUpdateOK creates a VirtualizationVirtualMachinesUpdateOK with default headers values +func NewVirtualizationVirtualMachinesUpdateOK() *VirtualizationVirtualMachinesUpdateOK { + return &VirtualizationVirtualMachinesUpdateOK{} +} + +/*VirtualizationVirtualMachinesUpdateOK handles this case with default header values. + +VirtualizationVirtualMachinesUpdateOK virtualization virtual machines update o k +*/ +type VirtualizationVirtualMachinesUpdateOK struct { + Payload *models.WritableVirtualMachine +} + +func (o *VirtualizationVirtualMachinesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /virtualization/virtual-machines/{id}/][%d] virtualizationVirtualMachinesUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationVirtualMachinesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVirtualMachine) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/aggregate.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/aggregate.go new file mode 100644 index 0000000..d0c730b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/aggregate.go @@ -0,0 +1,192 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Aggregate aggregate +// swagger:model Aggregate +type Aggregate struct { + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Date added + DateAdded strfmt.Date `json:"date_added,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Family + // Required: true + Family *int64 `json:"family"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Prefix + // Required: true + Prefix *string `json:"prefix"` + + // rir + // Required: true + Rir *NestedRIR `json:"rir"` +} + +// Validate validates this aggregate +func (m *Aggregate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFamily(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrefix(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRir(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Aggregate) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +var aggregateTypeFamilyPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[4,6]`), &res); err != nil { + panic(err) + } + for _, v := range res { + aggregateTypeFamilyPropEnum = append(aggregateTypeFamilyPropEnum, v) + } +} + +// prop value enum +func (m *Aggregate) validateFamilyEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, aggregateTypeFamilyPropEnum); err != nil { + return err + } + return nil +} + +func (m *Aggregate) validateFamily(formats strfmt.Registry) error { + + if err := validate.Required("family", "body", m.Family); err != nil { + return err + } + + // value enum + if err := m.validateFamilyEnum("family", "body", *m.Family); err != nil { + return err + } + + return nil +} + +func (m *Aggregate) validatePrefix(formats strfmt.Registry) error { + + if err := validate.Required("prefix", "body", m.Prefix); err != nil { + return err + } + + return nil +} + +func (m *Aggregate) validateRir(formats strfmt.Registry) error { + + if err := validate.Required("rir", "body", m.Rir); err != nil { + return err + } + + if m.Rir != nil { + + if err := m.Rir.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rir") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Aggregate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Aggregate) UnmarshalBinary(b []byte) error { + var res Aggregate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuit.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuit.go new file mode 100644 index 0000000..c3c5953 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuit.go @@ -0,0 +1,266 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Circuit circuit +// swagger:model Circuit +type Circuit struct { + + // Circuit ID + // Required: true + // Max Length: 50 + Cid *string `json:"cid"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Commit rate (Kbps) + // Maximum: 2.147483647e+09 + // Minimum: 0 + CommitRate *int64 `json:"commit_rate,omitempty"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Date installed + InstallDate strfmt.Date `json:"install_date,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // provider + // Required: true + Provider *NestedProvider `json:"provider"` + + // status + // Required: true + Status *CircuitStatus `json:"status"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` + + // type + // Required: true + Type *NestedCircuitType `json:"type"` +} + +// Validate validates this circuit +func (m *Circuit) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCid(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateCommitRate(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateProvider(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Circuit) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + if err := validate.MaxLength("cid", "body", string(*m.Cid), 50); err != nil { + return err + } + + return nil +} + +func (m *Circuit) validateCommitRate(formats strfmt.Registry) error { + + if swag.IsZero(m.CommitRate) { // not required + return nil + } + + if err := validate.MinimumInt("commit_rate", "body", int64(*m.CommitRate), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("commit_rate", "body", int64(*m.CommitRate), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *Circuit) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *Circuit) validateProvider(formats strfmt.Registry) error { + + if err := validate.Required("provider", "body", m.Provider); err != nil { + return err + } + + if m.Provider != nil { + + if err := m.Provider.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("provider") + } + return err + } + } + + return nil +} + +func (m *Circuit) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + if m.Status != nil { + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *Circuit) validateTenant(formats strfmt.Registry) error { + + if err := validate.Required("tenant", "body", m.Tenant); err != nil { + return err + } + + if m.Tenant != nil { + + if err := m.Tenant.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } + return err + } + } + + return nil +} + +func (m *Circuit) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if m.Type != nil { + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Circuit) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Circuit) UnmarshalBinary(b []byte) error { + var res Circuit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuit_status.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuit_status.go new file mode 100644 index 0000000..e309e96 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuit_status.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CircuitStatus Status +// swagger:model circuitStatus +type CircuitStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this circuit status +func (m *CircuitStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CircuitStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *CircuitStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CircuitStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CircuitStatus) UnmarshalBinary(b []byte) error { + var res CircuitStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuit_termination.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuit_termination.go new file mode 100644 index 0000000..264aec0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuit_termination.go @@ -0,0 +1,302 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CircuitTermination circuit termination +// swagger:model CircuitTermination +type CircuitTermination struct { + + // circuit + // Required: true + Circuit *NestedCircuit `json:"circuit"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // interface + // Required: true + Interface *Interface `json:"interface"` + + // Port speed (Kbps) + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + PortSpeed *int64 `json:"port_speed"` + + // Patch panel/port(s) + // Max Length: 100 + PpInfo string `json:"pp_info,omitempty"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // Termination + // Required: true + TermSide *string `json:"term_side"` + + // Upstream speed (Kbps) + // + // Upstream speed, if different from port speed + // Maximum: 2.147483647e+09 + // Minimum: 0 + UpstreamSpeed *int64 `json:"upstream_speed,omitempty"` + + // Cross-connect ID + // Max Length: 50 + XconnectID string `json:"xconnect_id,omitempty"` +} + +// Validate validates this circuit termination +func (m *CircuitTermination) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCircuit(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateInterface(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePortSpeed(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePpInfo(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTermSide(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUpstreamSpeed(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateXconnectID(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CircuitTermination) validateCircuit(formats strfmt.Registry) error { + + if err := validate.Required("circuit", "body", m.Circuit); err != nil { + return err + } + + if m.Circuit != nil { + + if err := m.Circuit.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("circuit") + } + return err + } + } + + return nil +} + +func (m *CircuitTermination) validateInterface(formats strfmt.Registry) error { + + if err := validate.Required("interface", "body", m.Interface); err != nil { + return err + } + + if m.Interface != nil { + + if err := m.Interface.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("interface") + } + return err + } + } + + return nil +} + +func (m *CircuitTermination) validatePortSpeed(formats strfmt.Registry) error { + + if err := validate.Required("port_speed", "body", m.PortSpeed); err != nil { + return err + } + + if err := validate.MinimumInt("port_speed", "body", int64(*m.PortSpeed), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("port_speed", "body", int64(*m.PortSpeed), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *CircuitTermination) validatePpInfo(formats strfmt.Registry) error { + + if swag.IsZero(m.PpInfo) { // not required + return nil + } + + if err := validate.MaxLength("pp_info", "body", string(m.PpInfo), 100); err != nil { + return err + } + + return nil +} + +func (m *CircuitTermination) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +var circuitTerminationTypeTermSidePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["A","Z"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + circuitTerminationTypeTermSidePropEnum = append(circuitTerminationTypeTermSidePropEnum, v) + } +} + +const ( + // CircuitTerminationTermSideA captures enum value "A" + CircuitTerminationTermSideA string = "A" + // CircuitTerminationTermSideZ captures enum value "Z" + CircuitTerminationTermSideZ string = "Z" +) + +// prop value enum +func (m *CircuitTermination) validateTermSideEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, circuitTerminationTypeTermSidePropEnum); err != nil { + return err + } + return nil +} + +func (m *CircuitTermination) validateTermSide(formats strfmt.Registry) error { + + if err := validate.Required("term_side", "body", m.TermSide); err != nil { + return err + } + + // value enum + if err := m.validateTermSideEnum("term_side", "body", *m.TermSide); err != nil { + return err + } + + return nil +} + +func (m *CircuitTermination) validateUpstreamSpeed(formats strfmt.Registry) error { + + if swag.IsZero(m.UpstreamSpeed) { // not required + return nil + } + + if err := validate.MinimumInt("upstream_speed", "body", int64(*m.UpstreamSpeed), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("upstream_speed", "body", int64(*m.UpstreamSpeed), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *CircuitTermination) validateXconnectID(formats strfmt.Registry) error { + + if swag.IsZero(m.XconnectID) { // not required + return nil + } + + if err := validate.MaxLength("xconnect_id", "body", string(m.XconnectID), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CircuitTermination) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CircuitTermination) UnmarshalBinary(b []byte) error { + var res CircuitTermination + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuit_type.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuit_type.go new file mode 100644 index 0000000..cb820ab --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuit_type.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CircuitType circuit type +// swagger:model CircuitType +type CircuitType struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this circuit type +func (m *CircuitType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CircuitType) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *CircuitType) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CircuitType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CircuitType) UnmarshalBinary(b []byte) error { + var res CircuitType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuit_terminations_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuit_terminations_list_okbody.go new file mode 100644 index 0000000..a10eb0c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuit_terminations_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CircuitsCircuitTerminationsListOKBody circuits circuit terminations list o k body +// swagger:model circuitsCircuitTerminationsListOKBody +type CircuitsCircuitTerminationsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results CircuitsCircuitTerminationsListOKBodyResults `json:"results"` +} + +// Validate validates this circuits circuit terminations list o k body +func (m *CircuitsCircuitTerminationsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CircuitsCircuitTerminationsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *CircuitsCircuitTerminationsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CircuitsCircuitTerminationsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CircuitsCircuitTerminationsListOKBody) UnmarshalBinary(b []byte) error { + var res CircuitsCircuitTerminationsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuit_terminations_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuit_terminations_list_okbody_results.go new file mode 100644 index 0000000..0c876ba --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuit_terminations_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// CircuitsCircuitTerminationsListOKBodyResults circuits circuit terminations list o k body results +// swagger:model circuitsCircuitTerminationsListOKBodyResults +type CircuitsCircuitTerminationsListOKBodyResults []*CircuitTermination + +// Validate validates this circuits circuit terminations list o k body results +func (m CircuitsCircuitTerminationsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuit_types_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuit_types_list_okbody.go new file mode 100644 index 0000000..e0fd7d1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuit_types_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CircuitsCircuitTypesListOKBody circuits circuit types list o k body +// swagger:model circuitsCircuitTypesListOKBody +type CircuitsCircuitTypesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results CircuitsCircuitTypesListOKBodyResults `json:"results"` +} + +// Validate validates this circuits circuit types list o k body +func (m *CircuitsCircuitTypesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CircuitsCircuitTypesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *CircuitsCircuitTypesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CircuitsCircuitTypesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CircuitsCircuitTypesListOKBody) UnmarshalBinary(b []byte) error { + var res CircuitsCircuitTypesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuit_types_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuit_types_list_okbody_results.go new file mode 100644 index 0000000..857830a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuit_types_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// CircuitsCircuitTypesListOKBodyResults circuits circuit types list o k body results +// swagger:model circuitsCircuitTypesListOKBodyResults +type CircuitsCircuitTypesListOKBodyResults []*CircuitType + +// Validate validates this circuits circuit types list o k body results +func (m CircuitsCircuitTypesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuits_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuits_list_okbody.go new file mode 100644 index 0000000..7e3d10c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuits_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CircuitsCircuitsListOKBody circuits circuits list o k body +// swagger:model circuitsCircuitsListOKBody +type CircuitsCircuitsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results CircuitsCircuitsListOKBodyResults `json:"results"` +} + +// Validate validates this circuits circuits list o k body +func (m *CircuitsCircuitsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CircuitsCircuitsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *CircuitsCircuitsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CircuitsCircuitsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CircuitsCircuitsListOKBody) UnmarshalBinary(b []byte) error { + var res CircuitsCircuitsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuits_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuits_list_okbody_results.go new file mode 100644 index 0000000..6033ace --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_circuits_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// CircuitsCircuitsListOKBodyResults circuits circuits list o k body results +// swagger:model circuitsCircuitsListOKBodyResults +type CircuitsCircuitsListOKBodyResults []*Circuit + +// Validate validates this circuits circuits list o k body results +func (m CircuitsCircuitsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_providers_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_providers_list_okbody.go new file mode 100644 index 0000000..d1fa3cc --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_providers_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CircuitsProvidersListOKBody circuits providers list o k body +// swagger:model circuitsProvidersListOKBody +type CircuitsProvidersListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results CircuitsProvidersListOKBodyResults `json:"results"` +} + +// Validate validates this circuits providers list o k body +func (m *CircuitsProvidersListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CircuitsProvidersListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *CircuitsProvidersListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CircuitsProvidersListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CircuitsProvidersListOKBody) UnmarshalBinary(b []byte) error { + var res CircuitsProvidersListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_providers_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_providers_list_okbody_results.go new file mode 100644 index 0000000..22d02c9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/circuits_providers_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// CircuitsProvidersListOKBodyResults circuits providers list o k body results +// swagger:model circuitsProvidersListOKBodyResults +type CircuitsProvidersListOKBodyResults []*Provider + +// Validate validates this circuits providers list o k body results +func (m CircuitsProvidersListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/cluster.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/cluster.go new file mode 100644 index 0000000..d3d4ad6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/cluster.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Cluster cluster +// swagger:model Cluster +type Cluster struct { + + // Comments + Comments string `json:"comments,omitempty"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // group + // Required: true + Group *NestedClusterGroup `json:"group"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 100 + Name *string `json:"name"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // type + // Required: true + Type *NestedClusterType `json:"type"` +} + +// Validate validates this cluster +func (m *Cluster) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateGroup(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Cluster) 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") + } + return err + } + } + + return nil +} + +func (m *Cluster) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { + return err + } + + return nil +} + +func (m *Cluster) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *Cluster) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if m.Type != nil { + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Cluster) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Cluster) UnmarshalBinary(b []byte) error { + var res Cluster + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/cluster_group.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/cluster_group.go new file mode 100644 index 0000000..917d539 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/cluster_group.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ClusterGroup cluster group +// swagger:model ClusterGroup +type ClusterGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this cluster group +func (m *ClusterGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ClusterGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *ClusterGroup) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ClusterGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ClusterGroup) UnmarshalBinary(b []byte) error { + var res ClusterGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/cluster_type.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/cluster_type.go new file mode 100644 index 0000000..7cf330b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/cluster_type.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ClusterType cluster type +// swagger:model ClusterType +type ClusterType struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this cluster type +func (m *ClusterType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ClusterType) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *ClusterType) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ClusterType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ClusterType) UnmarshalBinary(b []byte) error { + var res ClusterType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/console_port.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/console_port.go new file mode 100644 index 0000000..0646b44 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/console_port.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ConsolePort console port +// swagger:model ConsolePort +type ConsolePort struct { + + // Connection status + ConnectionStatus bool `json:"connection_status,omitempty"` + + // cs port + // Required: true + CsPort *ConsoleServerPort `json:"cs_port"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this console port +func (m *ConsolePort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConnectionStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateCsPort(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var consolePortTypeConnectionStatusPropEnum []interface{} + +func init() { + var res []bool + if err := json.Unmarshal([]byte(`[false,true]`), &res); err != nil { + panic(err) + } + for _, v := range res { + consolePortTypeConnectionStatusPropEnum = append(consolePortTypeConnectionStatusPropEnum, v) + } +} + +// prop value enum +func (m *ConsolePort) validateConnectionStatusEnum(path, location string, value bool) error { + if err := validate.Enum(path, location, value, consolePortTypeConnectionStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *ConsolePort) validateConnectionStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.ConnectionStatus) { // not required + return nil + } + + // value enum + if err := m.validateConnectionStatusEnum("connection_status", "body", m.ConnectionStatus); err != nil { + return err + } + + return nil +} + +func (m *ConsolePort) validateCsPort(formats strfmt.Registry) error { + + if err := validate.Required("cs_port", "body", m.CsPort); err != nil { + return err + } + + if m.CsPort != nil { + + if err := m.CsPort.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cs_port") + } + return err + } + } + + return nil +} + +func (m *ConsolePort) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *ConsolePort) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ConsolePort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ConsolePort) UnmarshalBinary(b []byte) error { + var res ConsolePort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/console_port_template.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/console_port_template.go new file mode 100644 index 0000000..3c623ac --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/console_port_template.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ConsolePortTemplate console port template +// swagger:model ConsolePortTemplate +type ConsolePortTemplate struct { + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this console port template +func (m *ConsolePortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConsolePortTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *ConsolePortTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ConsolePortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ConsolePortTemplate) UnmarshalBinary(b []byte) error { + var res ConsolePortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/console_server_port.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/console_server_port.go new file mode 100644 index 0000000..8ce6dc1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/console_server_port.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ConsoleServerPort Cs port +// swagger:model ConsoleServerPort +type ConsoleServerPort struct { + + // Connected console + // Read Only: true + ConnectedConsole string `json:"connected_console,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this console server port +func (m *ConsoleServerPort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConsoleServerPort) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *ConsoleServerPort) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ConsoleServerPort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ConsoleServerPort) UnmarshalBinary(b []byte) error { + var res ConsoleServerPort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/console_server_port_template.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/console_server_port_template.go new file mode 100644 index 0000000..f10cb09 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/console_server_port_template.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ConsoleServerPortTemplate console server port template +// swagger:model ConsoleServerPortTemplate +type ConsoleServerPortTemplate struct { + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this console server port template +func (m *ConsoleServerPortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConsoleServerPortTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *ConsoleServerPortTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ConsoleServerPortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ConsoleServerPortTemplate) UnmarshalBinary(b []byte) error { + var res ConsoleServerPortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_connections_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_connections_list_okbody.go new file mode 100644 index 0000000..cf16ad8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_connections_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimConsoleConnectionsListOKBody dcim console connections list o k body +// swagger:model dcimConsoleConnectionsListOKBody +type DcimConsoleConnectionsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimConsoleConnectionsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim console connections list o k body +func (m *DcimConsoleConnectionsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimConsoleConnectionsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimConsoleConnectionsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimConsoleConnectionsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimConsoleConnectionsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimConsoleConnectionsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_connections_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_connections_list_okbody_results.go new file mode 100644 index 0000000..fb6e026 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_connections_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimConsoleConnectionsListOKBodyResults dcim console connections list o k body results +// swagger:model dcimConsoleConnectionsListOKBodyResults +type DcimConsoleConnectionsListOKBodyResults []*ConsolePort + +// Validate validates this dcim console connections list o k body results +func (m DcimConsoleConnectionsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_port_templates_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_port_templates_list_okbody.go new file mode 100644 index 0000000..4e01c12 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_port_templates_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimConsolePortTemplatesListOKBody dcim console port templates list o k body +// swagger:model dcimConsolePortTemplatesListOKBody +type DcimConsolePortTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimConsolePortTemplatesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim console port templates list o k body +func (m *DcimConsolePortTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimConsolePortTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimConsolePortTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimConsolePortTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimConsolePortTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimConsolePortTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_port_templates_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_port_templates_list_okbody_results.go new file mode 100644 index 0000000..cdee33b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_port_templates_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimConsolePortTemplatesListOKBodyResults dcim console port templates list o k body results +// swagger:model dcimConsolePortTemplatesListOKBodyResults +type DcimConsolePortTemplatesListOKBodyResults []*ConsolePortTemplate + +// Validate validates this dcim console port templates list o k body results +func (m DcimConsolePortTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_ports_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_ports_list_okbody.go new file mode 100644 index 0000000..1a9065d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_ports_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimConsolePortsListOKBody dcim console ports list o k body +// swagger:model dcimConsolePortsListOKBody +type DcimConsolePortsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimConsolePortsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim console ports list o k body +func (m *DcimConsolePortsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimConsolePortsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimConsolePortsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimConsolePortsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimConsolePortsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimConsolePortsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_ports_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_ports_list_okbody_results.go new file mode 100644 index 0000000..d7fcd4a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_ports_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimConsolePortsListOKBodyResults dcim console ports list o k body results +// swagger:model dcimConsolePortsListOKBodyResults +type DcimConsolePortsListOKBodyResults []*ConsolePort + +// Validate validates this dcim console ports list o k body results +func (m DcimConsolePortsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_server_port_templates_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_server_port_templates_list_okbody.go new file mode 100644 index 0000000..1b0b571 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_server_port_templates_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimConsoleServerPortTemplatesListOKBody dcim console server port templates list o k body +// swagger:model dcimConsoleServerPortTemplatesListOKBody +type DcimConsoleServerPortTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimConsoleServerPortTemplatesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim console server port templates list o k body +func (m *DcimConsoleServerPortTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimConsoleServerPortTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimConsoleServerPortTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimConsoleServerPortTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimConsoleServerPortTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimConsoleServerPortTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_server_port_templates_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_server_port_templates_list_okbody_results.go new file mode 100644 index 0000000..406849d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_server_port_templates_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimConsoleServerPortTemplatesListOKBodyResults dcim console server port templates list o k body results +// swagger:model dcimConsoleServerPortTemplatesListOKBodyResults +type DcimConsoleServerPortTemplatesListOKBodyResults []*ConsoleServerPortTemplate + +// Validate validates this dcim console server port templates list o k body results +func (m DcimConsoleServerPortTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_server_ports_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_server_ports_list_okbody.go new file mode 100644 index 0000000..2071f35 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_server_ports_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimConsoleServerPortsListOKBody dcim console server ports list o k body +// swagger:model dcimConsoleServerPortsListOKBody +type DcimConsoleServerPortsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimConsoleServerPortsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim console server ports list o k body +func (m *DcimConsoleServerPortsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimConsoleServerPortsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimConsoleServerPortsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimConsoleServerPortsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimConsoleServerPortsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimConsoleServerPortsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_server_ports_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_server_ports_list_okbody_results.go new file mode 100644 index 0000000..ab2dd1c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_console_server_ports_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimConsoleServerPortsListOKBodyResults dcim console server ports list o k body results +// swagger:model dcimConsoleServerPortsListOKBodyResults +type DcimConsoleServerPortsListOKBodyResults []*ConsoleServerPort + +// Validate validates this dcim console server ports list o k body results +func (m DcimConsoleServerPortsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_bay_templates_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_bay_templates_list_okbody.go new file mode 100644 index 0000000..8a33f6c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_bay_templates_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimDeviceBayTemplatesListOKBody dcim device bay templates list o k body +// swagger:model dcimDeviceBayTemplatesListOKBody +type DcimDeviceBayTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimDeviceBayTemplatesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim device bay templates list o k body +func (m *DcimDeviceBayTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimDeviceBayTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimDeviceBayTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimDeviceBayTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimDeviceBayTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimDeviceBayTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_bay_templates_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_bay_templates_list_okbody_results.go new file mode 100644 index 0000000..ed0287b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_bay_templates_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimDeviceBayTemplatesListOKBodyResults dcim device bay templates list o k body results +// swagger:model dcimDeviceBayTemplatesListOKBodyResults +type DcimDeviceBayTemplatesListOKBodyResults []*DeviceBayTemplate + +// Validate validates this dcim device bay templates list o k body results +func (m DcimDeviceBayTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_bays_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_bays_list_okbody.go new file mode 100644 index 0000000..8227102 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_bays_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimDeviceBaysListOKBody dcim device bays list o k body +// swagger:model dcimDeviceBaysListOKBody +type DcimDeviceBaysListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimDeviceBaysListOKBodyResults `json:"results"` +} + +// Validate validates this dcim device bays list o k body +func (m *DcimDeviceBaysListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimDeviceBaysListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimDeviceBaysListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimDeviceBaysListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimDeviceBaysListOKBody) UnmarshalBinary(b []byte) error { + var res DcimDeviceBaysListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_bays_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_bays_list_okbody_results.go new file mode 100644 index 0000000..15655a1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_bays_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimDeviceBaysListOKBodyResults dcim device bays list o k body results +// swagger:model dcimDeviceBaysListOKBodyResults +type DcimDeviceBaysListOKBodyResults []*DeviceBay + +// Validate validates this dcim device bays list o k body results +func (m DcimDeviceBaysListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_roles_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_roles_list_okbody.go new file mode 100644 index 0000000..1ebd30d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_roles_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimDeviceRolesListOKBody dcim device roles list o k body +// swagger:model dcimDeviceRolesListOKBody +type DcimDeviceRolesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimDeviceRolesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim device roles list o k body +func (m *DcimDeviceRolesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimDeviceRolesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimDeviceRolesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimDeviceRolesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimDeviceRolesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimDeviceRolesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_roles_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_roles_list_okbody_results.go new file mode 100644 index 0000000..a5f50a5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_roles_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimDeviceRolesListOKBodyResults dcim device roles list o k body results +// swagger:model dcimDeviceRolesListOKBodyResults +type DcimDeviceRolesListOKBodyResults []*DeviceRole + +// Validate validates this dcim device roles list o k body results +func (m DcimDeviceRolesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_types_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_types_list_okbody.go new file mode 100644 index 0000000..24e86cc --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_types_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimDeviceTypesListOKBody dcim device types list o k body +// swagger:model dcimDeviceTypesListOKBody +type DcimDeviceTypesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimDeviceTypesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim device types list o k body +func (m *DcimDeviceTypesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimDeviceTypesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimDeviceTypesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimDeviceTypesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimDeviceTypesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimDeviceTypesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_types_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_types_list_okbody_results.go new file mode 100644 index 0000000..08343bd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_device_types_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimDeviceTypesListOKBodyResults dcim device types list o k body results +// swagger:model dcimDeviceTypesListOKBodyResults +type DcimDeviceTypesListOKBodyResults []*DeviceType + +// Validate validates this dcim device types list o k body results +func (m DcimDeviceTypesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_devices_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_devices_list_okbody.go new file mode 100644 index 0000000..068262b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_devices_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimDevicesListOKBody dcim devices list o k body +// swagger:model dcimDevicesListOKBody +type DcimDevicesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimDevicesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim devices list o k body +func (m *DcimDevicesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimDevicesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimDevicesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimDevicesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimDevicesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimDevicesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_devices_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_devices_list_okbody_results.go new file mode 100644 index 0000000..eddebb2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_devices_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimDevicesListOKBodyResults dcim devices list o k body results +// swagger:model dcimDevicesListOKBodyResults +type DcimDevicesListOKBodyResults []*Device + +// Validate validates this dcim devices list o k body results +func (m DcimDevicesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interface_connections_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interface_connections_list_okbody.go new file mode 100644 index 0000000..34437c3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interface_connections_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimInterfaceConnectionsListOKBody dcim interface connections list o k body +// swagger:model dcimInterfaceConnectionsListOKBody +type DcimInterfaceConnectionsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimInterfaceConnectionsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim interface connections list o k body +func (m *DcimInterfaceConnectionsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimInterfaceConnectionsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimInterfaceConnectionsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimInterfaceConnectionsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimInterfaceConnectionsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimInterfaceConnectionsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interface_connections_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interface_connections_list_okbody_results.go new file mode 100644 index 0000000..afba2ef --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interface_connections_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimInterfaceConnectionsListOKBodyResults dcim interface connections list o k body results +// swagger:model dcimInterfaceConnectionsListOKBodyResults +type DcimInterfaceConnectionsListOKBodyResults []*InterfaceConnection + +// Validate validates this dcim interface connections list o k body results +func (m DcimInterfaceConnectionsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interface_templates_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interface_templates_list_okbody.go new file mode 100644 index 0000000..32f05ee --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interface_templates_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimInterfaceTemplatesListOKBody dcim interface templates list o k body +// swagger:model dcimInterfaceTemplatesListOKBody +type DcimInterfaceTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimInterfaceTemplatesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim interface templates list o k body +func (m *DcimInterfaceTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimInterfaceTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimInterfaceTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimInterfaceTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimInterfaceTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimInterfaceTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interface_templates_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interface_templates_list_okbody_results.go new file mode 100644 index 0000000..7964a72 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interface_templates_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimInterfaceTemplatesListOKBodyResults dcim interface templates list o k body results +// swagger:model dcimInterfaceTemplatesListOKBodyResults +type DcimInterfaceTemplatesListOKBodyResults []*InterfaceTemplate + +// Validate validates this dcim interface templates list o k body results +func (m DcimInterfaceTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interfaces_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interfaces_list_okbody.go new file mode 100644 index 0000000..fea5146 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interfaces_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimInterfacesListOKBody dcim interfaces list o k body +// swagger:model dcimInterfacesListOKBody +type DcimInterfacesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimInterfacesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim interfaces list o k body +func (m *DcimInterfacesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimInterfacesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimInterfacesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimInterfacesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimInterfacesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimInterfacesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interfaces_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interfaces_list_okbody_results.go new file mode 100644 index 0000000..de0818f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_interfaces_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimInterfacesListOKBodyResults dcim interfaces list o k body results +// swagger:model dcimInterfacesListOKBodyResults +type DcimInterfacesListOKBodyResults []*Interface + +// Validate validates this dcim interfaces list o k body results +func (m DcimInterfacesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_inventory_items_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_inventory_items_list_okbody.go new file mode 100644 index 0000000..fbb7037 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_inventory_items_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimInventoryItemsListOKBody dcim inventory items list o k body +// swagger:model dcimInventoryItemsListOKBody +type DcimInventoryItemsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimInventoryItemsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim inventory items list o k body +func (m *DcimInventoryItemsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimInventoryItemsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimInventoryItemsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimInventoryItemsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimInventoryItemsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimInventoryItemsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_inventory_items_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_inventory_items_list_okbody_results.go new file mode 100644 index 0000000..606ff82 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_inventory_items_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimInventoryItemsListOKBodyResults dcim inventory items list o k body results +// swagger:model dcimInventoryItemsListOKBodyResults +type DcimInventoryItemsListOKBodyResults []*InventoryItem + +// Validate validates this dcim inventory items list o k body results +func (m DcimInventoryItemsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_manufacturers_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_manufacturers_list_okbody.go new file mode 100644 index 0000000..887f493 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_manufacturers_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimManufacturersListOKBody dcim manufacturers list o k body +// swagger:model dcimManufacturersListOKBody +type DcimManufacturersListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimManufacturersListOKBodyResults `json:"results"` +} + +// Validate validates this dcim manufacturers list o k body +func (m *DcimManufacturersListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimManufacturersListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimManufacturersListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimManufacturersListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimManufacturersListOKBody) UnmarshalBinary(b []byte) error { + var res DcimManufacturersListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_manufacturers_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_manufacturers_list_okbody_results.go new file mode 100644 index 0000000..e780b03 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_manufacturers_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimManufacturersListOKBodyResults dcim manufacturers list o k body results +// swagger:model dcimManufacturersListOKBodyResults +type DcimManufacturersListOKBodyResults []*Manufacturer + +// Validate validates this dcim manufacturers list o k body results +func (m DcimManufacturersListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_platforms_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_platforms_list_okbody.go new file mode 100644 index 0000000..b36ae49 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_platforms_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimPlatformsListOKBody dcim platforms list o k body +// swagger:model dcimPlatformsListOKBody +type DcimPlatformsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimPlatformsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim platforms list o k body +func (m *DcimPlatformsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimPlatformsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimPlatformsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimPlatformsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimPlatformsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPlatformsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_platforms_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_platforms_list_okbody_results.go new file mode 100644 index 0000000..4ae6d12 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_platforms_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimPlatformsListOKBodyResults dcim platforms list o k body results +// swagger:model dcimPlatformsListOKBodyResults +type DcimPlatformsListOKBodyResults []*Platform + +// Validate validates this dcim platforms list o k body results +func (m DcimPlatformsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_connections_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_connections_list_okbody.go new file mode 100644 index 0000000..b6b0dd6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_connections_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimPowerConnectionsListOKBody dcim power connections list o k body +// swagger:model dcimPowerConnectionsListOKBody +type DcimPowerConnectionsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimPowerConnectionsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim power connections list o k body +func (m *DcimPowerConnectionsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimPowerConnectionsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimPowerConnectionsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimPowerConnectionsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimPowerConnectionsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerConnectionsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_connections_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_connections_list_okbody_results.go new file mode 100644 index 0000000..6fb485c --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_connections_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimPowerConnectionsListOKBodyResults dcim power connections list o k body results +// swagger:model dcimPowerConnectionsListOKBodyResults +type DcimPowerConnectionsListOKBodyResults []*PowerPort + +// Validate validates this dcim power connections list o k body results +func (m DcimPowerConnectionsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_outlet_templates_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_outlet_templates_list_okbody.go new file mode 100644 index 0000000..5401da8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_outlet_templates_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimPowerOutletTemplatesListOKBody dcim power outlet templates list o k body +// swagger:model dcimPowerOutletTemplatesListOKBody +type DcimPowerOutletTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimPowerOutletTemplatesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim power outlet templates list o k body +func (m *DcimPowerOutletTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimPowerOutletTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimPowerOutletTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimPowerOutletTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimPowerOutletTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerOutletTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_outlet_templates_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_outlet_templates_list_okbody_results.go new file mode 100644 index 0000000..79074c1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_outlet_templates_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimPowerOutletTemplatesListOKBodyResults dcim power outlet templates list o k body results +// swagger:model dcimPowerOutletTemplatesListOKBodyResults +type DcimPowerOutletTemplatesListOKBodyResults []*PowerOutletTemplate + +// Validate validates this dcim power outlet templates list o k body results +func (m DcimPowerOutletTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_outlets_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_outlets_list_okbody.go new file mode 100644 index 0000000..9cc35d1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_outlets_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimPowerOutletsListOKBody dcim power outlets list o k body +// swagger:model dcimPowerOutletsListOKBody +type DcimPowerOutletsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimPowerOutletsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim power outlets list o k body +func (m *DcimPowerOutletsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimPowerOutletsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimPowerOutletsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimPowerOutletsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimPowerOutletsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerOutletsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_outlets_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_outlets_list_okbody_results.go new file mode 100644 index 0000000..5e7299e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_outlets_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimPowerOutletsListOKBodyResults dcim power outlets list o k body results +// swagger:model dcimPowerOutletsListOKBodyResults +type DcimPowerOutletsListOKBodyResults []*PowerOutlet + +// Validate validates this dcim power outlets list o k body results +func (m DcimPowerOutletsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_port_templates_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_port_templates_list_okbody.go new file mode 100644 index 0000000..9681270 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_port_templates_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimPowerPortTemplatesListOKBody dcim power port templates list o k body +// swagger:model dcimPowerPortTemplatesListOKBody +type DcimPowerPortTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimPowerPortTemplatesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim power port templates list o k body +func (m *DcimPowerPortTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimPowerPortTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimPowerPortTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimPowerPortTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimPowerPortTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerPortTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_port_templates_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_port_templates_list_okbody_results.go new file mode 100644 index 0000000..9363353 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_port_templates_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimPowerPortTemplatesListOKBodyResults dcim power port templates list o k body results +// swagger:model dcimPowerPortTemplatesListOKBodyResults +type DcimPowerPortTemplatesListOKBodyResults []*PowerPortTemplate + +// Validate validates this dcim power port templates list o k body results +func (m DcimPowerPortTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_ports_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_ports_list_okbody.go new file mode 100644 index 0000000..e435e12 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_ports_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimPowerPortsListOKBody dcim power ports list o k body +// swagger:model dcimPowerPortsListOKBody +type DcimPowerPortsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimPowerPortsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim power ports list o k body +func (m *DcimPowerPortsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimPowerPortsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimPowerPortsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimPowerPortsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimPowerPortsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerPortsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_ports_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_ports_list_okbody_results.go new file mode 100644 index 0000000..1162134 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_power_ports_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimPowerPortsListOKBodyResults dcim power ports list o k body results +// swagger:model dcimPowerPortsListOKBodyResults +type DcimPowerPortsListOKBodyResults []*PowerPort + +// Validate validates this dcim power ports list o k body results +func (m DcimPowerPortsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_groups_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_groups_list_okbody.go new file mode 100644 index 0000000..9ef16d6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_groups_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimRackGroupsListOKBody dcim rack groups list o k body +// swagger:model dcimRackGroupsListOKBody +type DcimRackGroupsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimRackGroupsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim rack groups list o k body +func (m *DcimRackGroupsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimRackGroupsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimRackGroupsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimRackGroupsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimRackGroupsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRackGroupsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_groups_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_groups_list_okbody_results.go new file mode 100644 index 0000000..50967e1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_groups_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimRackGroupsListOKBodyResults dcim rack groups list o k body results +// swagger:model dcimRackGroupsListOKBodyResults +type DcimRackGroupsListOKBodyResults []*RackGroup + +// Validate validates this dcim rack groups list o k body results +func (m DcimRackGroupsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_reservations_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_reservations_list_okbody.go new file mode 100644 index 0000000..4b5d7d7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_reservations_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimRackReservationsListOKBody dcim rack reservations list o k body +// swagger:model dcimRackReservationsListOKBody +type DcimRackReservationsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimRackReservationsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim rack reservations list o k body +func (m *DcimRackReservationsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimRackReservationsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimRackReservationsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimRackReservationsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimRackReservationsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRackReservationsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_reservations_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_reservations_list_okbody_results.go new file mode 100644 index 0000000..8e8a4d1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_reservations_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimRackReservationsListOKBodyResults dcim rack reservations list o k body results +// swagger:model dcimRackReservationsListOKBodyResults +type DcimRackReservationsListOKBodyResults []*RackReservation + +// Validate validates this dcim rack reservations list o k body results +func (m DcimRackReservationsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_roles_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_roles_list_okbody.go new file mode 100644 index 0000000..c357233 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_roles_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimRackRolesListOKBody dcim rack roles list o k body +// swagger:model dcimRackRolesListOKBody +type DcimRackRolesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimRackRolesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim rack roles list o k body +func (m *DcimRackRolesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimRackRolesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimRackRolesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimRackRolesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimRackRolesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRackRolesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_roles_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_roles_list_okbody_results.go new file mode 100644 index 0000000..f594fe6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_rack_roles_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimRackRolesListOKBodyResults dcim rack roles list o k body results +// swagger:model dcimRackRolesListOKBodyResults +type DcimRackRolesListOKBodyResults []*RackRole + +// Validate validates this dcim rack roles list o k body results +func (m DcimRackRolesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_racks_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_racks_list_okbody.go new file mode 100644 index 0000000..96cd252 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_racks_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimRacksListOKBody dcim racks list o k body +// swagger:model dcimRacksListOKBody +type DcimRacksListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimRacksListOKBodyResults `json:"results"` +} + +// Validate validates this dcim racks list o k body +func (m *DcimRacksListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimRacksListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimRacksListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimRacksListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimRacksListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRacksListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_racks_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_racks_list_okbody_results.go new file mode 100644 index 0000000..cc7d7b8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_racks_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimRacksListOKBodyResults dcim racks list o k body results +// swagger:model dcimRacksListOKBodyResults +type DcimRacksListOKBodyResults []*Rack + +// Validate validates this dcim racks list o k body results +func (m DcimRacksListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_regions_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_regions_list_okbody.go new file mode 100644 index 0000000..31ee20b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_regions_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimRegionsListOKBody dcim regions list o k body +// swagger:model dcimRegionsListOKBody +type DcimRegionsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimRegionsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim regions list o k body +func (m *DcimRegionsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimRegionsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimRegionsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimRegionsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimRegionsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRegionsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_regions_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_regions_list_okbody_results.go new file mode 100644 index 0000000..1514014 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_regions_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimRegionsListOKBodyResults dcim regions list o k body results +// swagger:model dcimRegionsListOKBodyResults +type DcimRegionsListOKBodyResults []*Region + +// Validate validates this dcim regions list o k body results +func (m DcimRegionsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_sites_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_sites_list_okbody.go new file mode 100644 index 0000000..4747a37 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_sites_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimSitesListOKBody dcim sites list o k body +// swagger:model dcimSitesListOKBody +type DcimSitesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimSitesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim sites list o k body +func (m *DcimSitesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimSitesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimSitesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimSitesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimSitesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimSitesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_sites_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_sites_list_okbody_results.go new file mode 100644 index 0000000..837a658 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_sites_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimSitesListOKBodyResults dcim sites list o k body results +// swagger:model dcimSitesListOKBodyResults +type DcimSitesListOKBodyResults []*Site + +// Validate validates this dcim sites list o k body results +func (m DcimSitesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_virtual_chassis_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_virtual_chassis_list_okbody.go new file mode 100644 index 0000000..15c3dcf --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_virtual_chassis_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DcimVirtualChassisListOKBody dcim virtual chassis list o k body +// swagger:model dcimVirtualChassisListOKBody +type DcimVirtualChassisListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimVirtualChassisListOKBodyResults `json:"results"` +} + +// Validate validates this dcim virtual chassis list o k body +func (m *DcimVirtualChassisListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimVirtualChassisListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimVirtualChassisListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimVirtualChassisListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimVirtualChassisListOKBody) UnmarshalBinary(b []byte) error { + var res DcimVirtualChassisListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_virtual_chassis_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_virtual_chassis_list_okbody_results.go new file mode 100644 index 0000000..c93a342 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/dcim_virtual_chassis_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// DcimVirtualChassisListOKBodyResults dcim virtual chassis list o k body results +// swagger:model dcimVirtualChassisListOKBodyResults +type DcimVirtualChassisListOKBodyResults []*VirtualChassis + +// Validate validates this dcim virtual chassis list o k body results +func (m DcimVirtualChassisListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device.go new file mode 100644 index 0000000..5b4486a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device.go @@ -0,0 +1,604 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Device device +// swagger:model Device +type Device struct { + + // Asset tag + // + // A unique tag used to identify this device + // Max Length: 50 + AssetTag string `json:"asset_tag,omitempty"` + + // cluster + // Required: true + Cluster *NestedCluster `json:"cluster"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // device role + // Required: true + DeviceRole *NestedDeviceRole `json:"device_role"` + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + + // face + // Required: true + Face *DeviceFace `json:"face"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Max Length: 64 + Name string `json:"name,omitempty"` + + // Parent device + // Read Only: true + ParentDevice string `json:"parent_device,omitempty"` + + // platform + // Required: true + Platform *NestedPlatform `json:"platform"` + + // Position (U) + // + // The lowest-numbered unit occupied by the device + // Required: true + // Maximum: 32767 + // Minimum: 1 + Position *int64 `json:"position"` + + // primary ip + // Required: true + PrimaryIP *DeviceIPAddress `json:"primary_ip"` + + // primary ip4 + // Required: true + PrimaryIp4 *DeviceIPAddress `json:"primary_ip4"` + + // primary ip6 + // Required: true + PrimaryIp6 *DeviceIPAddress `json:"primary_ip6"` + + // rack + // Required: true + Rack *NestedRack `json:"rack"` + + // Serial number + // Max Length: 50 + Serial string `json:"serial,omitempty"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // status + // Required: true + Status *DeviceStatus `json:"status"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` + + // Vc position + // Required: true + // Maximum: 255 + // Minimum: 0 + VcPosition *int64 `json:"vc_position"` + + // Vc priority + // Maximum: 255 + // Minimum: 0 + VcPriority *int64 `json:"vc_priority,omitempty"` + + // virtual chassis + // Required: true + VirtualChassis *DeviceVirtualChassis `json:"virtual_chassis"` +} + +// Validate validates this device +func (m *Device) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssetTag(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateCluster(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDeviceRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFace(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePlatform(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePosition(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrimaryIP(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrimaryIp4(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrimaryIp6(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRack(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSerial(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVcPosition(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVcPriority(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVirtualChassis(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Device) validateAssetTag(formats strfmt.Registry) error { + + if swag.IsZero(m.AssetTag) { // not required + return nil + } + + if err := validate.MaxLength("asset_tag", "body", string(m.AssetTag), 50); err != nil { + return err + } + + return nil +} + +func (m *Device) validateCluster(formats strfmt.Registry) error { + + if err := validate.Required("cluster", "body", m.Cluster); err != nil { + return err + } + + if m.Cluster != nil { + + if err := m.Cluster.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster") + } + return err + } + } + + return nil +} + +func (m *Device) validateDeviceRole(formats strfmt.Registry) error { + + if err := validate.Required("device_role", "body", m.DeviceRole); err != nil { + return err + } + + if m.DeviceRole != nil { + + if err := m.DeviceRole.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_role") + } + return err + } + } + + return nil +} + +func (m *Device) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *Device) validateFace(formats strfmt.Registry) error { + + if err := validate.Required("face", "body", m.Face); err != nil { + return err + } + + if m.Face != nil { + + if err := m.Face.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("face") + } + return err + } + } + + return nil +} + +func (m *Device) validateName(formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := validate.MaxLength("name", "body", string(m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *Device) validatePlatform(formats strfmt.Registry) error { + + if err := validate.Required("platform", "body", m.Platform); err != nil { + return err + } + + if m.Platform != nil { + + if err := m.Platform.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("platform") + } + return err + } + } + + return nil +} + +func (m *Device) validatePosition(formats strfmt.Registry) error { + + if err := validate.Required("position", "body", m.Position); err != nil { + return err + } + + if err := validate.MinimumInt("position", "body", int64(*m.Position), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("position", "body", int64(*m.Position), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *Device) validatePrimaryIP(formats strfmt.Registry) error { + + if err := validate.Required("primary_ip", "body", m.PrimaryIP); err != nil { + return err + } + + if m.PrimaryIP != nil { + + if err := m.PrimaryIP.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("primary_ip") + } + return err + } + } + + return nil +} + +func (m *Device) validatePrimaryIp4(formats strfmt.Registry) error { + + if err := validate.Required("primary_ip4", "body", m.PrimaryIp4); err != nil { + return err + } + + if m.PrimaryIp4 != nil { + + if err := m.PrimaryIp4.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("primary_ip4") + } + return err + } + } + + return nil +} + +func (m *Device) validatePrimaryIp6(formats strfmt.Registry) error { + + if err := validate.Required("primary_ip6", "body", m.PrimaryIp6); err != nil { + return err + } + + if m.PrimaryIp6 != nil { + + if err := m.PrimaryIp6.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("primary_ip6") + } + return err + } + } + + return nil +} + +func (m *Device) validateRack(formats strfmt.Registry) error { + + if err := validate.Required("rack", "body", m.Rack); err != nil { + return err + } + + if m.Rack != nil { + + if err := m.Rack.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rack") + } + return err + } + } + + return nil +} + +func (m *Device) validateSerial(formats strfmt.Registry) error { + + if swag.IsZero(m.Serial) { // not required + return nil + } + + if err := validate.MaxLength("serial", "body", string(m.Serial), 50); err != nil { + return err + } + + return nil +} + +func (m *Device) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *Device) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + if m.Status != nil { + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *Device) validateTenant(formats strfmt.Registry) error { + + if err := validate.Required("tenant", "body", m.Tenant); err != nil { + return err + } + + if m.Tenant != nil { + + if err := m.Tenant.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } + return err + } + } + + return nil +} + +func (m *Device) validateVcPosition(formats strfmt.Registry) error { + + if err := validate.Required("vc_position", "body", m.VcPosition); err != nil { + return err + } + + if err := validate.MinimumInt("vc_position", "body", int64(*m.VcPosition), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("vc_position", "body", int64(*m.VcPosition), 255, false); err != nil { + return err + } + + return nil +} + +func (m *Device) validateVcPriority(formats strfmt.Registry) error { + + if swag.IsZero(m.VcPriority) { // not required + return nil + } + + if err := validate.MinimumInt("vc_priority", "body", int64(*m.VcPriority), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("vc_priority", "body", int64(*m.VcPriority), 255, false); err != nil { + return err + } + + return nil +} + +func (m *Device) validateVirtualChassis(formats strfmt.Registry) error { + + if err := validate.Required("virtual_chassis", "body", m.VirtualChassis); err != nil { + return err + } + + if m.VirtualChassis != nil { + + if err := m.VirtualChassis.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtual_chassis") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Device) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Device) UnmarshalBinary(b []byte) error { + var res Device + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_bay.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_bay.go new file mode 100644 index 0000000..9843586 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_bay.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeviceBay device bay +// swagger:model DeviceBay +type DeviceBay struct { + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // installed device + // Required: true + InstalledDevice *NestedDevice `json:"installed_device"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this device bay +func (m *DeviceBay) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateInstalledDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceBay) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *DeviceBay) validateInstalledDevice(formats strfmt.Registry) error { + + if err := validate.Required("installed_device", "body", m.InstalledDevice); err != nil { + return err + } + + if m.InstalledDevice != nil { + + if err := m.InstalledDevice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("installed_device") + } + return err + } + } + + return nil +} + +func (m *DeviceBay) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceBay) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceBay) UnmarshalBinary(b []byte) error { + var res DeviceBay + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_bay_template.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_bay_template.go new file mode 100644 index 0000000..a88e332 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_bay_template.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeviceBayTemplate device bay template +// swagger:model DeviceBayTemplate +type DeviceBayTemplate struct { + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this device bay template +func (m *DeviceBayTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceBayTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *DeviceBayTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceBayTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceBayTemplate) UnmarshalBinary(b []byte) error { + var res DeviceBayTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_face.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_face.go new file mode 100644 index 0000000..5b87c77 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_face.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeviceFace Face +// swagger:model deviceFace +type DeviceFace struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this device face +func (m *DeviceFace) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceFace) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceFace) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceFace) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceFace) UnmarshalBinary(b []byte) error { + var res DeviceFace + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_ip_address.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_ip_address.go new file mode 100644 index 0000000..6d265fd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_ip_address.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeviceIPAddress Primary ip +// swagger:model DeviceIPAddress +type DeviceIPAddress struct { + + // Address + // + // IPv4 or IPv6 address (with mask) + // Required: true + Address *string `json:"address"` + + // Family + // Read Only: true + Family int64 `json:"family,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this device IP address +func (m *DeviceIPAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceIPAddress) validateAddress(formats strfmt.Registry) error { + + if err := validate.Required("address", "body", m.Address); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceIPAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceIPAddress) UnmarshalBinary(b []byte) error { + var res DeviceIPAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_role.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_role.go new file mode 100644 index 0000000..4413d05 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_role.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeviceRole device role +// swagger:model DeviceRole +type DeviceRole struct { + + // Color + // Required: true + // Max Length: 6 + // Pattern: ^[0-9a-f]{6}$ + Color *string `json:"color"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // VM Role + // + // Virtual machines may be assigned to this role + VMRole bool `json:"vm_role,omitempty"` +} + +// Validate validates this device role +func (m *DeviceRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateColor(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceRole) validateColor(formats strfmt.Registry) error { + + if err := validate.Required("color", "body", m.Color); err != nil { + return err + } + + if err := validate.MaxLength("color", "body", string(*m.Color), 6); err != nil { + return err + } + + if err := validate.Pattern("color", "body", string(*m.Color), `^[0-9a-f]{6}$`); err != nil { + return err + } + + return nil +} + +func (m *DeviceRole) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *DeviceRole) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceRole) UnmarshalBinary(b []byte) error { + var res DeviceRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_status.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_status.go new file mode 100644 index 0000000..cf2f5aa --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_status.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeviceStatus Status +// swagger:model deviceStatus +type DeviceStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this device status +func (m *DeviceStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceStatus) UnmarshalBinary(b []byte) error { + var res DeviceStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_type.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_type.go new file mode 100644 index 0000000..e6c167a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_type.go @@ -0,0 +1,281 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeviceType device type +// swagger:model DeviceType +type DeviceType struct { + + // Comments + Comments string `json:"comments,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Instance count + // Read Only: true + InstanceCount int64 `json:"instance_count,omitempty"` + + // interface ordering + // Required: true + InterfaceOrdering *DeviceTypeInterfaceOrdering `json:"interface_ordering"` + + // Is a console server + // + // This type of device has console server ports + IsConsoleServer bool `json:"is_console_server,omitempty"` + + // Is full depth + // + // Device consumes both front and rear rack faces + IsFullDepth bool `json:"is_full_depth,omitempty"` + + // Is a network device + // + // This type of device has network interfaces + IsNetworkDevice bool `json:"is_network_device,omitempty"` + + // Is a PDU + // + // This type of device has power outlets + IsPdu bool `json:"is_pdu,omitempty"` + + // manufacturer + // Required: true + Manufacturer *NestedManufacturer `json:"manufacturer"` + + // Model + // Required: true + // Max Length: 50 + Model *string `json:"model"` + + // Part number + // + // Discrete part number (optional) + // Max Length: 50 + PartNumber string `json:"part_number,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // subdevice role + // Required: true + SubdeviceRole *DeviceTypeSubdeviceRole `json:"subdevice_role"` + + // Height (U) + // Maximum: 32767 + // Minimum: 0 + UHeight *int64 `json:"u_height,omitempty"` +} + +// Validate validates this device type +func (m *DeviceType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateInterfaceOrdering(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateManufacturer(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateModel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePartNumber(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSubdeviceRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUHeight(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceType) validateInterfaceOrdering(formats strfmt.Registry) error { + + if err := validate.Required("interface_ordering", "body", m.InterfaceOrdering); err != nil { + return err + } + + if m.InterfaceOrdering != nil { + + if err := m.InterfaceOrdering.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("interface_ordering") + } + return err + } + } + + return nil +} + +func (m *DeviceType) validateManufacturer(formats strfmt.Registry) error { + + if err := validate.Required("manufacturer", "body", m.Manufacturer); err != nil { + return err + } + + if m.Manufacturer != nil { + + if err := m.Manufacturer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("manufacturer") + } + return err + } + } + + return nil +} + +func (m *DeviceType) validateModel(formats strfmt.Registry) error { + + if err := validate.Required("model", "body", m.Model); err != nil { + return err + } + + if err := validate.MaxLength("model", "body", string(*m.Model), 50); err != nil { + return err + } + + return nil +} + +func (m *DeviceType) validatePartNumber(formats strfmt.Registry) error { + + if swag.IsZero(m.PartNumber) { // not required + return nil + } + + if err := validate.MaxLength("part_number", "body", string(m.PartNumber), 50); err != nil { + return err + } + + return nil +} + +func (m *DeviceType) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +func (m *DeviceType) validateSubdeviceRole(formats strfmt.Registry) error { + + if err := validate.Required("subdevice_role", "body", m.SubdeviceRole); err != nil { + return err + } + + if m.SubdeviceRole != nil { + + if err := m.SubdeviceRole.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("subdevice_role") + } + return err + } + } + + return nil +} + +func (m *DeviceType) validateUHeight(formats strfmt.Registry) error { + + if swag.IsZero(m.UHeight) { // not required + return nil + } + + if err := validate.MinimumInt("u_height", "body", int64(*m.UHeight), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("u_height", "body", int64(*m.UHeight), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceType) UnmarshalBinary(b []byte) error { + var res DeviceType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_type_interface_ordering.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_type_interface_ordering.go new file mode 100644 index 0000000..cc49a40 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_type_interface_ordering.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeviceTypeInterfaceOrdering Interface ordering +// swagger:model deviceTypeInterfaceOrdering +type DeviceTypeInterfaceOrdering struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this device type interface ordering +func (m *DeviceTypeInterfaceOrdering) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceTypeInterfaceOrdering) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceTypeInterfaceOrdering) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceTypeInterfaceOrdering) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceTypeInterfaceOrdering) UnmarshalBinary(b []byte) error { + var res DeviceTypeInterfaceOrdering + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_type_subdevice_role.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_type_subdevice_role.go new file mode 100644 index 0000000..10566f9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_type_subdevice_role.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeviceTypeSubdeviceRole Subdevice role +// swagger:model deviceTypeSubdeviceRole +type DeviceTypeSubdeviceRole struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *bool `json:"value"` +} + +// Validate validates this device type subdevice role +func (m *DeviceTypeSubdeviceRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceTypeSubdeviceRole) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceTypeSubdeviceRole) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceTypeSubdeviceRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceTypeSubdeviceRole) UnmarshalBinary(b []byte) error { + var res DeviceTypeSubdeviceRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_virtual_chassis.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_virtual_chassis.go new file mode 100644 index 0000000..16b2841 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/device_virtual_chassis.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeviceVirtualChassis Virtual chassis +// swagger:model DeviceVirtualChassis +type DeviceVirtualChassis struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // master + // Required: true + Master *NestedDevice `json:"master"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this device virtual chassis +func (m *DeviceVirtualChassis) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMaster(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceVirtualChassis) validateMaster(formats strfmt.Registry) error { + + if err := validate.Required("master", "body", m.Master); err != nil { + return err + } + + if m.Master != nil { + + if err := m.Master.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("master") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceVirtualChassis) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceVirtualChassis) UnmarshalBinary(b []byte) error { + var res DeviceVirtualChassis + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/export_template.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/export_template.go new file mode 100644 index 0000000..740c074 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/export_template.go @@ -0,0 +1,190 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ExportTemplate export template +// swagger:model ExportTemplate +type ExportTemplate struct { + + // Content type + // Required: true + ContentType *int64 `json:"content_type"` + + // Description + // Max Length: 200 + Description string `json:"description,omitempty"` + + // File extension + // Max Length: 15 + FileExtension string `json:"file_extension,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Mime type + // Max Length: 15 + MimeType string `json:"mime_type,omitempty"` + + // Name + // Required: true + // Max Length: 100 + Name *string `json:"name"` + + // Template code + // Required: true + TemplateCode *string `json:"template_code"` +} + +// Validate validates this export template +func (m *ExportTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContentType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFileExtension(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateMimeType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTemplateCode(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExportTemplate) validateContentType(formats strfmt.Registry) error { + + if err := validate.Required("content_type", "body", m.ContentType); err != nil { + return err + } + + return nil +} + +func (m *ExportTemplate) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 200); err != nil { + return err + } + + return nil +} + +func (m *ExportTemplate) validateFileExtension(formats strfmt.Registry) error { + + if swag.IsZero(m.FileExtension) { // not required + return nil + } + + if err := validate.MaxLength("file_extension", "body", string(m.FileExtension), 15); err != nil { + return err + } + + return nil +} + +func (m *ExportTemplate) validateMimeType(formats strfmt.Registry) error { + + if swag.IsZero(m.MimeType) { // not required + return nil + } + + if err := validate.MaxLength("mime_type", "body", string(m.MimeType), 15); err != nil { + return err + } + + return nil +} + +func (m *ExportTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { + return err + } + + return nil +} + +func (m *ExportTemplate) validateTemplateCode(formats strfmt.Registry) error { + + if err := validate.Required("template_code", "body", m.TemplateCode); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ExportTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExportTemplate) UnmarshalBinary(b []byte) error { + var res ExportTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_export_templates_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_export_templates_list_okbody.go new file mode 100644 index 0000000..f5ba7a1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_export_templates_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ExtrasExportTemplatesListOKBody extras export templates list o k body +// swagger:model extrasExportTemplatesListOKBody +type ExtrasExportTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results ExtrasExportTemplatesListOKBodyResults `json:"results"` +} + +// Validate validates this extras export templates list o k body +func (m *ExtrasExportTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExtrasExportTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *ExtrasExportTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ExtrasExportTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExtrasExportTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasExportTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_export_templates_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_export_templates_list_okbody_results.go new file mode 100644 index 0000000..db9fad6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_export_templates_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// ExtrasExportTemplatesListOKBodyResults extras export templates list o k body results +// swagger:model extrasExportTemplatesListOKBodyResults +type ExtrasExportTemplatesListOKBodyResults []*ExportTemplate + +// Validate validates this extras export templates list o k body results +func (m ExtrasExportTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_graphs_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_graphs_list_okbody.go new file mode 100644 index 0000000..7bca5ea --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_graphs_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ExtrasGraphsListOKBody extras graphs list o k body +// swagger:model extrasGraphsListOKBody +type ExtrasGraphsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results ExtrasGraphsListOKBodyResults `json:"results"` +} + +// Validate validates this extras graphs list o k body +func (m *ExtrasGraphsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExtrasGraphsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *ExtrasGraphsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ExtrasGraphsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExtrasGraphsListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasGraphsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_graphs_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_graphs_list_okbody_results.go new file mode 100644 index 0000000..909d4a0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_graphs_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// ExtrasGraphsListOKBodyResults extras graphs list o k body results +// swagger:model extrasGraphsListOKBodyResults +type ExtrasGraphsListOKBodyResults []*Graph + +// Validate validates this extras graphs list o k body results +func (m ExtrasGraphsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_image_attachments_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_image_attachments_list_okbody.go new file mode 100644 index 0000000..6e0c278 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_image_attachments_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ExtrasImageAttachmentsListOKBody extras image attachments list o k body +// swagger:model extrasImageAttachmentsListOKBody +type ExtrasImageAttachmentsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results ExtrasImageAttachmentsListOKBodyResults `json:"results"` +} + +// Validate validates this extras image attachments list o k body +func (m *ExtrasImageAttachmentsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExtrasImageAttachmentsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *ExtrasImageAttachmentsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ExtrasImageAttachmentsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExtrasImageAttachmentsListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasImageAttachmentsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_image_attachments_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_image_attachments_list_okbody_results.go new file mode 100644 index 0000000..b40eb83 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_image_attachments_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// ExtrasImageAttachmentsListOKBodyResults extras image attachments list o k body results +// swagger:model extrasImageAttachmentsListOKBodyResults +type ExtrasImageAttachmentsListOKBodyResults []*ImageAttachment + +// Validate validates this extras image attachments list o k body results +func (m ExtrasImageAttachmentsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_recent_activity_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_recent_activity_list_okbody.go new file mode 100644 index 0000000..96eeabb --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_recent_activity_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ExtrasRecentActivityListOKBody extras recent activity list o k body +// swagger:model extrasRecentActivityListOKBody +type ExtrasRecentActivityListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results ExtrasRecentActivityListOKBodyResults `json:"results"` +} + +// Validate validates this extras recent activity list o k body +func (m *ExtrasRecentActivityListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExtrasRecentActivityListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *ExtrasRecentActivityListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ExtrasRecentActivityListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExtrasRecentActivityListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasRecentActivityListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_recent_activity_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_recent_activity_list_okbody_results.go new file mode 100644 index 0000000..2b6623f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_recent_activity_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// ExtrasRecentActivityListOKBodyResults extras recent activity list o k body results +// swagger:model extrasRecentActivityListOKBodyResults +type ExtrasRecentActivityListOKBodyResults []*UserAction + +// Validate validates this extras recent activity list o k body results +func (m ExtrasRecentActivityListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_topology_maps_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_topology_maps_list_okbody.go new file mode 100644 index 0000000..005d8d8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_topology_maps_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ExtrasTopologyMapsListOKBody extras topology maps list o k body +// swagger:model extrasTopologyMapsListOKBody +type ExtrasTopologyMapsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results ExtrasTopologyMapsListOKBodyResults `json:"results"` +} + +// Validate validates this extras topology maps list o k body +func (m *ExtrasTopologyMapsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExtrasTopologyMapsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *ExtrasTopologyMapsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ExtrasTopologyMapsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExtrasTopologyMapsListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasTopologyMapsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_topology_maps_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_topology_maps_list_okbody_results.go new file mode 100644 index 0000000..731cc66 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/extras_topology_maps_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// ExtrasTopologyMapsListOKBodyResults extras topology maps list o k body results +// swagger:model extrasTopologyMapsListOKBodyResults +type ExtrasTopologyMapsListOKBodyResults []*TopologyMap + +// Validate validates this extras topology maps list o k body results +func (m ExtrasTopologyMapsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/graph.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/graph.go new file mode 100644 index 0000000..43ca2da --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/graph.go @@ -0,0 +1,192 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Graph graph +// swagger:model Graph +type Graph struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Link URL + // Max Length: 200 + Link strfmt.URI `json:"link,omitempty"` + + // Name + // Required: true + // Max Length: 100 + Name *string `json:"name"` + + // Source URL + // Required: true + // Max Length: 500 + Source *string `json:"source"` + + // type + // Required: true + Type *GraphType `json:"type"` + + // Weight + // Maximum: 32767 + // Minimum: 0 + Weight *int64 `json:"weight,omitempty"` +} + +// Validate validates this graph +func (m *Graph) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLink(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSource(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateWeight(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Graph) validateLink(formats strfmt.Registry) error { + + if swag.IsZero(m.Link) { // not required + return nil + } + + if err := validate.MaxLength("link", "body", string(m.Link), 200); err != nil { + return err + } + + if err := validate.FormatOf("link", "body", "uri", m.Link.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Graph) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { + return err + } + + return nil +} + +func (m *Graph) validateSource(formats strfmt.Registry) error { + + if err := validate.Required("source", "body", m.Source); err != nil { + return err + } + + if err := validate.MaxLength("source", "body", string(*m.Source), 500); err != nil { + return err + } + + return nil +} + +func (m *Graph) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if m.Type != nil { + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + +func (m *Graph) validateWeight(formats strfmt.Registry) error { + + if swag.IsZero(m.Weight) { // not required + return nil + } + + if err := validate.MinimumInt("weight", "body", int64(*m.Weight), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("weight", "body", int64(*m.Weight), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Graph) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Graph) UnmarshalBinary(b []byte) error { + var res Graph + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/graph_type.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/graph_type.go new file mode 100644 index 0000000..62187fc --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/graph_type.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// GraphType Type +// swagger:model graphType +type GraphType struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this graph type +func (m *GraphType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GraphType) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *GraphType) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GraphType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GraphType) UnmarshalBinary(b []byte) error { + var res GraphType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/image_attachment.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/image_attachment.go new file mode 100644 index 0000000..0149233 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/image_attachment.go @@ -0,0 +1,174 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ImageAttachment image attachment +// swagger:model ImageAttachment +type ImageAttachment struct { + + // Created + // Read Only: true + Created strfmt.DateTime `json:"created,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Image + // Required: true + // Read Only: true + Image strfmt.URI `json:"image"` + + // Image height + // Required: true + // Maximum: 32767 + // Minimum: 0 + ImageHeight *int64 `json:"image_height"` + + // Image width + // Required: true + // Maximum: 32767 + // Minimum: 0 + ImageWidth *int64 `json:"image_width"` + + // Name + // Max Length: 50 + Name string `json:"name,omitempty"` + + // Parent + // Read Only: true + Parent string `json:"parent,omitempty"` +} + +// Validate validates this image attachment +func (m *ImageAttachment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImage(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateImageHeight(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateImageWidth(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImageAttachment) validateImage(formats strfmt.Registry) error { + + if err := validate.Required("image", "body", strfmt.URI(m.Image)); err != nil { + return err + } + + if err := validate.FormatOf("image", "body", "uri", m.Image.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ImageAttachment) validateImageHeight(formats strfmt.Registry) error { + + if err := validate.Required("image_height", "body", m.ImageHeight); err != nil { + return err + } + + if err := validate.MinimumInt("image_height", "body", int64(*m.ImageHeight), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("image_height", "body", int64(*m.ImageHeight), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *ImageAttachment) validateImageWidth(formats strfmt.Registry) error { + + if err := validate.Required("image_width", "body", m.ImageWidth); err != nil { + return err + } + + if err := validate.MinimumInt("image_width", "body", int64(*m.ImageWidth), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("image_width", "body", int64(*m.ImageWidth), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *ImageAttachment) validateName(formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ImageAttachment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImageAttachment) UnmarshalBinary(b []byte) error { + var res ImageAttachment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface.go new file mode 100644 index 0000000..e36fbb4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface.go @@ -0,0 +1,349 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Interface Interface +// swagger:model Interface +type Interface struct { + + // circuit termination + // Required: true + CircuitTermination *InterfaceCircuitTermination `json:"circuit_termination"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // Enabled + Enabled bool `json:"enabled,omitempty"` + + // form factor + // Required: true + FormFactor *InterfaceFormFactor `json:"form_factor"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Interface connection + // Read Only: true + InterfaceConnection string `json:"interface_connection,omitempty"` + + // Is connected + // Read Only: true + IsConnected string `json:"is_connected,omitempty"` + + // lag + // Required: true + Lag *NestedInterface `json:"lag"` + + // MAC Address + MacAddress string `json:"mac_address,omitempty"` + + // OOB Management + // + // This interface is used only for out-of-band management + MgmtOnly bool `json:"mgmt_only,omitempty"` + + // mode + // Required: true + Mode *InterfaceMode `json:"mode"` + + // MTU + // Maximum: 32767 + // Minimum: 0 + Mtu *int64 `json:"mtu,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // tagged vlans + // Required: true + TaggedVlans InterfaceTaggedVlans `json:"tagged_vlans"` + + // untagged vlan + // Required: true + UntaggedVlan *InterfaceVLAN `json:"untagged_vlan"` +} + +// Validate validates this interface +func (m *Interface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCircuitTermination(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFormFactor(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateLag(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateMode(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateMtu(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTaggedVlans(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUntaggedVlan(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Interface) validateCircuitTermination(formats strfmt.Registry) error { + + if err := validate.Required("circuit_termination", "body", m.CircuitTermination); err != nil { + return err + } + + if m.CircuitTermination != nil { + + if err := m.CircuitTermination.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("circuit_termination") + } + return err + } + } + + return nil +} + +func (m *Interface) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *Interface) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *Interface) validateFormFactor(formats strfmt.Registry) error { + + if err := validate.Required("form_factor", "body", m.FormFactor); err != nil { + return err + } + + if m.FormFactor != nil { + + if err := m.FormFactor.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("form_factor") + } + return err + } + } + + return nil +} + +func (m *Interface) validateLag(formats strfmt.Registry) error { + + if err := validate.Required("lag", "body", m.Lag); err != nil { + return err + } + + if m.Lag != nil { + + if err := m.Lag.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("lag") + } + return err + } + } + + return nil +} + +func (m *Interface) validateMode(formats strfmt.Registry) error { + + if err := validate.Required("mode", "body", m.Mode); err != nil { + return err + } + + if m.Mode != nil { + + if err := m.Mode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mode") + } + return err + } + } + + return nil +} + +func (m *Interface) validateMtu(formats strfmt.Registry) error { + + if swag.IsZero(m.Mtu) { // not required + return nil + } + + if err := validate.MinimumInt("mtu", "body", int64(*m.Mtu), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("mtu", "body", int64(*m.Mtu), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *Interface) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *Interface) validateTaggedVlans(formats strfmt.Registry) error { + + if err := validate.Required("tagged_vlans", "body", m.TaggedVlans); err != nil { + return err + } + + if err := m.TaggedVlans.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tagged_vlans") + } + return err + } + + return nil +} + +func (m *Interface) validateUntaggedVlan(formats strfmt.Registry) error { + + if err := validate.Required("untagged_vlan", "body", m.UntaggedVlan); err != nil { + return err + } + + if m.UntaggedVlan != nil { + + if err := m.UntaggedVlan.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("untagged_vlan") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Interface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Interface) UnmarshalBinary(b []byte) error { + var res Interface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_circuit_termination.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_circuit_termination.go new file mode 100644 index 0000000..6aff3dd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_circuit_termination.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InterfaceCircuitTermination Circuit termination +// swagger:model InterfaceCircuitTermination +type InterfaceCircuitTermination struct { + + // circuit + // Required: true + Circuit *InterfaceNestedCircuit `json:"circuit"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Port speed (Kbps) + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + PortSpeed *int64 `json:"port_speed"` + + // Patch panel/port(s) + // Max Length: 100 + PpInfo string `json:"pp_info,omitempty"` + + // Termination + // Required: true + TermSide *string `json:"term_side"` + + // Upstream speed (Kbps) + // + // Upstream speed, if different from port speed + // Maximum: 2.147483647e+09 + // Minimum: 0 + UpstreamSpeed *int64 `json:"upstream_speed,omitempty"` + + // Cross-connect ID + // Max Length: 50 + XconnectID string `json:"xconnect_id,omitempty"` +} + +// Validate validates this interface circuit termination +func (m *InterfaceCircuitTermination) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCircuit(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePortSpeed(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePpInfo(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTermSide(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUpstreamSpeed(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateXconnectID(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceCircuitTermination) validateCircuit(formats strfmt.Registry) error { + + if err := validate.Required("circuit", "body", m.Circuit); err != nil { + return err + } + + if m.Circuit != nil { + + if err := m.Circuit.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("circuit") + } + return err + } + } + + return nil +} + +func (m *InterfaceCircuitTermination) validatePortSpeed(formats strfmt.Registry) error { + + if err := validate.Required("port_speed", "body", m.PortSpeed); err != nil { + return err + } + + if err := validate.MinimumInt("port_speed", "body", int64(*m.PortSpeed), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("port_speed", "body", int64(*m.PortSpeed), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *InterfaceCircuitTermination) validatePpInfo(formats strfmt.Registry) error { + + if swag.IsZero(m.PpInfo) { // not required + return nil + } + + if err := validate.MaxLength("pp_info", "body", string(m.PpInfo), 100); err != nil { + return err + } + + return nil +} + +var interfaceCircuitTerminationTypeTermSidePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["A","Z"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + interfaceCircuitTerminationTypeTermSidePropEnum = append(interfaceCircuitTerminationTypeTermSidePropEnum, v) + } +} + +const ( + // InterfaceCircuitTerminationTermSideA captures enum value "A" + InterfaceCircuitTerminationTermSideA string = "A" + // InterfaceCircuitTerminationTermSideZ captures enum value "Z" + InterfaceCircuitTerminationTermSideZ string = "Z" +) + +// prop value enum +func (m *InterfaceCircuitTermination) validateTermSideEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, interfaceCircuitTerminationTypeTermSidePropEnum); err != nil { + return err + } + return nil +} + +func (m *InterfaceCircuitTermination) validateTermSide(formats strfmt.Registry) error { + + if err := validate.Required("term_side", "body", m.TermSide); err != nil { + return err + } + + // value enum + if err := m.validateTermSideEnum("term_side", "body", *m.TermSide); err != nil { + return err + } + + return nil +} + +func (m *InterfaceCircuitTermination) validateUpstreamSpeed(formats strfmt.Registry) error { + + if swag.IsZero(m.UpstreamSpeed) { // not required + return nil + } + + if err := validate.MinimumInt("upstream_speed", "body", int64(*m.UpstreamSpeed), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("upstream_speed", "body", int64(*m.UpstreamSpeed), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *InterfaceCircuitTermination) validateXconnectID(formats strfmt.Registry) error { + + if swag.IsZero(m.XconnectID) { // not required + return nil + } + + if err := validate.MaxLength("xconnect_id", "body", string(m.XconnectID), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceCircuitTermination) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceCircuitTermination) UnmarshalBinary(b []byte) error { + var res InterfaceCircuitTermination + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_connection.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_connection.go new file mode 100644 index 0000000..bfd036d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_connection.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InterfaceConnection interface connection +// swagger:model InterfaceConnection +type InterfaceConnection struct { + + // connection status + // Required: true + ConnectionStatus *InterfaceConnectionConnectionStatus `json:"connection_status"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // interface a + // Required: true + InterfaceA *PeerInterface `json:"interface_a"` + + // interface b + // Required: true + InterfaceB *PeerInterface `json:"interface_b"` +} + +// Validate validates this interface connection +func (m *InterfaceConnection) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConnectionStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateInterfaceA(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateInterfaceB(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceConnection) validateConnectionStatus(formats strfmt.Registry) error { + + if err := validate.Required("connection_status", "body", m.ConnectionStatus); err != nil { + return err + } + + if m.ConnectionStatus != nil { + + if err := m.ConnectionStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("connection_status") + } + return err + } + } + + return nil +} + +func (m *InterfaceConnection) 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") + } + return err + } + } + + return nil +} + +func (m *InterfaceConnection) 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") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceConnection) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceConnection) UnmarshalBinary(b []byte) error { + var res InterfaceConnection + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_connection_connection_status.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_connection_connection_status.go new file mode 100644 index 0000000..37766d7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_connection_connection_status.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InterfaceConnectionConnectionStatus Connection status +// swagger:model interfaceConnectionConnectionStatus +type InterfaceConnectionConnectionStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *bool `json:"value"` +} + +// Validate validates this interface connection connection status +func (m *InterfaceConnectionConnectionStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceConnectionConnectionStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *InterfaceConnectionConnectionStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceConnectionConnectionStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceConnectionConnectionStatus) UnmarshalBinary(b []byte) error { + var res InterfaceConnectionConnectionStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_form_factor.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_form_factor.go new file mode 100644 index 0000000..bfb96b7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_form_factor.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InterfaceFormFactor Form factor +// swagger:model interfaceFormFactor +type InterfaceFormFactor struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this interface form factor +func (m *InterfaceFormFactor) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceFormFactor) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *InterfaceFormFactor) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceFormFactor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceFormFactor) UnmarshalBinary(b []byte) error { + var res InterfaceFormFactor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_mode.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_mode.go new file mode 100644 index 0000000..417aa81 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_mode.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InterfaceMode Mode +// swagger:model interfaceMode +type InterfaceMode struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this interface mode +func (m *InterfaceMode) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceMode) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *InterfaceMode) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceMode) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceMode) UnmarshalBinary(b []byte) error { + var res InterfaceMode + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_nested_circuit.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_nested_circuit.go new file mode 100644 index 0000000..9f1bca8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_nested_circuit.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InterfaceNestedCircuit Circuit +// swagger:model InterfaceNestedCircuit +type InterfaceNestedCircuit struct { + + // Circuit ID + // Required: true + // Max Length: 50 + Cid *string `json:"cid"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this interface nested circuit +func (m *InterfaceNestedCircuit) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCid(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceNestedCircuit) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + if err := validate.MaxLength("cid", "body", string(*m.Cid), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceNestedCircuit) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceNestedCircuit) UnmarshalBinary(b []byte) error { + var res InterfaceNestedCircuit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_tagged_vlans.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_tagged_vlans.go new file mode 100644 index 0000000..8771a55 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_tagged_vlans.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// InterfaceTaggedVlans interface tagged vlans +// swagger:model interfaceTaggedVlans +type InterfaceTaggedVlans []*InterfaceVLAN + +// Validate validates this interface tagged vlans +func (m InterfaceTaggedVlans) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_template.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_template.go new file mode 100644 index 0000000..d3f7ed8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_template.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InterfaceTemplate interface template +// swagger:model InterfaceTemplate +type InterfaceTemplate struct { + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // form factor + // Required: true + FormFactor *InterfaceTemplateFormFactor `json:"form_factor"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Management only + MgmtOnly bool `json:"mgmt_only,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` +} + +// Validate validates this interface template +func (m *InterfaceTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFormFactor(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *InterfaceTemplate) validateFormFactor(formats strfmt.Registry) error { + + if err := validate.Required("form_factor", "body", m.FormFactor); err != nil { + return err + } + + if m.FormFactor != nil { + + if err := m.FormFactor.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("form_factor") + } + return err + } + } + + return nil +} + +func (m *InterfaceTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceTemplate) UnmarshalBinary(b []byte) error { + var res InterfaceTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_template_form_factor.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_template_form_factor.go new file mode 100644 index 0000000..89e8a1f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_template_form_factor.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InterfaceTemplateFormFactor Form factor +// swagger:model interfaceTemplateFormFactor +type InterfaceTemplateFormFactor struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this interface template form factor +func (m *InterfaceTemplateFormFactor) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceTemplateFormFactor) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *InterfaceTemplateFormFactor) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceTemplateFormFactor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceTemplateFormFactor) UnmarshalBinary(b []byte) error { + var res InterfaceTemplateFormFactor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_vlan.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_vlan.go new file mode 100644 index 0000000..99d4154 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/interface_vlan.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InterfaceVLAN Untagged vlan +// swagger:model InterfaceVLAN +type InterfaceVLAN struct { + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` + + // ID + // Required: true + // Maximum: 4094 + // Minimum: 1 + Vid *int64 `json:"vid"` +} + +// Validate validates this interface v l a n +func (m *InterfaceVLAN) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVid(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceVLAN) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *InterfaceVLAN) validateVid(formats strfmt.Registry) error { + + if err := validate.Required("vid", "body", m.Vid); err != nil { + return err + } + + if err := validate.MinimumInt("vid", "body", int64(*m.Vid), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("vid", "body", int64(*m.Vid), 4094, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceVLAN) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceVLAN) UnmarshalBinary(b []byte) error { + var res InterfaceVLAN + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/inventory_item.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/inventory_item.go new file mode 100644 index 0000000..3b7883b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/inventory_item.go @@ -0,0 +1,255 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InventoryItem inventory item +// swagger:model InventoryItem +type InventoryItem struct { + + // Asset tag + // + // A unique tag used to identify this item + // Max Length: 50 + AssetTag string `json:"asset_tag,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // Discovered + Discovered bool `json:"discovered,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // manufacturer + // Required: true + Manufacturer *NestedManufacturer `json:"manufacturer"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Parent + // Required: true + Parent *int64 `json:"parent"` + + // Part ID + // Max Length: 50 + PartID string `json:"part_id,omitempty"` + + // Serial number + // Max Length: 50 + Serial string `json:"serial,omitempty"` +} + +// Validate validates this inventory item +func (m *InventoryItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssetTag(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateManufacturer(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateParent(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePartID(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSerial(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InventoryItem) validateAssetTag(formats strfmt.Registry) error { + + if swag.IsZero(m.AssetTag) { // not required + return nil + } + + if err := validate.MaxLength("asset_tag", "body", string(m.AssetTag), 50); err != nil { + return err + } + + return nil +} + +func (m *InventoryItem) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *InventoryItem) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *InventoryItem) validateManufacturer(formats strfmt.Registry) error { + + if err := validate.Required("manufacturer", "body", m.Manufacturer); err != nil { + return err + } + + if m.Manufacturer != nil { + + if err := m.Manufacturer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("manufacturer") + } + return err + } + } + + return nil +} + +func (m *InventoryItem) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *InventoryItem) validateParent(formats strfmt.Registry) error { + + if err := validate.Required("parent", "body", m.Parent); err != nil { + return err + } + + return nil +} + +func (m *InventoryItem) validatePartID(formats strfmt.Registry) error { + + if swag.IsZero(m.PartID) { // not required + return nil + } + + if err := validate.MaxLength("part_id", "body", string(m.PartID), 50); err != nil { + return err + } + + return nil +} + +func (m *InventoryItem) validateSerial(formats strfmt.Registry) error { + + if swag.IsZero(m.Serial) { // not required + return nil + } + + if err := validate.MaxLength("serial", "body", string(m.Serial), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryItem) UnmarshalBinary(b []byte) error { + var res InventoryItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_address.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_address.go new file mode 100644 index 0000000..32c582d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_address.go @@ -0,0 +1,318 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IPAddress IP address +// swagger:model IPAddress +type IPAddress struct { + + // Address + // + // IPv4 or IPv6 address (with mask) + // Required: true + Address *string `json:"address"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Family + // Read Only: true + Family int64 `json:"family,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // interface + // Required: true + Interface *IPAddressInterface `json:"interface"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // nat inside + // Required: true + NatInside *NestedIPAddress `json:"nat_inside"` + + // nat outside + // Required: true + NatOutside *NestedIPAddress `json:"nat_outside"` + + // role + // Required: true + Role *IPAddressRole `json:"role"` + + // status + // Required: true + Status *IPAddressStatus `json:"status"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` + + // vrf + // Required: true + Vrf *NestedVRF `json:"vrf"` +} + +// Validate validates this IP address +func (m *IPAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateInterface(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateNatInside(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateNatOutside(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVrf(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAddress) validateAddress(formats strfmt.Registry) error { + + if err := validate.Required("address", "body", m.Address); err != nil { + return err + } + + return nil +} + +func (m *IPAddress) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *IPAddress) validateInterface(formats strfmt.Registry) error { + + if err := validate.Required("interface", "body", m.Interface); err != nil { + return err + } + + if m.Interface != nil { + + if err := m.Interface.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("interface") + } + return err + } + } + + return nil +} + +func (m *IPAddress) validateNatInside(formats strfmt.Registry) error { + + if err := validate.Required("nat_inside", "body", m.NatInside); err != nil { + return err + } + + if m.NatInside != nil { + + if err := m.NatInside.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nat_inside") + } + return err + } + } + + return nil +} + +func (m *IPAddress) validateNatOutside(formats strfmt.Registry) error { + + if err := validate.Required("nat_outside", "body", m.NatOutside); err != nil { + return err + } + + if m.NatOutside != nil { + + if err := m.NatOutside.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nat_outside") + } + return err + } + } + + return nil +} + +func (m *IPAddress) validateRole(formats strfmt.Registry) error { + + if err := validate.Required("role", "body", m.Role); err != nil { + return err + } + + if m.Role != nil { + + if err := m.Role.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("role") + } + return err + } + } + + return nil +} + +func (m *IPAddress) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + if m.Status != nil { + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *IPAddress) validateTenant(formats strfmt.Registry) error { + + if err := validate.Required("tenant", "body", m.Tenant); err != nil { + return err + } + + if m.Tenant != nil { + + if err := m.Tenant.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } + return err + } + } + + return nil +} + +func (m *IPAddress) validateVrf(formats strfmt.Registry) error { + + if err := validate.Required("vrf", "body", m.Vrf); err != nil { + return err + } + + if m.Vrf != nil { + + if err := m.Vrf.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vrf") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAddress) UnmarshalBinary(b []byte) error { + var res IPAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_address_interface.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_address_interface.go new file mode 100644 index 0000000..4138ae4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_address_interface.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IPAddressInterface Interface +// swagger:model IPAddressInterface +type IPAddressInterface struct { + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // Url + // Read Only: true + URL string `json:"url,omitempty"` + + // virtual machine + // Required: true + VirtualMachine *NestedVirtualMachine `json:"virtual_machine"` +} + +// Validate validates this IP address interface +func (m *IPAddressInterface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVirtualMachine(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAddressInterface) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *IPAddressInterface) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *IPAddressInterface) validateVirtualMachine(formats strfmt.Registry) error { + + if err := validate.Required("virtual_machine", "body", m.VirtualMachine); err != nil { + return err + } + + if m.VirtualMachine != nil { + + if err := m.VirtualMachine.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtual_machine") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAddressInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAddressInterface) UnmarshalBinary(b []byte) error { + var res IPAddressInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_address_role.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_address_role.go new file mode 100644 index 0000000..cd8441e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_address_role.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IPAddressRole Role +// swagger:model ipAddressRole +type IPAddressRole struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this ip address role +func (m *IPAddressRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAddressRole) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *IPAddressRole) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAddressRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAddressRole) UnmarshalBinary(b []byte) error { + var res IPAddressRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_address_status.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_address_status.go new file mode 100644 index 0000000..54ec03e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_address_status.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IPAddressStatus Status +// swagger:model ipAddressStatus +type IPAddressStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this ip address status +func (m *IPAddressStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAddressStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *IPAddressStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAddressStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAddressStatus) UnmarshalBinary(b []byte) error { + var res IPAddressStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amaggregates_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amaggregates_list_okbody.go new file mode 100644 index 0000000..e43ff0a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amaggregates_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IPAMAggregatesListOKBody ipam aggregates list o k body +// swagger:model ipamAggregatesListOKBody +type IPAMAggregatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMAggregatesListOKBodyResults `json:"results"` +} + +// Validate validates this ipam aggregates list o k body +func (m *IPAMAggregatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMAggregatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMAggregatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMAggregatesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMAggregatesListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMAggregatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amaggregates_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amaggregates_list_okbody_results.go new file mode 100644 index 0000000..e93c2aa --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amaggregates_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// IPAMAggregatesListOKBodyResults ipam aggregates list o k body results +// swagger:model ipamAggregatesListOKBodyResults +type IPAMAggregatesListOKBodyResults []*Aggregate + +// Validate validates this ipam aggregates list o k body results +func (m IPAMAggregatesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amip_addresses_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amip_addresses_list_okbody.go new file mode 100644 index 0000000..3453bfd --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amip_addresses_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IPAMIPAddressesListOKBody ipam Ip addresses list o k body +// swagger:model ipamIpAddressesListOKBody +type IPAMIPAddressesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMIPAddressesListOKBodyResults `json:"results"` +} + +// Validate validates this ipam Ip addresses list o k body +func (m *IPAMIPAddressesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMIPAddressesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMIPAddressesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMIPAddressesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMIPAddressesListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMIPAddressesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amip_addresses_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amip_addresses_list_okbody_results.go new file mode 100644 index 0000000..86968c6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amip_addresses_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// IPAMIPAddressesListOKBodyResults ipam Ip addresses list o k body results +// swagger:model ipamIpAddressesListOKBodyResults +type IPAMIPAddressesListOKBodyResults []*IPAddress + +// Validate validates this ipam Ip addresses list o k body results +func (m IPAMIPAddressesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amprefixes_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amprefixes_list_okbody.go new file mode 100644 index 0000000..3a0455f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amprefixes_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IPAMPrefixesListOKBody ipam prefixes list o k body +// swagger:model ipamPrefixesListOKBody +type IPAMPrefixesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMPrefixesListOKBodyResults `json:"results"` +} + +// Validate validates this ipam prefixes list o k body +func (m *IPAMPrefixesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMPrefixesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMPrefixesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMPrefixesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMPrefixesListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMPrefixesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amprefixes_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amprefixes_list_okbody_results.go new file mode 100644 index 0000000..7d5ae3a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amprefixes_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// IPAMPrefixesListOKBodyResults ipam prefixes list o k body results +// swagger:model ipamPrefixesListOKBodyResults +type IPAMPrefixesListOKBodyResults []*Prefix + +// Validate validates this ipam prefixes list o k body results +func (m IPAMPrefixesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amrirs_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amrirs_list_okbody.go new file mode 100644 index 0000000..97aab23 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amrirs_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IPAMRirsListOKBody ipam rirs list o k body +// swagger:model ipamRirsListOKBody +type IPAMRirsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMRirsListOKBodyResults `json:"results"` +} + +// Validate validates this ipam rirs list o k body +func (m *IPAMRirsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMRirsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMRirsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMRirsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMRirsListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMRirsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amrirs_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amrirs_list_okbody_results.go new file mode 100644 index 0000000..a817774 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amrirs_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// IPAMRirsListOKBodyResults ipam rirs list o k body results +// swagger:model ipamRirsListOKBodyResults +type IPAMRirsListOKBodyResults []*RIR + +// Validate validates this ipam rirs list o k body results +func (m IPAMRirsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amroles_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amroles_list_okbody.go new file mode 100644 index 0000000..044fa6b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amroles_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IPAMRolesListOKBody ipam roles list o k body +// swagger:model ipamRolesListOKBody +type IPAMRolesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMRolesListOKBodyResults `json:"results"` +} + +// Validate validates this ipam roles list o k body +func (m *IPAMRolesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMRolesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMRolesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMRolesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMRolesListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMRolesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amroles_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amroles_list_okbody_results.go new file mode 100644 index 0000000..eda1619 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amroles_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// IPAMRolesListOKBodyResults ipam roles list o k body results +// swagger:model ipamRolesListOKBodyResults +type IPAMRolesListOKBodyResults []*Role + +// Validate validates this ipam roles list o k body results +func (m IPAMRolesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amservices_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amservices_list_okbody.go new file mode 100644 index 0000000..43866d0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amservices_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IPAMServicesListOKBody ipam services list o k body +// swagger:model ipamServicesListOKBody +type IPAMServicesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMServicesListOKBodyResults `json:"results"` +} + +// Validate validates this ipam services list o k body +func (m *IPAMServicesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMServicesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMServicesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMServicesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMServicesListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMServicesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amservices_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amservices_list_okbody_results.go new file mode 100644 index 0000000..6b88015 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amservices_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// IPAMServicesListOKBodyResults ipam services list o k body results +// swagger:model ipamServicesListOKBodyResults +type IPAMServicesListOKBodyResults []*Service + +// Validate validates this ipam services list o k body results +func (m IPAMServicesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvlan_groups_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvlan_groups_list_okbody.go new file mode 100644 index 0000000..c423bca --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvlan_groups_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IPAMVlanGroupsListOKBody ipam vlan groups list o k body +// swagger:model ipamVlanGroupsListOKBody +type IPAMVlanGroupsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMVlanGroupsListOKBodyResults `json:"results"` +} + +// Validate validates this ipam vlan groups list o k body +func (m *IPAMVlanGroupsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMVlanGroupsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMVlanGroupsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMVlanGroupsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMVlanGroupsListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMVlanGroupsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvlan_groups_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvlan_groups_list_okbody_results.go new file mode 100644 index 0000000..eca9774 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvlan_groups_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// IPAMVlanGroupsListOKBodyResults ipam vlan groups list o k body results +// swagger:model ipamVlanGroupsListOKBodyResults +type IPAMVlanGroupsListOKBodyResults []*VLANGroup + +// Validate validates this ipam vlan groups list o k body results +func (m IPAMVlanGroupsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvlans_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvlans_list_okbody.go new file mode 100644 index 0000000..7154bca --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvlans_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IPAMVlansListOKBody ipam vlans list o k body +// swagger:model ipamVlansListOKBody +type IPAMVlansListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMVlansListOKBodyResults `json:"results"` +} + +// Validate validates this ipam vlans list o k body +func (m *IPAMVlansListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMVlansListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMVlansListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMVlansListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMVlansListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMVlansListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvlans_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvlans_list_okbody_results.go new file mode 100644 index 0000000..86a1ba0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvlans_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// IPAMVlansListOKBodyResults ipam vlans list o k body results +// swagger:model ipamVlansListOKBodyResults +type IPAMVlansListOKBodyResults []*VLAN + +// Validate validates this ipam vlans list o k body results +func (m IPAMVlansListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvrfs_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvrfs_list_okbody.go new file mode 100644 index 0000000..5fefe55 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvrfs_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IPAMVrfsListOKBody ipam vrfs list o k body +// swagger:model ipamVrfsListOKBody +type IPAMVrfsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMVrfsListOKBodyResults `json:"results"` +} + +// Validate validates this ipam vrfs list o k body +func (m *IPAMVrfsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMVrfsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMVrfsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMVrfsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMVrfsListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMVrfsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvrfs_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvrfs_list_okbody_results.go new file mode 100644 index 0000000..7d069d8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/ip_amvrfs_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// IPAMVrfsListOKBodyResults ipam vrfs list o k body results +// swagger:model ipamVrfsListOKBodyResults +type IPAMVrfsListOKBodyResults []*VRF + +// Validate validates this ipam vrfs list o k body results +func (m IPAMVrfsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/manufacturer.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/manufacturer.go new file mode 100644 index 0000000..9f4f211 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/manufacturer.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Manufacturer manufacturer +// swagger:model Manufacturer +type Manufacturer struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this manufacturer +func (m *Manufacturer) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Manufacturer) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *Manufacturer) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Manufacturer) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Manufacturer) UnmarshalBinary(b []byte) error { + var res Manufacturer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_circuit.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_circuit.go new file mode 100644 index 0000000..14a77d9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_circuit.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedCircuit Circuit +// swagger:model NestedCircuit +type NestedCircuit struct { + + // Circuit ID + // Required: true + // Max Length: 50 + Cid *string `json:"cid"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested circuit +func (m *NestedCircuit) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCid(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedCircuit) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + if err := validate.MaxLength("cid", "body", string(*m.Cid), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedCircuit) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedCircuit) UnmarshalBinary(b []byte) error { + var res NestedCircuit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_circuit_type.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_circuit_type.go new file mode 100644 index 0000000..b85491e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_circuit_type.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedCircuitType Type +// swagger:model NestedCircuitType +type NestedCircuitType struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested circuit type +func (m *NestedCircuitType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedCircuitType) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedCircuitType) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedCircuitType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedCircuitType) UnmarshalBinary(b []byte) error { + var res NestedCircuitType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_cluster.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_cluster.go new file mode 100644 index 0000000..01f2973 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_cluster.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedCluster Cluster +// swagger:model NestedCluster +type NestedCluster struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 100 + Name *string `json:"name"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested cluster +func (m *NestedCluster) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedCluster) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedCluster) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedCluster) UnmarshalBinary(b []byte) error { + var res NestedCluster + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_cluster_group.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_cluster_group.go new file mode 100644 index 0000000..8ecd05e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_cluster_group.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedClusterGroup Group +// swagger:model NestedClusterGroup +type NestedClusterGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested cluster group +func (m *NestedClusterGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedClusterGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedClusterGroup) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedClusterGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedClusterGroup) UnmarshalBinary(b []byte) error { + var res NestedClusterGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_cluster_type.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_cluster_type.go new file mode 100644 index 0000000..37e547b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_cluster_type.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedClusterType Type +// swagger:model NestedClusterType +type NestedClusterType struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested cluster type +func (m *NestedClusterType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedClusterType) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedClusterType) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedClusterType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedClusterType) UnmarshalBinary(b []byte) error { + var res NestedClusterType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_device.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_device.go new file mode 100644 index 0000000..4d562a8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_device.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedDevice Device +// swagger:model NestedDevice +type NestedDevice struct { + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Max Length: 64 + Name string `json:"name,omitempty"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested device +func (m *NestedDevice) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedDevice) validateName(formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := validate.MaxLength("name", "body", string(m.Name), 64); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedDevice) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedDevice) UnmarshalBinary(b []byte) error { + var res NestedDevice + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_device_role.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_device_role.go new file mode 100644 index 0000000..f1fc28e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_device_role.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedDeviceRole Device role +// swagger:model NestedDeviceRole +type NestedDeviceRole struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested device role +func (m *NestedDeviceRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedDeviceRole) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedDeviceRole) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedDeviceRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedDeviceRole) UnmarshalBinary(b []byte) error { + var res NestedDeviceRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_device_type.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_device_type.go new file mode 100644 index 0000000..1fb87ee --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_device_type.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedDeviceType Device type +// swagger:model NestedDeviceType +type NestedDeviceType struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // manufacturer + // Required: true + Manufacturer *NestedManufacturer `json:"manufacturer"` + + // Model + // Required: true + // Max Length: 50 + Model *string `json:"model"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested device type +func (m *NestedDeviceType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateManufacturer(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateModel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedDeviceType) validateManufacturer(formats strfmt.Registry) error { + + if err := validate.Required("manufacturer", "body", m.Manufacturer); err != nil { + return err + } + + if m.Manufacturer != nil { + + if err := m.Manufacturer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("manufacturer") + } + return err + } + } + + return nil +} + +func (m *NestedDeviceType) validateModel(formats strfmt.Registry) error { + + if err := validate.Required("model", "body", m.Model); err != nil { + return err + } + + if err := validate.MaxLength("model", "body", string(*m.Model), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedDeviceType) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedDeviceType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedDeviceType) UnmarshalBinary(b []byte) error { + var res NestedDeviceType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_interface.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_interface.go new file mode 100644 index 0000000..f764ad9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_interface.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedInterface Lag +// swagger:model NestedInterface +type NestedInterface struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested interface +func (m *NestedInterface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedInterface) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedInterface) UnmarshalBinary(b []byte) error { + var res NestedInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_ip_address.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_ip_address.go new file mode 100644 index 0000000..b4cf100 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_ip_address.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedIPAddress Nat inside +// swagger:model NestedIPAddress +type NestedIPAddress struct { + + // Address + // + // IPv4 or IPv6 address (with mask) + // Required: true + Address *string `json:"address"` + + // Family + // Read Only: true + Family int64 `json:"family,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested IP address +func (m *NestedIPAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedIPAddress) validateAddress(formats strfmt.Registry) error { + + if err := validate.Required("address", "body", m.Address); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedIPAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedIPAddress) UnmarshalBinary(b []byte) error { + var res NestedIPAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_manufacturer.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_manufacturer.go new file mode 100644 index 0000000..a0868af --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_manufacturer.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedManufacturer Manufacturer +// swagger:model NestedManufacturer +type NestedManufacturer struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested manufacturer +func (m *NestedManufacturer) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedManufacturer) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedManufacturer) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedManufacturer) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedManufacturer) UnmarshalBinary(b []byte) error { + var res NestedManufacturer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_platform.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_platform.go new file mode 100644 index 0000000..25e19ce --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_platform.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedPlatform Platform +// swagger:model NestedPlatform +type NestedPlatform struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested platform +func (m *NestedPlatform) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedPlatform) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedPlatform) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedPlatform) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedPlatform) UnmarshalBinary(b []byte) error { + var res NestedPlatform + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_provider.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_provider.go new file mode 100644 index 0000000..2fa4752 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_provider.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedProvider Provider +// swagger:model NestedProvider +type NestedProvider struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested provider +func (m *NestedProvider) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedProvider) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedProvider) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedProvider) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedProvider) UnmarshalBinary(b []byte) error { + var res NestedProvider + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_rack.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_rack.go new file mode 100644 index 0000000..08c5b42 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_rack.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedRack Rack +// swagger:model NestedRack +type NestedRack struct { + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested rack +func (m *NestedRack) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedRack) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedRack) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedRack) UnmarshalBinary(b []byte) error { + var res NestedRack + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_rack_group.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_rack_group.go new file mode 100644 index 0000000..0f736ff --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_rack_group.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedRackGroup Group +// swagger:model NestedRackGroup +type NestedRackGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested rack group +func (m *NestedRackGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedRackGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedRackGroup) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedRackGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedRackGroup) UnmarshalBinary(b []byte) error { + var res NestedRackGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_rack_role.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_rack_role.go new file mode 100644 index 0000000..191fe3a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_rack_role.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedRackRole Role +// swagger:model NestedRackRole +type NestedRackRole struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested rack role +func (m *NestedRackRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedRackRole) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedRackRole) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedRackRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedRackRole) UnmarshalBinary(b []byte) error { + var res NestedRackRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_region.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_region.go new file mode 100644 index 0000000..0945a67 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_region.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedRegion Parent +// swagger:model NestedRegion +type NestedRegion struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested region +func (m *NestedRegion) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedRegion) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedRegion) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedRegion) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedRegion) UnmarshalBinary(b []byte) error { + var res NestedRegion + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_rir.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_rir.go new file mode 100644 index 0000000..33c67b4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_rir.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedRIR Rir +// swagger:model NestedRIR +type NestedRIR struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested r i r +func (m *NestedRIR) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedRIR) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedRIR) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedRIR) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedRIR) UnmarshalBinary(b []byte) error { + var res NestedRIR + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_role.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_role.go new file mode 100644 index 0000000..8486baf --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_role.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedRole Role +// swagger:model NestedRole +type NestedRole struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested role +func (m *NestedRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedRole) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedRole) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedRole) UnmarshalBinary(b []byte) error { + var res NestedRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_secret_role.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_secret_role.go new file mode 100644 index 0000000..ce948db --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_secret_role.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedSecretRole Role +// swagger:model NestedSecretRole +type NestedSecretRole struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested secret role +func (m *NestedSecretRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedSecretRole) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedSecretRole) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedSecretRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedSecretRole) UnmarshalBinary(b []byte) error { + var res NestedSecretRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_site.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_site.go new file mode 100644 index 0000000..3a3a7cb --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_site.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedSite Site +// swagger:model NestedSite +type NestedSite struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested site +func (m *NestedSite) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedSite) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedSite) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedSite) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedSite) UnmarshalBinary(b []byte) error { + var res NestedSite + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_tenant.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_tenant.go new file mode 100644 index 0000000..149c6b5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_tenant.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedTenant Tenant +// swagger:model NestedTenant +type NestedTenant struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 30 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested tenant +func (m *NestedTenant) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedTenant) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 30); err != nil { + return err + } + + return nil +} + +func (m *NestedTenant) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedTenant) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedTenant) UnmarshalBinary(b []byte) error { + var res NestedTenant + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_tenant_group.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_tenant_group.go new file mode 100644 index 0000000..a31c47a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_tenant_group.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedTenantGroup Group +// swagger:model NestedTenantGroup +type NestedTenantGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested tenant group +func (m *NestedTenantGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedTenantGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedTenantGroup) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedTenantGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedTenantGroup) UnmarshalBinary(b []byte) error { + var res NestedTenantGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_user.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_user.go new file mode 100644 index 0000000..aaf5c83 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_user.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedUser User +// swagger:model NestedUser +type NestedUser struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Username + // + // Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + // Required: true + // Max Length: 150 + // Pattern: ^[\w.@+-]+$ + Username *string `json:"username"` +} + +// Validate validates this nested user +func (m *NestedUser) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUsername(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedUser) validateUsername(formats strfmt.Registry) error { + + if err := validate.Required("username", "body", m.Username); err != nil { + return err + } + + if err := validate.MaxLength("username", "body", string(*m.Username), 150); err != nil { + return err + } + + if err := validate.Pattern("username", "body", string(*m.Username), `^[\w.@+-]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedUser) UnmarshalBinary(b []byte) error { + var res NestedUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_virtual_machine.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_virtual_machine.go new file mode 100644 index 0000000..0068bfb --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_virtual_machine.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedVirtualMachine Virtual machine +// swagger:model NestedVirtualMachine +type NestedVirtualMachine struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested virtual machine +func (m *NestedVirtualMachine) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedVirtualMachine) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedVirtualMachine) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedVirtualMachine) UnmarshalBinary(b []byte) error { + var res NestedVirtualMachine + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_vlan.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_vlan.go new file mode 100644 index 0000000..a9b0dc5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_vlan.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedVLAN Vlan +// swagger:model NestedVLAN +type NestedVLAN struct { + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` + + // ID + // Required: true + // Maximum: 4094 + // Minimum: 1 + Vid *int64 `json:"vid"` +} + +// Validate validates this nested v l a n +func (m *NestedVLAN) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVid(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedVLAN) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *NestedVLAN) validateVid(formats strfmt.Registry) error { + + if err := validate.Required("vid", "body", m.Vid); err != nil { + return err + } + + if err := validate.MinimumInt("vid", "body", int64(*m.Vid), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("vid", "body", int64(*m.Vid), 4094, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedVLAN) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedVLAN) UnmarshalBinary(b []byte) error { + var res NestedVLAN + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_vlangroup.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_vlangroup.go new file mode 100644 index 0000000..89b2498 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_vlangroup.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedVLANGroup Group +// swagger:model NestedVLANGroup +type NestedVLANGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested v l a n group +func (m *NestedVLANGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedVLANGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedVLANGroup) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedVLANGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedVLANGroup) UnmarshalBinary(b []byte) error { + var res NestedVLANGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_vrf.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_vrf.go new file mode 100644 index 0000000..d7c0556 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/nested_vrf.go @@ -0,0 +1,115 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedVRF Vrf +// swagger:model NestedVRF +type NestedVRF struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Route distinguisher + // Required: true + // Max Length: 21 + Rd *string `json:"rd"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested v r f +func (m *NestedVRF) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRd(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedVRF) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedVRF) validateRd(formats strfmt.Registry) error { + + if err := validate.Required("rd", "body", m.Rd); err != nil { + return err + } + + if err := validate.MaxLength("rd", "body", string(*m.Rd), 21); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedVRF) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedVRF) UnmarshalBinary(b []byte) error { + var res NestedVRF + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/peer_interface.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/peer_interface.go new file mode 100644 index 0000000..c10a366 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/peer_interface.go @@ -0,0 +1,236 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PeerInterface Interface a +// swagger:model PeerInterface +type PeerInterface struct { + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // Enabled + Enabled bool `json:"enabled,omitempty"` + + // form factor + // Required: true + FormFactor *PeerInterfaceFormFactor `json:"form_factor"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // lag + // Required: true + Lag *NestedInterface `json:"lag"` + + // MAC Address + MacAddress string `json:"mac_address,omitempty"` + + // OOB Management + // + // This interface is used only for out-of-band management + MgmtOnly bool `json:"mgmt_only,omitempty"` + + // MTU + // Maximum: 32767 + // Minimum: 0 + Mtu *int64 `json:"mtu,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this peer interface +func (m *PeerInterface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFormFactor(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateLag(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateMtu(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PeerInterface) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *PeerInterface) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *PeerInterface) validateFormFactor(formats strfmt.Registry) error { + + if err := validate.Required("form_factor", "body", m.FormFactor); err != nil { + return err + } + + if m.FormFactor != nil { + + if err := m.FormFactor.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("form_factor") + } + return err + } + } + + return nil +} + +func (m *PeerInterface) validateLag(formats strfmt.Registry) error { + + if err := validate.Required("lag", "body", m.Lag); err != nil { + return err + } + + if m.Lag != nil { + + if err := m.Lag.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("lag") + } + return err + } + } + + return nil +} + +func (m *PeerInterface) validateMtu(formats strfmt.Registry) error { + + if swag.IsZero(m.Mtu) { // not required + return nil + } + + if err := validate.MinimumInt("mtu", "body", int64(*m.Mtu), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("mtu", "body", int64(*m.Mtu), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *PeerInterface) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PeerInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PeerInterface) UnmarshalBinary(b []byte) error { + var res PeerInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/peer_interface_form_factor.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/peer_interface_form_factor.go new file mode 100644 index 0000000..9964edc --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/peer_interface_form_factor.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PeerInterfaceFormFactor Form factor +// swagger:model peerInterfaceFormFactor +type PeerInterfaceFormFactor struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this peer interface form factor +func (m *PeerInterfaceFormFactor) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PeerInterfaceFormFactor) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *PeerInterfaceFormFactor) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PeerInterfaceFormFactor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PeerInterfaceFormFactor) UnmarshalBinary(b []byte) error { + var res PeerInterfaceFormFactor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/platform.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/platform.go new file mode 100644 index 0000000..64e0074 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/platform.go @@ -0,0 +1,221 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Platform platform +// swagger:model Platform +type Platform struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // manufacturer + // Required: true + Manufacturer *NestedManufacturer `json:"manufacturer"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // NAPALM driver + // + // The name of the NAPALM driver to use when interacting with devices + // Max Length: 50 + NapalmDriver string `json:"napalm_driver,omitempty"` + + // Legacy RPC client + RPCClient string `json:"rpc_client,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this platform +func (m *Platform) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateManufacturer(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateNapalmDriver(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRPCClient(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Platform) validateManufacturer(formats strfmt.Registry) error { + + if err := validate.Required("manufacturer", "body", m.Manufacturer); err != nil { + return err + } + + if m.Manufacturer != nil { + + if err := m.Manufacturer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("manufacturer") + } + return err + } + } + + return nil +} + +func (m *Platform) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *Platform) validateNapalmDriver(formats strfmt.Registry) error { + + if swag.IsZero(m.NapalmDriver) { // not required + return nil + } + + if err := validate.MaxLength("napalm_driver", "body", string(m.NapalmDriver), 50); err != nil { + return err + } + + return nil +} + +var platformTypeRPCClientPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["juniper-junos","cisco-ios","opengear"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + platformTypeRPCClientPropEnum = append(platformTypeRPCClientPropEnum, v) + } +} + +const ( + // PlatformRPCClientJuniperJunos captures enum value "juniper-junos" + PlatformRPCClientJuniperJunos string = "juniper-junos" + // PlatformRPCClientCiscoIos captures enum value "cisco-ios" + PlatformRPCClientCiscoIos string = "cisco-ios" + // PlatformRPCClientOpengear captures enum value "opengear" + PlatformRPCClientOpengear string = "opengear" +) + +// prop value enum +func (m *Platform) validateRPCClientEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, platformTypeRPCClientPropEnum); err != nil { + return err + } + return nil +} + +func (m *Platform) validateRPCClient(formats strfmt.Registry) error { + + if swag.IsZero(m.RPCClient) { // not required + return nil + } + + // value enum + if err := m.validateRPCClientEnum("rpc_client", "body", m.RPCClient); err != nil { + return err + } + + return nil +} + +func (m *Platform) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Platform) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Platform) UnmarshalBinary(b []byte) error { + var res Platform + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/power_outlet.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/power_outlet.go new file mode 100644 index 0000000..85a2c7d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/power_outlet.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PowerOutlet Power outlet +// swagger:model PowerOutlet +type PowerOutlet struct { + + // Connected port + // Read Only: true + ConnectedPort string `json:"connected_port,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this power outlet +func (m *PowerOutlet) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerOutlet) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *PowerOutlet) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PowerOutlet) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerOutlet) UnmarshalBinary(b []byte) error { + var res PowerOutlet + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/power_outlet_template.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/power_outlet_template.go new file mode 100644 index 0000000..a393cb2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/power_outlet_template.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PowerOutletTemplate power outlet template +// swagger:model PowerOutletTemplate +type PowerOutletTemplate struct { + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this power outlet template +func (m *PowerOutletTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerOutletTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *PowerOutletTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PowerOutletTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerOutletTemplate) UnmarshalBinary(b []byte) error { + var res PowerOutletTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/power_port.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/power_port.go new file mode 100644 index 0000000..6b1fc4b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/power_port.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PowerPort power port +// swagger:model PowerPort +type PowerPort struct { + + // Connection status + ConnectionStatus bool `json:"connection_status,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // power outlet + // Required: true + PowerOutlet *PowerOutlet `json:"power_outlet"` +} + +// Validate validates this power port +func (m *PowerPort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConnectionStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePowerOutlet(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var powerPortTypeConnectionStatusPropEnum []interface{} + +func init() { + var res []bool + if err := json.Unmarshal([]byte(`[false,true]`), &res); err != nil { + panic(err) + } + for _, v := range res { + powerPortTypeConnectionStatusPropEnum = append(powerPortTypeConnectionStatusPropEnum, v) + } +} + +// prop value enum +func (m *PowerPort) validateConnectionStatusEnum(path, location string, value bool) error { + if err := validate.Enum(path, location, value, powerPortTypeConnectionStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *PowerPort) validateConnectionStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.ConnectionStatus) { // not required + return nil + } + + // value enum + if err := m.validateConnectionStatusEnum("connection_status", "body", m.ConnectionStatus); err != nil { + return err + } + + return nil +} + +func (m *PowerPort) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *PowerPort) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *PowerPort) validatePowerOutlet(formats strfmt.Registry) error { + + if err := validate.Required("power_outlet", "body", m.PowerOutlet); err != nil { + return err + } + + if m.PowerOutlet != nil { + + if err := m.PowerOutlet.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("power_outlet") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PowerPort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerPort) UnmarshalBinary(b []byte) error { + var res PowerPort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/power_port_template.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/power_port_template.go new file mode 100644 index 0000000..7b628bb --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/power_port_template.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PowerPortTemplate power port template +// swagger:model PowerPortTemplate +type PowerPortTemplate struct { + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this power port template +func (m *PowerPortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerPortTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *PowerPortTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PowerPortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerPortTemplate) UnmarshalBinary(b []byte) error { + var res PowerPortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/prefix.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/prefix.go new file mode 100644 index 0000000..a5ea409 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/prefix.go @@ -0,0 +1,295 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Prefix prefix +// swagger:model Prefix +type Prefix struct { + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Family + // Read Only: true + Family int64 `json:"family,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Is a pool + // + // All IP addresses within this prefix are considered usable + IsPool bool `json:"is_pool,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Prefix + // + // IPv4 or IPv6 network with mask + // Required: true + Prefix *string `json:"prefix"` + + // role + // Required: true + Role *NestedRole `json:"role"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // status + // Required: true + Status *PrefixStatus `json:"status"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` + + // vlan + // Required: true + Vlan *NestedVLAN `json:"vlan"` + + // vrf + // Required: true + Vrf *NestedVRF `json:"vrf"` +} + +// Validate validates this prefix +func (m *Prefix) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrefix(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVlan(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVrf(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Prefix) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *Prefix) validatePrefix(formats strfmt.Registry) error { + + if err := validate.Required("prefix", "body", m.Prefix); err != nil { + return err + } + + return nil +} + +func (m *Prefix) validateRole(formats strfmt.Registry) error { + + if err := validate.Required("role", "body", m.Role); err != nil { + return err + } + + if m.Role != nil { + + if err := m.Role.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("role") + } + return err + } + } + + return nil +} + +func (m *Prefix) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *Prefix) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + if m.Status != nil { + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *Prefix) validateTenant(formats strfmt.Registry) error { + + if err := validate.Required("tenant", "body", m.Tenant); err != nil { + return err + } + + if m.Tenant != nil { + + if err := m.Tenant.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } + return err + } + } + + return nil +} + +func (m *Prefix) validateVlan(formats strfmt.Registry) error { + + if err := validate.Required("vlan", "body", m.Vlan); err != nil { + return err + } + + if m.Vlan != nil { + + if err := m.Vlan.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vlan") + } + return err + } + } + + return nil +} + +func (m *Prefix) validateVrf(formats strfmt.Registry) error { + + if err := validate.Required("vrf", "body", m.Vrf); err != nil { + return err + } + + if m.Vrf != nil { + + if err := m.Vrf.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vrf") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Prefix) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Prefix) UnmarshalBinary(b []byte) error { + var res Prefix + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/prefix_status.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/prefix_status.go new file mode 100644 index 0000000..15c2528 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/prefix_status.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PrefixStatus Status +// swagger:model prefixStatus +type PrefixStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this prefix status +func (m *PrefixStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PrefixStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *PrefixStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PrefixStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PrefixStatus) UnmarshalBinary(b []byte) error { + var res PrefixStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/provider.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/provider.go new file mode 100644 index 0000000..e3add7a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/provider.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Provider provider +// swagger:model Provider +type Provider struct { + + // Account number + // Max Length: 30 + Account string `json:"account,omitempty"` + + // Admin contact + AdminContact string `json:"admin_contact,omitempty"` + + // ASN + // Maximum: 4.294967295e+09 + // Minimum: 1 + Asn int64 `json:"asn,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // NOC contact + NocContact string `json:"noc_contact,omitempty"` + + // Portal + // Max Length: 200 + PortalURL strfmt.URI `json:"portal_url,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this provider +func (m *Provider) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateAsn(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePortalURL(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Provider) validateAccount(formats strfmt.Registry) error { + + if swag.IsZero(m.Account) { // not required + return nil + } + + if err := validate.MaxLength("account", "body", string(m.Account), 30); err != nil { + return err + } + + return nil +} + +func (m *Provider) validateAsn(formats strfmt.Registry) error { + + if swag.IsZero(m.Asn) { // not required + return nil + } + + if err := validate.MinimumInt("asn", "body", int64(m.Asn), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("asn", "body", int64(m.Asn), 4.294967295e+09, false); err != nil { + return err + } + + return nil +} + +func (m *Provider) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *Provider) validatePortalURL(formats strfmt.Registry) error { + + if swag.IsZero(m.PortalURL) { // not required + return nil + } + + if err := validate.MaxLength("portal_url", "body", string(m.PortalURL), 200); err != nil { + return err + } + + if err := validate.FormatOf("portal_url", "body", "uri", m.PortalURL.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Provider) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Provider) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Provider) UnmarshalBinary(b []byte) error { + var res Provider + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack.go new file mode 100644 index 0000000..539df81 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack.go @@ -0,0 +1,351 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Rack rack +// swagger:model Rack +type Rack struct { + + // Comments + Comments string `json:"comments,omitempty"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Descending units + // + // Units are numbered top-to-bottom + DescUnits bool `json:"desc_units,omitempty"` + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + + // Facility ID + // Required: true + // Max Length: 50 + FacilityID *string `json:"facility_id"` + + // group + // Required: true + Group *NestedRackGroup `json:"group"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // role + // Required: true + Role *NestedRackRole `json:"role"` + + // Serial number + // Max Length: 50 + Serial string `json:"serial,omitempty"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` + + // type + // Required: true + Type *RackType `json:"type"` + + // Height (U) + // Maximum: 100 + // Minimum: 1 + UHeight int64 `json:"u_height,omitempty"` + + // width + // Required: true + Width *RackWidth `json:"width"` +} + +// Validate validates this rack +func (m *Rack) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFacilityID(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateGroup(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSerial(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUHeight(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateWidth(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Rack) validateFacilityID(formats strfmt.Registry) error { + + if err := validate.Required("facility_id", "body", m.FacilityID); err != nil { + return err + } + + if err := validate.MaxLength("facility_id", "body", string(*m.FacilityID), 50); err != nil { + return err + } + + return nil +} + +func (m *Rack) 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") + } + return err + } + } + + return nil +} + +func (m *Rack) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *Rack) validateRole(formats strfmt.Registry) error { + + if err := validate.Required("role", "body", m.Role); err != nil { + return err + } + + if m.Role != nil { + + if err := m.Role.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("role") + } + return err + } + } + + return nil +} + +func (m *Rack) validateSerial(formats strfmt.Registry) error { + + if swag.IsZero(m.Serial) { // not required + return nil + } + + if err := validate.MaxLength("serial", "body", string(m.Serial), 50); err != nil { + return err + } + + return nil +} + +func (m *Rack) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *Rack) validateTenant(formats strfmt.Registry) error { + + if err := validate.Required("tenant", "body", m.Tenant); err != nil { + return err + } + + if m.Tenant != nil { + + if err := m.Tenant.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } + return err + } + } + + return nil +} + +func (m *Rack) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if m.Type != nil { + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + +func (m *Rack) validateUHeight(formats strfmt.Registry) error { + + if swag.IsZero(m.UHeight) { // not required + return nil + } + + if err := validate.MinimumInt("u_height", "body", int64(m.UHeight), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("u_height", "body", int64(m.UHeight), 100, false); err != nil { + return err + } + + return nil +} + +func (m *Rack) validateWidth(formats strfmt.Registry) error { + + if err := validate.Required("width", "body", m.Width); err != nil { + return err + } + + if m.Width != nil { + + if err := m.Width.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("width") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Rack) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Rack) UnmarshalBinary(b []byte) error { + var res Rack + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_group.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_group.go new file mode 100644 index 0000000..fadd59e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_group.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RackGroup rack group +// swagger:model RackGroup +type RackGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this rack group +func (m *RackGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RackGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *RackGroup) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *RackGroup) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RackGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RackGroup) UnmarshalBinary(b []byte) error { + var res RackGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_reservation.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_reservation.go new file mode 100644 index 0000000..6b0a1a2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_reservation.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RackReservation rack reservation +// swagger:model RackReservation +type RackReservation struct { + + // Created + // Read Only: true + Created strfmt.DateTime `json:"created,omitempty"` + + // Description + // Required: true + // Max Length: 100 + Description *string `json:"description"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // rack + // Required: true + Rack *NestedRack `json:"rack"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` + + // units + // Required: true + Units []*int64 `json:"units"` + + // user + // Required: true + User *NestedUser `json:"user"` +} + +// Validate validates this rack reservation +func (m *RackReservation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRack(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUnits(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUser(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RackReservation) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + if err := validate.MaxLength("description", "body", string(*m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *RackReservation) validateRack(formats strfmt.Registry) error { + + if err := validate.Required("rack", "body", m.Rack); err != nil { + return err + } + + if m.Rack != nil { + + if err := m.Rack.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rack") + } + return err + } + } + + return nil +} + +func (m *RackReservation) validateTenant(formats strfmt.Registry) error { + + if err := validate.Required("tenant", "body", m.Tenant); err != nil { + return err + } + + if m.Tenant != nil { + + if err := m.Tenant.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } + return err + } + } + + return nil +} + +func (m *RackReservation) validateUnits(formats strfmt.Registry) error { + + if err := validate.Required("units", "body", m.Units); err != nil { + return err + } + + for i := 0; i < len(m.Units); i++ { + + if swag.IsZero(m.Units[i]) { // not required + continue + } + + if err := validate.MinimumInt("units"+"."+strconv.Itoa(i), "body", int64(*m.Units[i]), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("units"+"."+strconv.Itoa(i), "body", int64(*m.Units[i]), 32767, false); err != nil { + return err + } + + } + + return nil +} + +func (m *RackReservation) validateUser(formats strfmt.Registry) error { + + if err := validate.Required("user", "body", m.User); err != nil { + return err + } + + if m.User != nil { + + if err := m.User.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("user") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RackReservation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RackReservation) UnmarshalBinary(b []byte) error { + var res RackReservation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_role.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_role.go new file mode 100644 index 0000000..b0f6787 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_role.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RackRole rack role +// swagger:model RackRole +type RackRole struct { + + // Color + // Required: true + // Max Length: 6 + // Pattern: ^[0-9a-f]{6}$ + Color *string `json:"color"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this rack role +func (m *RackRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateColor(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RackRole) validateColor(formats strfmt.Registry) error { + + if err := validate.Required("color", "body", m.Color); err != nil { + return err + } + + if err := validate.MaxLength("color", "body", string(*m.Color), 6); err != nil { + return err + } + + if err := validate.Pattern("color", "body", string(*m.Color), `^[0-9a-f]{6}$`); err != nil { + return err + } + + return nil +} + +func (m *RackRole) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *RackRole) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RackRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RackRole) UnmarshalBinary(b []byte) error { + var res RackRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_type.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_type.go new file mode 100644 index 0000000..68259b5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_type.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RackType Type +// swagger:model rackType +type RackType struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this rack type +func (m *RackType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RackType) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *RackType) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RackType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RackType) UnmarshalBinary(b []byte) error { + var res RackType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_width.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_width.go new file mode 100644 index 0000000..9ccf06e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rack_width.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RackWidth Width +// swagger:model rackWidth +type RackWidth struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this rack width +func (m *RackWidth) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RackWidth) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *RackWidth) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RackWidth) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RackWidth) UnmarshalBinary(b []byte) error { + var res RackWidth + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/region.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/region.go new file mode 100644 index 0000000..08d951d --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/region.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Region region +// swagger:model Region +type Region struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // parent + // Required: true + Parent *NestedRegion `json:"parent"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this region +func (m *Region) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateParent(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Region) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *Region) validateParent(formats strfmt.Registry) error { + + if err := validate.Required("parent", "body", m.Parent); err != nil { + return err + } + + if m.Parent != nil { + + if err := m.Parent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } + return err + } + } + + return nil +} + +func (m *Region) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Region) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Region) UnmarshalBinary(b []byte) error { + var res Region + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rir.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rir.go new file mode 100644 index 0000000..16ddcc5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/rir.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RIR r i r +// swagger:model RIR +type RIR struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Private + // + // IP space managed by this RIR is considered private + IsPrivate bool `json:"is_private,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this r i r +func (m *RIR) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RIR) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *RIR) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RIR) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RIR) UnmarshalBinary(b []byte) error { + var res RIR + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/role.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/role.go new file mode 100644 index 0000000..dfc3fe8 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/role.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Role role +// swagger:model Role +type Role struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Weight + // Maximum: 32767 + // Minimum: 0 + Weight *int64 `json:"weight,omitempty"` +} + +// Validate validates this role +func (m *Role) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateWeight(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Role) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *Role) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +func (m *Role) validateWeight(formats strfmt.Registry) error { + + if swag.IsZero(m.Weight) { // not required + return nil + } + + if err := validate.MinimumInt("weight", "body", int64(*m.Weight), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("weight", "body", int64(*m.Weight), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Role) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Role) UnmarshalBinary(b []byte) error { + var res Role + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secret.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secret.go new file mode 100644 index 0000000..28320bf --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secret.go @@ -0,0 +1,160 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Secret secret +// swagger:model Secret +type Secret struct { + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // Hash + // Read Only: true + Hash string `json:"hash,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 100 + Name *string `json:"name"` + + // Plaintext + // Read Only: true + Plaintext string `json:"plaintext,omitempty"` + + // role + // Required: true + Role *NestedSecretRole `json:"role"` +} + +// Validate validates this secret +func (m *Secret) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Secret) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *Secret) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { + return err + } + + return nil +} + +func (m *Secret) validateRole(formats strfmt.Registry) error { + + if err := validate.Required("role", "body", m.Role); err != nil { + return err + } + + if m.Role != nil { + + if err := m.Role.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("role") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Secret) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Secret) UnmarshalBinary(b []byte) error { + var res Secret + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secret_role.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secret_role.go new file mode 100644 index 0000000..cf06bd3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secret_role.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SecretRole secret role +// swagger:model SecretRole +type SecretRole struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this secret role +func (m *SecretRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SecretRole) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *SecretRole) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SecretRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SecretRole) UnmarshalBinary(b []byte) error { + var res SecretRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secrets_secret_roles_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secrets_secret_roles_list_okbody.go new file mode 100644 index 0000000..5ffee8b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secrets_secret_roles_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SecretsSecretRolesListOKBody secrets secret roles list o k body +// swagger:model secretsSecretRolesListOKBody +type SecretsSecretRolesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results SecretsSecretRolesListOKBodyResults `json:"results"` +} + +// Validate validates this secrets secret roles list o k body +func (m *SecretsSecretRolesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SecretsSecretRolesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *SecretsSecretRolesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SecretsSecretRolesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SecretsSecretRolesListOKBody) UnmarshalBinary(b []byte) error { + var res SecretsSecretRolesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secrets_secret_roles_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secrets_secret_roles_list_okbody_results.go new file mode 100644 index 0000000..fcab8a5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secrets_secret_roles_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// SecretsSecretRolesListOKBodyResults secrets secret roles list o k body results +// swagger:model secretsSecretRolesListOKBodyResults +type SecretsSecretRolesListOKBodyResults []*SecretRole + +// Validate validates this secrets secret roles list o k body results +func (m SecretsSecretRolesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secrets_secrets_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secrets_secrets_list_okbody.go new file mode 100644 index 0000000..582eae5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secrets_secrets_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SecretsSecretsListOKBody secrets secrets list o k body +// swagger:model secretsSecretsListOKBody +type SecretsSecretsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results SecretsSecretsListOKBodyResults `json:"results"` +} + +// Validate validates this secrets secrets list o k body +func (m *SecretsSecretsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SecretsSecretsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *SecretsSecretsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SecretsSecretsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SecretsSecretsListOKBody) UnmarshalBinary(b []byte) error { + var res SecretsSecretsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secrets_secrets_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secrets_secrets_list_okbody_results.go new file mode 100644 index 0000000..5e61fe9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/secrets_secrets_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// SecretsSecretsListOKBodyResults secrets secrets list o k body results +// swagger:model secretsSecretsListOKBodyResults +type SecretsSecretsListOKBodyResults []*Secret + +// Validate validates this secrets secrets list o k body results +func (m SecretsSecretsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/service.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/service.go new file mode 100644 index 0000000..2a3ef99 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/service.go @@ -0,0 +1,255 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Service service +// swagger:model Service +type Service struct { + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // ipaddresses + // Required: true + Ipaddresses ServiceIpaddresses `json:"ipaddresses"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 30 + Name *string `json:"name"` + + // Port number + // Required: true + // Maximum: 65535 + // Minimum: 1 + Port *int64 `json:"port"` + + // protocol + // Required: true + Protocol *ServiceProtocol `json:"protocol"` + + // virtual machine + // Required: true + VirtualMachine *NestedVirtualMachine `json:"virtual_machine"` +} + +// Validate validates this service +func (m *Service) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateIpaddresses(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePort(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateProtocol(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVirtualMachine(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Service) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *Service) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *Service) validateIpaddresses(formats strfmt.Registry) error { + + if err := validate.Required("ipaddresses", "body", m.Ipaddresses); err != nil { + return err + } + + if err := m.Ipaddresses.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipaddresses") + } + return err + } + + return nil +} + +func (m *Service) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 30); err != nil { + return err + } + + return nil +} + +func (m *Service) validatePort(formats strfmt.Registry) error { + + if err := validate.Required("port", "body", m.Port); err != nil { + return err + } + + if err := validate.MinimumInt("port", "body", int64(*m.Port), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("port", "body", int64(*m.Port), 65535, false); err != nil { + return err + } + + return nil +} + +func (m *Service) validateProtocol(formats strfmt.Registry) error { + + if err := validate.Required("protocol", "body", m.Protocol); err != nil { + return err + } + + if m.Protocol != nil { + + if err := m.Protocol.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("protocol") + } + return err + } + } + + return nil +} + +func (m *Service) validateVirtualMachine(formats strfmt.Registry) error { + + if err := validate.Required("virtual_machine", "body", m.VirtualMachine); err != nil { + return err + } + + if m.VirtualMachine != nil { + + if err := m.VirtualMachine.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtual_machine") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Service) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Service) UnmarshalBinary(b []byte) error { + var res Service + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/service_ipaddresses.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/service_ipaddresses.go new file mode 100644 index 0000000..8cf99e7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/service_ipaddresses.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// ServiceIpaddresses service ipaddresses +// swagger:model serviceIpaddresses +type ServiceIpaddresses []*NestedIPAddress + +// Validate validates this service ipaddresses +func (m ServiceIpaddresses) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/service_protocol.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/service_protocol.go new file mode 100644 index 0000000..6701ce6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/service_protocol.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ServiceProtocol Protocol +// swagger:model serviceProtocol +type ServiceProtocol struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this service protocol +func (m *ServiceProtocol) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceProtocol) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *ServiceProtocol) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceProtocol) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceProtocol) UnmarshalBinary(b []byte) error { + var res ServiceProtocol + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/site.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/site.go new file mode 100644 index 0000000..6d4c0ce --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/site.go @@ -0,0 +1,422 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Site site +// swagger:model Site +type Site struct { + + // ASN + // Maximum: 4.294967295e+09 + // Minimum: 1 + Asn int64 `json:"asn,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Contact E-mail + // Max Length: 254 + ContactEmail strfmt.Email `json:"contact_email,omitempty"` + + // Contact name + // Max Length: 50 + ContactName string `json:"contact_name,omitempty"` + + // Contact phone + // Max Length: 20 + ContactPhone string `json:"contact_phone,omitempty"` + + // Count circuits + // Read Only: true + CountCircuits string `json:"count_circuits,omitempty"` + + // Count devices + // Read Only: true + CountDevices string `json:"count_devices,omitempty"` + + // Count prefixes + // Read Only: true + CountPrefixes string `json:"count_prefixes,omitempty"` + + // Count racks + // Read Only: true + CountRacks string `json:"count_racks,omitempty"` + + // Count vlans + // Read Only: true + CountVlans string `json:"count_vlans,omitempty"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Facility + // Max Length: 50 + Facility string `json:"facility,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Physical address + // Max Length: 200 + PhysicalAddress string `json:"physical_address,omitempty"` + + // region + // Required: true + Region *NestedRegion `json:"region"` + + // Shipping address + // Max Length: 200 + ShippingAddress string `json:"shipping_address,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // status + // Required: true + Status *SiteStatus `json:"status"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` + + // Time zone + TimeZone string `json:"time_zone,omitempty"` +} + +// Validate validates this site +func (m *Site) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAsn(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateContactEmail(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateContactName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateContactPhone(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFacility(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePhysicalAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRegion(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateShippingAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Site) validateAsn(formats strfmt.Registry) error { + + if swag.IsZero(m.Asn) { // not required + return nil + } + + if err := validate.MinimumInt("asn", "body", int64(m.Asn), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("asn", "body", int64(m.Asn), 4.294967295e+09, false); err != nil { + return err + } + + return nil +} + +func (m *Site) validateContactEmail(formats strfmt.Registry) error { + + if swag.IsZero(m.ContactEmail) { // not required + return nil + } + + if err := validate.MaxLength("contact_email", "body", string(m.ContactEmail), 254); err != nil { + return err + } + + if err := validate.FormatOf("contact_email", "body", "email", m.ContactEmail.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Site) validateContactName(formats strfmt.Registry) error { + + if swag.IsZero(m.ContactName) { // not required + return nil + } + + if err := validate.MaxLength("contact_name", "body", string(m.ContactName), 50); err != nil { + return err + } + + return nil +} + +func (m *Site) validateContactPhone(formats strfmt.Registry) error { + + if swag.IsZero(m.ContactPhone) { // not required + return nil + } + + if err := validate.MaxLength("contact_phone", "body", string(m.ContactPhone), 20); err != nil { + return err + } + + return nil +} + +func (m *Site) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *Site) validateFacility(formats strfmt.Registry) error { + + if swag.IsZero(m.Facility) { // not required + return nil + } + + if err := validate.MaxLength("facility", "body", string(m.Facility), 50); err != nil { + return err + } + + return nil +} + +func (m *Site) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *Site) validatePhysicalAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.PhysicalAddress) { // not required + return nil + } + + if err := validate.MaxLength("physical_address", "body", string(m.PhysicalAddress), 200); err != nil { + return err + } + + return nil +} + +func (m *Site) validateRegion(formats strfmt.Registry) error { + + if err := validate.Required("region", "body", m.Region); err != nil { + return err + } + + if m.Region != nil { + + if err := m.Region.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("region") + } + return err + } + } + + return nil +} + +func (m *Site) validateShippingAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.ShippingAddress) { // not required + return nil + } + + if err := validate.MaxLength("shipping_address", "body", string(m.ShippingAddress), 200); err != nil { + return err + } + + return nil +} + +func (m *Site) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +func (m *Site) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + if m.Status != nil { + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *Site) validateTenant(formats strfmt.Registry) error { + + if err := validate.Required("tenant", "body", m.Tenant); err != nil { + return err + } + + if m.Tenant != nil { + + if err := m.Tenant.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Site) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Site) UnmarshalBinary(b []byte) error { + var res Site + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/site_status.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/site_status.go new file mode 100644 index 0000000..1280836 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/site_status.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SiteStatus Status +// swagger:model siteStatus +type SiteStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this site status +func (m *SiteStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SiteStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *SiteStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SiteStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SiteStatus) UnmarshalBinary(b []byte) error { + var res SiteStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenancy_tenant_groups_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenancy_tenant_groups_list_okbody.go new file mode 100644 index 0000000..7409990 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenancy_tenant_groups_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TenancyTenantGroupsListOKBody tenancy tenant groups list o k body +// swagger:model tenancyTenantGroupsListOKBody +type TenancyTenantGroupsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results TenancyTenantGroupsListOKBodyResults `json:"results"` +} + +// Validate validates this tenancy tenant groups list o k body +func (m *TenancyTenantGroupsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TenancyTenantGroupsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *TenancyTenantGroupsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TenancyTenantGroupsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TenancyTenantGroupsListOKBody) UnmarshalBinary(b []byte) error { + var res TenancyTenantGroupsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenancy_tenant_groups_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenancy_tenant_groups_list_okbody_results.go new file mode 100644 index 0000000..02f25a7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenancy_tenant_groups_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// TenancyTenantGroupsListOKBodyResults tenancy tenant groups list o k body results +// swagger:model tenancyTenantGroupsListOKBodyResults +type TenancyTenantGroupsListOKBodyResults []*TenantGroup + +// Validate validates this tenancy tenant groups list o k body results +func (m TenancyTenantGroupsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenancy_tenants_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenancy_tenants_list_okbody.go new file mode 100644 index 0000000..664ae51 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenancy_tenants_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TenancyTenantsListOKBody tenancy tenants list o k body +// swagger:model tenancyTenantsListOKBody +type TenancyTenantsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results TenancyTenantsListOKBodyResults `json:"results"` +} + +// Validate validates this tenancy tenants list o k body +func (m *TenancyTenantsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TenancyTenantsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *TenancyTenantsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TenancyTenantsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TenancyTenantsListOKBody) UnmarshalBinary(b []byte) error { + var res TenancyTenantsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenancy_tenants_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenancy_tenants_list_okbody_results.go new file mode 100644 index 0000000..6573450 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenancy_tenants_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// TenancyTenantsListOKBodyResults tenancy tenants list o k body results +// swagger:model tenancyTenantsListOKBodyResults +type TenancyTenantsListOKBodyResults []*Tenant + +// Validate validates this tenancy tenants list o k body results +func (m TenancyTenantsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenant.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenant.go new file mode 100644 index 0000000..e3a4446 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenant.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Tenant tenant +// swagger:model Tenant +type Tenant struct { + + // Comments + Comments string `json:"comments,omitempty"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // + // Long-form name (optional) + // Max Length: 100 + Description string `json:"description,omitempty"` + + // group + // Required: true + Group *NestedTenantGroup `json:"group"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 30 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this tenant +func (m *Tenant) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateGroup(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Tenant) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *Tenant) 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") + } + return err + } + } + + return nil +} + +func (m *Tenant) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 30); err != nil { + return err + } + + return nil +} + +func (m *Tenant) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Tenant) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Tenant) UnmarshalBinary(b []byte) error { + var res Tenant + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenant_group.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenant_group.go new file mode 100644 index 0000000..4ca8b30 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/tenant_group.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TenantGroup tenant group +// swagger:model TenantGroup +type TenantGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this tenant group +func (m *TenantGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TenantGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *TenantGroup) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TenantGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TenantGroup) UnmarshalBinary(b []byte) error { + var res TenantGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/topology_map.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/topology_map.go new file mode 100644 index 0000000..e338136 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/topology_map.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TopologyMap topology map +// swagger:model TopologyMap +type TopologyMap struct { + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Device patterns + // + // Identify devices to include in the diagram using regular expressions, one per line. Each line will result in a new tier of the drawing. Separate multiple regexes within a line using semicolons. Devices will be rendered in the order they are defined. + // Required: true + DevicePatterns *string `json:"device_patterns"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this topology map +func (m *TopologyMap) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevicePatterns(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TopologyMap) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *TopologyMap) validateDevicePatterns(formats strfmt.Registry) error { + + if err := validate.Required("device_patterns", "body", m.DevicePatterns); err != nil { + return err + } + + return nil +} + +func (m *TopologyMap) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *TopologyMap) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *TopologyMap) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TopologyMap) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TopologyMap) UnmarshalBinary(b []byte) error { + var res TopologyMap + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/user_action.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/user_action.go new file mode 100644 index 0000000..882b012 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/user_action.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UserAction user action +// swagger:model UserAction +type UserAction struct { + + // action + // Required: true + Action *UserActionAction `json:"action"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Message + Message string `json:"message,omitempty"` + + // Time + // Read Only: true + Time strfmt.DateTime `json:"time,omitempty"` + + // user + // Required: true + User *NestedUser `json:"user"` +} + +// Validate validates this user action +func (m *UserAction) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAction(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUser(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UserAction) validateAction(formats strfmt.Registry) error { + + if err := validate.Required("action", "body", m.Action); err != nil { + return err + } + + if m.Action != nil { + + if err := m.Action.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("action") + } + return err + } + } + + return nil +} + +func (m *UserAction) validateUser(formats strfmt.Registry) error { + + if err := validate.Required("user", "body", m.User); err != nil { + return err + } + + if m.User != nil { + + if err := m.User.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("user") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UserAction) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UserAction) UnmarshalBinary(b []byte) error { + var res UserAction + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/user_action_action.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/user_action_action.go new file mode 100644 index 0000000..8679750 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/user_action_action.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UserActionAction Action +// swagger:model userActionAction +type UserActionAction struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this user action action +func (m *UserActionAction) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UserActionAction) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *UserActionAction) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UserActionAction) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UserActionAction) UnmarshalBinary(b []byte) error { + var res UserActionAction + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtual_chassis.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtual_chassis.go new file mode 100644 index 0000000..be46fe9 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtual_chassis.go @@ -0,0 +1,115 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VirtualChassis virtual chassis +// swagger:model VirtualChassis +type VirtualChassis struct { + + // Domain + // Max Length: 30 + Domain string `json:"domain,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // master + // Required: true + Master *NestedDevice `json:"master"` +} + +// Validate validates this virtual chassis +func (m *VirtualChassis) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDomain(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateMaster(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualChassis) validateDomain(formats strfmt.Registry) error { + + if swag.IsZero(m.Domain) { // not required + return nil + } + + if err := validate.MaxLength("domain", "body", string(m.Domain), 30); err != nil { + return err + } + + return nil +} + +func (m *VirtualChassis) validateMaster(formats strfmt.Registry) error { + + if err := validate.Required("master", "body", m.Master); err != nil { + return err + } + + if m.Master != nil { + + if err := m.Master.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("master") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualChassis) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualChassis) UnmarshalBinary(b []byte) error { + var res VirtualChassis + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtual_machine.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtual_machine.go new file mode 100644 index 0000000..b850193 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtual_machine.go @@ -0,0 +1,407 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VirtualMachine virtual machine +// swagger:model VirtualMachine +type VirtualMachine struct { + + // cluster + // Required: true + Cluster *NestedCluster `json:"cluster"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Disk (GB) + // Maximum: 2.147483647e+09 + // Minimum: 0 + Disk *int64 `json:"disk,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Memory (MB) + // Maximum: 2.147483647e+09 + // Minimum: 0 + Memory *int64 `json:"memory,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // platform + // Required: true + Platform *NestedPlatform `json:"platform"` + + // primary ip + // Required: true + PrimaryIP *VirtualMachineIPAddress `json:"primary_ip"` + + // primary ip4 + // Required: true + PrimaryIp4 *VirtualMachineIPAddress `json:"primary_ip4"` + + // primary ip6 + // Required: true + PrimaryIp6 *VirtualMachineIPAddress `json:"primary_ip6"` + + // role + // Required: true + Role *NestedDeviceRole `json:"role"` + + // status + // Required: true + Status *VirtualMachineStatus `json:"status"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` + + // VCPUs + // Maximum: 32767 + // Minimum: 0 + Vcpus *int64 `json:"vcpus,omitempty"` +} + +// Validate validates this virtual machine +func (m *VirtualMachine) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCluster(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDisk(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateMemory(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePlatform(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrimaryIP(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrimaryIp4(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrimaryIp6(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVcpus(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualMachine) validateCluster(formats strfmt.Registry) error { + + if err := validate.Required("cluster", "body", m.Cluster); err != nil { + return err + } + + if m.Cluster != nil { + + if err := m.Cluster.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster") + } + return err + } + } + + return nil +} + +func (m *VirtualMachine) validateDisk(formats strfmt.Registry) error { + + if swag.IsZero(m.Disk) { // not required + return nil + } + + if err := validate.MinimumInt("disk", "body", int64(*m.Disk), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("disk", "body", int64(*m.Disk), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *VirtualMachine) validateMemory(formats strfmt.Registry) error { + + if swag.IsZero(m.Memory) { // not required + return nil + } + + if err := validate.MinimumInt("memory", "body", int64(*m.Memory), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("memory", "body", int64(*m.Memory), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *VirtualMachine) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *VirtualMachine) validatePlatform(formats strfmt.Registry) error { + + if err := validate.Required("platform", "body", m.Platform); err != nil { + return err + } + + if m.Platform != nil { + + if err := m.Platform.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("platform") + } + return err + } + } + + return nil +} + +func (m *VirtualMachine) validatePrimaryIP(formats strfmt.Registry) error { + + if err := validate.Required("primary_ip", "body", m.PrimaryIP); err != nil { + return err + } + + if m.PrimaryIP != nil { + + if err := m.PrimaryIP.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("primary_ip") + } + return err + } + } + + return nil +} + +func (m *VirtualMachine) validatePrimaryIp4(formats strfmt.Registry) error { + + if err := validate.Required("primary_ip4", "body", m.PrimaryIp4); err != nil { + return err + } + + if m.PrimaryIp4 != nil { + + if err := m.PrimaryIp4.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("primary_ip4") + } + return err + } + } + + return nil +} + +func (m *VirtualMachine) validatePrimaryIp6(formats strfmt.Registry) error { + + if err := validate.Required("primary_ip6", "body", m.PrimaryIp6); err != nil { + return err + } + + if m.PrimaryIp6 != nil { + + if err := m.PrimaryIp6.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("primary_ip6") + } + return err + } + } + + return nil +} + +func (m *VirtualMachine) validateRole(formats strfmt.Registry) error { + + if err := validate.Required("role", "body", m.Role); err != nil { + return err + } + + if m.Role != nil { + + if err := m.Role.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("role") + } + return err + } + } + + return nil +} + +func (m *VirtualMachine) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + if m.Status != nil { + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *VirtualMachine) validateTenant(formats strfmt.Registry) error { + + if err := validate.Required("tenant", "body", m.Tenant); err != nil { + return err + } + + if m.Tenant != nil { + + if err := m.Tenant.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } + return err + } + } + + return nil +} + +func (m *VirtualMachine) validateVcpus(formats strfmt.Registry) error { + + if swag.IsZero(m.Vcpus) { // not required + return nil + } + + if err := validate.MinimumInt("vcpus", "body", int64(*m.Vcpus), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("vcpus", "body", int64(*m.Vcpus), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualMachine) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualMachine) UnmarshalBinary(b []byte) error { + var res VirtualMachine + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtual_machine_ip_address.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtual_machine_ip_address.go new file mode 100644 index 0000000..240a8e2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtual_machine_ip_address.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VirtualMachineIPAddress Primary ip +// swagger:model VirtualMachineIPAddress +type VirtualMachineIPAddress struct { + + // Address + // + // IPv4 or IPv6 address (with mask) + // Required: true + Address *string `json:"address"` + + // Family + // Read Only: true + Family int64 `json:"family,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this virtual machine IP address +func (m *VirtualMachineIPAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualMachineIPAddress) validateAddress(formats strfmt.Registry) error { + + if err := validate.Required("address", "body", m.Address); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualMachineIPAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualMachineIPAddress) UnmarshalBinary(b []byte) error { + var res VirtualMachineIPAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtual_machine_status.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtual_machine_status.go new file mode 100644 index 0000000..462fd4f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtual_machine_status.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VirtualMachineStatus Status +// swagger:model virtualMachineStatus +type VirtualMachineStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this virtual machine status +func (m *VirtualMachineStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualMachineStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *VirtualMachineStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualMachineStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualMachineStatus) UnmarshalBinary(b []byte) error { + var res VirtualMachineStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_cluster_groups_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_cluster_groups_list_okbody.go new file mode 100644 index 0000000..3cb5e60 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_cluster_groups_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VirtualizationClusterGroupsListOKBody virtualization cluster groups list o k body +// swagger:model virtualizationClusterGroupsListOKBody +type VirtualizationClusterGroupsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results VirtualizationClusterGroupsListOKBodyResults `json:"results"` +} + +// Validate validates this virtualization cluster groups list o k body +func (m *VirtualizationClusterGroupsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualizationClusterGroupsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *VirtualizationClusterGroupsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualizationClusterGroupsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualizationClusterGroupsListOKBody) UnmarshalBinary(b []byte) error { + var res VirtualizationClusterGroupsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_cluster_groups_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_cluster_groups_list_okbody_results.go new file mode 100644 index 0000000..8dd968e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_cluster_groups_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// VirtualizationClusterGroupsListOKBodyResults virtualization cluster groups list o k body results +// swagger:model virtualizationClusterGroupsListOKBodyResults +type VirtualizationClusterGroupsListOKBodyResults []*ClusterGroup + +// Validate validates this virtualization cluster groups list o k body results +func (m VirtualizationClusterGroupsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_cluster_types_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_cluster_types_list_okbody.go new file mode 100644 index 0000000..96f6528 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_cluster_types_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VirtualizationClusterTypesListOKBody virtualization cluster types list o k body +// swagger:model virtualizationClusterTypesListOKBody +type VirtualizationClusterTypesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results VirtualizationClusterTypesListOKBodyResults `json:"results"` +} + +// Validate validates this virtualization cluster types list o k body +func (m *VirtualizationClusterTypesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualizationClusterTypesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *VirtualizationClusterTypesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualizationClusterTypesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualizationClusterTypesListOKBody) UnmarshalBinary(b []byte) error { + var res VirtualizationClusterTypesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_cluster_types_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_cluster_types_list_okbody_results.go new file mode 100644 index 0000000..aac33c7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_cluster_types_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// VirtualizationClusterTypesListOKBodyResults virtualization cluster types list o k body results +// swagger:model virtualizationClusterTypesListOKBodyResults +type VirtualizationClusterTypesListOKBodyResults []*ClusterType + +// Validate validates this virtualization cluster types list o k body results +func (m VirtualizationClusterTypesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_clusters_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_clusters_list_okbody.go new file mode 100644 index 0000000..f36c19f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_clusters_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VirtualizationClustersListOKBody virtualization clusters list o k body +// swagger:model virtualizationClustersListOKBody +type VirtualizationClustersListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results VirtualizationClustersListOKBodyResults `json:"results"` +} + +// Validate validates this virtualization clusters list o k body +func (m *VirtualizationClustersListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualizationClustersListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *VirtualizationClustersListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualizationClustersListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualizationClustersListOKBody) UnmarshalBinary(b []byte) error { + var res VirtualizationClustersListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_clusters_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_clusters_list_okbody_results.go new file mode 100644 index 0000000..f562a93 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_clusters_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// VirtualizationClustersListOKBodyResults virtualization clusters list o k body results +// swagger:model virtualizationClustersListOKBodyResults +type VirtualizationClustersListOKBodyResults []*Cluster + +// Validate validates this virtualization clusters list o k body results +func (m VirtualizationClustersListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_interfaces_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_interfaces_list_okbody.go new file mode 100644 index 0000000..58ed446 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_interfaces_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VirtualizationInterfacesListOKBody virtualization interfaces list o k body +// swagger:model virtualizationInterfacesListOKBody +type VirtualizationInterfacesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results VirtualizationInterfacesListOKBodyResults `json:"results"` +} + +// Validate validates this virtualization interfaces list o k body +func (m *VirtualizationInterfacesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualizationInterfacesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *VirtualizationInterfacesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualizationInterfacesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualizationInterfacesListOKBody) UnmarshalBinary(b []byte) error { + var res VirtualizationInterfacesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_interfaces_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_interfaces_list_okbody_results.go new file mode 100644 index 0000000..7974f6a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_interfaces_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// VirtualizationInterfacesListOKBodyResults virtualization interfaces list o k body results +// swagger:model virtualizationInterfacesListOKBodyResults +type VirtualizationInterfacesListOKBodyResults []*Interface + +// Validate validates this virtualization interfaces list o k body results +func (m VirtualizationInterfacesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_virtual_machines_list_okbody.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_virtual_machines_list_okbody.go new file mode 100644 index 0000000..18fa88b --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_virtual_machines_list_okbody.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VirtualizationVirtualMachinesListOKBody virtualization virtual machines list o k body +// swagger:model virtualizationVirtualMachinesListOKBody +type VirtualizationVirtualMachinesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results VirtualizationVirtualMachinesListOKBodyResults `json:"results"` +} + +// Validate validates this virtualization virtual machines list o k body +func (m *VirtualizationVirtualMachinesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualizationVirtualMachinesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *VirtualizationVirtualMachinesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualizationVirtualMachinesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualizationVirtualMachinesListOKBody) UnmarshalBinary(b []byte) error { + var res VirtualizationVirtualMachinesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_virtual_machines_list_okbody_results.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_virtual_machines_list_okbody_results.go new file mode 100644 index 0000000..874c63a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/virtualization_virtual_machines_list_okbody_results.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// VirtualizationVirtualMachinesListOKBodyResults virtualization virtual machines list o k body results +// swagger:model virtualizationVirtualMachinesListOKBodyResults +type VirtualizationVirtualMachinesListOKBodyResults []*VirtualMachine + +// Validate validates this virtualization virtual machines list o k body results +func (m VirtualizationVirtualMachinesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/vlan.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/vlan.go new file mode 100644 index 0000000..b12091a --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/vlan.go @@ -0,0 +1,293 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VLAN v l a n +// swagger:model VLAN +type VLAN struct { + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + + // group + // Required: true + Group *NestedVLANGroup `json:"group"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // role + // Required: true + Role *NestedRole `json:"role"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // status + // Required: true + Status *VLANStatus `json:"status"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` + + // ID + // Required: true + // Maximum: 4094 + // Minimum: 1 + Vid *int64 `json:"vid"` +} + +// Validate validates this v l a n +func (m *VLAN) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateGroup(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVid(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VLAN) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *VLAN) 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") + } + return err + } + } + + return nil +} + +func (m *VLAN) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *VLAN) validateRole(formats strfmt.Registry) error { + + if err := validate.Required("role", "body", m.Role); err != nil { + return err + } + + if m.Role != nil { + + if err := m.Role.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("role") + } + return err + } + } + + return nil +} + +func (m *VLAN) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *VLAN) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + if m.Status != nil { + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *VLAN) validateTenant(formats strfmt.Registry) error { + + if err := validate.Required("tenant", "body", m.Tenant); err != nil { + return err + } + + if m.Tenant != nil { + + if err := m.Tenant.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } + return err + } + } + + return nil +} + +func (m *VLAN) validateVid(formats strfmt.Registry) error { + + if err := validate.Required("vid", "body", m.Vid); err != nil { + return err + } + + if err := validate.MinimumInt("vid", "body", int64(*m.Vid), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("vid", "body", int64(*m.Vid), 4094, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VLAN) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VLAN) UnmarshalBinary(b []byte) error { + var res VLAN + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/vlangroup.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/vlangroup.go new file mode 100644 index 0000000..8014aaf --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/vlangroup.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VLANGroup v l a n group +// swagger:model VLANGroup +type VLANGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this v l a n group +func (m *VLANGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VLANGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *VLANGroup) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *VLANGroup) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VLANGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VLANGroup) UnmarshalBinary(b []byte) error { + var res VLANGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/vlanstatus.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/vlanstatus.go new file mode 100644 index 0000000..46466c2 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/vlanstatus.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VLANStatus Status +// swagger:model vLANStatus +type VLANStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this v l a n status +func (m *VLANStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VLANStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *VLANStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VLANStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VLANStatus) UnmarshalBinary(b []byte) error { + var res VLANStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/vrf.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/vrf.go new file mode 100644 index 0000000..d172ea0 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/vrf.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VRF v r f +// swagger:model VRF +type VRF struct { + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + + // Enforce unique space + // + // Prevent duplicate prefixes/IP addresses within this VRF + EnforceUnique bool `json:"enforce_unique,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Route distinguisher + // Required: true + // Max Length: 21 + Rd *string `json:"rd"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` +} + +// Validate validates this v r f +func (m *VRF) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRd(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VRF) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *VRF) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *VRF) validateRd(formats strfmt.Registry) error { + + if err := validate.Required("rd", "body", m.Rd); err != nil { + return err + } + + if err := validate.MaxLength("rd", "body", string(*m.Rd), 21); err != nil { + return err + } + + return nil +} + +func (m *VRF) validateTenant(formats strfmt.Registry) error { + + if err := validate.Required("tenant", "body", m.Tenant); err != nil { + return err + } + + if m.Tenant != nil { + + if err := m.Tenant.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VRF) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VRF) UnmarshalBinary(b []byte) error { + var res VRF + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_aggregate.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_aggregate.go new file mode 100644 index 0000000..7f2de13 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_aggregate.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableAggregate writable aggregate +// swagger:model WritableAggregate +type WritableAggregate struct { + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Date added + DateAdded strfmt.Date `json:"date_added,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Prefix + // Required: true + Prefix *string `json:"prefix"` + + // RIR + // Required: true + Rir *int64 `json:"rir"` +} + +// Validate validates this writable aggregate +func (m *WritableAggregate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrefix(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRir(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableAggregate) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableAggregate) validatePrefix(formats strfmt.Registry) error { + + if err := validate.Required("prefix", "body", m.Prefix); err != nil { + return err + } + + return nil +} + +func (m *WritableAggregate) validateRir(formats strfmt.Registry) error { + + if err := validate.Required("rir", "body", m.Rir); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableAggregate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableAggregate) UnmarshalBinary(b []byte) error { + var res WritableAggregate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_circuit.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_circuit.go new file mode 100644 index 0000000..d0a92cc --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_circuit.go @@ -0,0 +1,237 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableCircuit writable circuit +// swagger:model WritableCircuit +type WritableCircuit struct { + + // Circuit ID + // Required: true + // Max Length: 50 + Cid *string `json:"cid"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Commit rate (Kbps) + // Maximum: 2.147483647e+09 + // Minimum: 0 + CommitRate *int64 `json:"commit_rate,omitempty"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Date installed + InstallDate strfmt.Date `json:"install_date,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Provider + // Required: true + Provider *int64 `json:"provider"` + + // Status + Status int64 `json:"status,omitempty"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` + + // Type + // Required: true + Type *int64 `json:"type"` +} + +// Validate validates this writable circuit +func (m *WritableCircuit) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCid(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateCommitRate(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateProvider(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableCircuit) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + if err := validate.MaxLength("cid", "body", string(*m.Cid), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuit) validateCommitRate(formats strfmt.Registry) error { + + if swag.IsZero(m.CommitRate) { // not required + return nil + } + + if err := validate.MinimumInt("commit_rate", "body", int64(*m.CommitRate), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("commit_rate", "body", int64(*m.CommitRate), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuit) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuit) validateProvider(formats strfmt.Registry) error { + + if err := validate.Required("provider", "body", m.Provider); err != nil { + return err + } + + return nil +} + +var writableCircuitTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[2,3,1,4,0,5]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableCircuitTypeStatusPropEnum = append(writableCircuitTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableCircuit) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableCircuitTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableCircuit) 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 *WritableCircuit) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableCircuit) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableCircuit) UnmarshalBinary(b []byte) error { + var res WritableCircuit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_circuit_termination.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_circuit_termination.go new file mode 100644 index 0000000..cb837e4 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_circuit_termination.go @@ -0,0 +1,257 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableCircuitTermination writable circuit termination +// swagger:model WritableCircuitTermination +type WritableCircuitTermination struct { + + // Circuit + // Required: true + Circuit *int64 `json:"circuit"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Interface + Interface int64 `json:"interface,omitempty"` + + // Port speed (Kbps) + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + PortSpeed *int64 `json:"port_speed"` + + // Patch panel/port(s) + // Max Length: 100 + PpInfo string `json:"pp_info,omitempty"` + + // Site + // Required: true + Site *int64 `json:"site"` + + // Termination + // Required: true + TermSide *string `json:"term_side"` + + // Upstream speed (Kbps) + // + // Upstream speed, if different from port speed + // Maximum: 2.147483647e+09 + // Minimum: 0 + UpstreamSpeed *int64 `json:"upstream_speed,omitempty"` + + // Cross-connect ID + // Max Length: 50 + XconnectID string `json:"xconnect_id,omitempty"` +} + +// Validate validates this writable circuit termination +func (m *WritableCircuitTermination) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCircuit(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePortSpeed(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePpInfo(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTermSide(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUpstreamSpeed(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateXconnectID(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableCircuitTermination) validateCircuit(formats strfmt.Registry) error { + + if err := validate.Required("circuit", "body", m.Circuit); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuitTermination) validatePortSpeed(formats strfmt.Registry) error { + + if err := validate.Required("port_speed", "body", m.PortSpeed); err != nil { + return err + } + + if err := validate.MinimumInt("port_speed", "body", int64(*m.PortSpeed), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("port_speed", "body", int64(*m.PortSpeed), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuitTermination) validatePpInfo(formats strfmt.Registry) error { + + if swag.IsZero(m.PpInfo) { // not required + return nil + } + + if err := validate.MaxLength("pp_info", "body", string(m.PpInfo), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuitTermination) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + return nil +} + +var writableCircuitTerminationTypeTermSidePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["A","Z"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableCircuitTerminationTypeTermSidePropEnum = append(writableCircuitTerminationTypeTermSidePropEnum, v) + } +} + +const ( + // WritableCircuitTerminationTermSideA captures enum value "A" + WritableCircuitTerminationTermSideA string = "A" + // WritableCircuitTerminationTermSideZ captures enum value "Z" + WritableCircuitTerminationTermSideZ string = "Z" +) + +// prop value enum +func (m *WritableCircuitTermination) validateTermSideEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, writableCircuitTerminationTypeTermSidePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableCircuitTermination) validateTermSide(formats strfmt.Registry) error { + + if err := validate.Required("term_side", "body", m.TermSide); err != nil { + return err + } + + // value enum + if err := m.validateTermSideEnum("term_side", "body", *m.TermSide); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuitTermination) validateUpstreamSpeed(formats strfmt.Registry) error { + + if swag.IsZero(m.UpstreamSpeed) { // not required + return nil + } + + if err := validate.MinimumInt("upstream_speed", "body", int64(*m.UpstreamSpeed), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("upstream_speed", "body", int64(*m.UpstreamSpeed), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuitTermination) validateXconnectID(formats strfmt.Registry) error { + + if swag.IsZero(m.XconnectID) { // not required + return nil + } + + if err := validate.MaxLength("xconnect_id", "body", string(m.XconnectID), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableCircuitTermination) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableCircuitTermination) UnmarshalBinary(b []byte) error { + var res WritableCircuitTermination + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_cluster.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_cluster.go new file mode 100644 index 0000000..03f05b6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_cluster.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableCluster writable cluster +// swagger:model WritableCluster +type WritableCluster struct { + + // Comments + Comments string `json:"comments,omitempty"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Group + Group int64 `json:"group,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 100 + Name *string `json:"name"` + + // Site + Site int64 `json:"site,omitempty"` + + // Type + // Required: true + Type *int64 `json:"type"` +} + +// Validate validates this writable cluster +func (m *WritableCluster) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableCluster) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableCluster) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableCluster) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableCluster) UnmarshalBinary(b []byte) error { + var res WritableCluster + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_console_port.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_console_port.go new file mode 100644 index 0000000..4c27c85 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_console_port.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableConsolePort writable console port +// swagger:model WritableConsolePort +type WritableConsolePort struct { + + // Connection status + ConnectionStatus bool `json:"connection_status,omitempty"` + + // Console server port + CsPort int64 `json:"cs_port,omitempty"` + + // Device + // Required: true + Device *int64 `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable console port +func (m *WritableConsolePort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConnectionStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var writableConsolePortTypeConnectionStatusPropEnum []interface{} + +func init() { + var res []bool + if err := json.Unmarshal([]byte(`[false,true]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableConsolePortTypeConnectionStatusPropEnum = append(writableConsolePortTypeConnectionStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableConsolePort) validateConnectionStatusEnum(path, location string, value bool) error { + if err := validate.Enum(path, location, value, writableConsolePortTypeConnectionStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableConsolePort) validateConnectionStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.ConnectionStatus) { // not required + return nil + } + + // value enum + if err := m.validateConnectionStatusEnum("connection_status", "body", m.ConnectionStatus); err != nil { + return err + } + + return nil +} + +func (m *WritableConsolePort) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +func (m *WritableConsolePort) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableConsolePort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableConsolePort) UnmarshalBinary(b []byte) error { + var res WritableConsolePort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_console_port_template.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_console_port_template.go new file mode 100644 index 0000000..ec34e44 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_console_port_template.go @@ -0,0 +1,106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableConsolePortTemplate writable console port template +// swagger:model WritableConsolePortTemplate +type WritableConsolePortTemplate struct { + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable console port template +func (m *WritableConsolePortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableConsolePortTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +func (m *WritableConsolePortTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableConsolePortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableConsolePortTemplate) UnmarshalBinary(b []byte) error { + var res WritableConsolePortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_console_server_port.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_console_server_port.go new file mode 100644 index 0000000..d060976 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_console_server_port.go @@ -0,0 +1,106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableConsoleServerPort writable console server port +// swagger:model WritableConsoleServerPort +type WritableConsoleServerPort struct { + + // Device + // Required: true + Device *int64 `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable console server port +func (m *WritableConsoleServerPort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableConsoleServerPort) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +func (m *WritableConsoleServerPort) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableConsoleServerPort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableConsoleServerPort) UnmarshalBinary(b []byte) error { + var res WritableConsoleServerPort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_console_server_port_template.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_console_server_port_template.go new file mode 100644 index 0000000..35e16a1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_console_server_port_template.go @@ -0,0 +1,106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableConsoleServerPortTemplate writable console server port template +// swagger:model WritableConsoleServerPortTemplate +type WritableConsoleServerPortTemplate struct { + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable console server port template +func (m *WritableConsoleServerPortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableConsoleServerPortTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +func (m *WritableConsoleServerPortTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableConsoleServerPortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableConsoleServerPortTemplate) UnmarshalBinary(b []byte) error { + var res WritableConsoleServerPortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_device.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_device.go new file mode 100644 index 0000000..a047d77 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_device.go @@ -0,0 +1,391 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableDevice writable device +// swagger:model WritableDevice +type WritableDevice struct { + + // Asset tag + // + // A unique tag used to identify this device + // Max Length: 50 + AssetTag string `json:"asset_tag,omitempty"` + + // Cluster + Cluster int64 `json:"cluster,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Device role + // Required: true + DeviceRole *int64 `json:"device_role"` + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // Rack face + Face int64 `json:"face,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Max Length: 64 + Name string `json:"name,omitempty"` + + // Platform + Platform int64 `json:"platform,omitempty"` + + // Position (U) + // + // The lowest-numbered unit occupied by the device + // Maximum: 32767 + // Minimum: 1 + Position int64 `json:"position,omitempty"` + + // Primary IPv4 + PrimaryIp4 int64 `json:"primary_ip4,omitempty"` + + // Primary IPv6 + PrimaryIp6 int64 `json:"primary_ip6,omitempty"` + + // Rack + Rack int64 `json:"rack,omitempty"` + + // Serial number + // Max Length: 50 + Serial string `json:"serial,omitempty"` + + // Site + // Required: true + Site *int64 `json:"site"` + + // Status + Status int64 `json:"status,omitempty"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` + + // Vc position + // Maximum: 255 + // Minimum: 0 + VcPosition *int64 `json:"vc_position,omitempty"` + + // Vc priority + // Maximum: 255 + // Minimum: 0 + VcPriority *int64 `json:"vc_priority,omitempty"` + + // Virtual chassis + VirtualChassis int64 `json:"virtual_chassis,omitempty"` +} + +// Validate validates this writable device +func (m *WritableDevice) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssetTag(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDeviceRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFace(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePosition(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSerial(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVcPosition(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVcPriority(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableDevice) validateAssetTag(formats strfmt.Registry) error { + + if swag.IsZero(m.AssetTag) { // not required + return nil + } + + if err := validate.MaxLength("asset_tag", "body", string(m.AssetTag), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableDevice) validateDeviceRole(formats strfmt.Registry) error { + + if err := validate.Required("device_role", "body", m.DeviceRole); err != nil { + return err + } + + return nil +} + +func (m *WritableDevice) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +var writableDeviceTypeFacePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[0,1]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableDeviceTypeFacePropEnum = append(writableDeviceTypeFacePropEnum, v) + } +} + +// prop value enum +func (m *WritableDevice) validateFaceEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableDeviceTypeFacePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableDevice) validateFace(formats strfmt.Registry) error { + + if swag.IsZero(m.Face) { // not required + return nil + } + + // value enum + if err := m.validateFaceEnum("face", "body", m.Face); err != nil { + return err + } + + return nil +} + +func (m *WritableDevice) validateName(formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := validate.MaxLength("name", "body", string(m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *WritableDevice) validatePosition(formats strfmt.Registry) error { + + if swag.IsZero(m.Position) { // not required + return nil + } + + if err := validate.MinimumInt("position", "body", int64(m.Position), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("position", "body", int64(m.Position), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *WritableDevice) validateSerial(formats strfmt.Registry) error { + + if swag.IsZero(m.Serial) { // not required + return nil + } + + if err := validate.MaxLength("serial", "body", string(m.Serial), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableDevice) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + return nil +} + +var writableDeviceTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,0,2,3,4,5]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableDeviceTypeStatusPropEnum = append(writableDeviceTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableDevice) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableDeviceTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableDevice) 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 *WritableDevice) validateVcPosition(formats strfmt.Registry) error { + + if swag.IsZero(m.VcPosition) { // not required + return nil + } + + if err := validate.MinimumInt("vc_position", "body", int64(*m.VcPosition), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("vc_position", "body", int64(*m.VcPosition), 255, false); err != nil { + return err + } + + return nil +} + +func (m *WritableDevice) validateVcPriority(formats strfmt.Registry) error { + + if swag.IsZero(m.VcPriority) { // not required + return nil + } + + if err := validate.MinimumInt("vc_priority", "body", int64(*m.VcPriority), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("vc_priority", "body", int64(*m.VcPriority), 255, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableDevice) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableDevice) UnmarshalBinary(b []byte) error { + var res WritableDevice + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_device_bay.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_device_bay.go new file mode 100644 index 0000000..e1caaee --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_device_bay.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableDeviceBay writable device bay +// swagger:model WritableDeviceBay +type WritableDeviceBay struct { + + // Device + // Required: true + Device *int64 `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Installed device + InstalledDevice int64 `json:"installed_device,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable device bay +func (m *WritableDeviceBay) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableDeviceBay) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceBay) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableDeviceBay) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableDeviceBay) UnmarshalBinary(b []byte) error { + var res WritableDeviceBay + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_device_bay_template.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_device_bay_template.go new file mode 100644 index 0000000..65148be --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_device_bay_template.go @@ -0,0 +1,106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableDeviceBayTemplate writable device bay template +// swagger:model WritableDeviceBayTemplate +type WritableDeviceBayTemplate struct { + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable device bay template +func (m *WritableDeviceBayTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableDeviceBayTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceBayTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableDeviceBayTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableDeviceBayTemplate) UnmarshalBinary(b []byte) error { + var res WritableDeviceBayTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_device_type.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_device_type.go new file mode 100644 index 0000000..68d1c69 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_device_type.go @@ -0,0 +1,299 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableDeviceType writable device type +// swagger:model WritableDeviceType +type WritableDeviceType struct { + + // Comments + Comments string `json:"comments,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Interface ordering + InterfaceOrdering int64 `json:"interface_ordering,omitempty"` + + // Is a console server + // + // This type of device has console server ports + IsConsoleServer bool `json:"is_console_server,omitempty"` + + // Is full depth + // + // Device consumes both front and rear rack faces + IsFullDepth bool `json:"is_full_depth,omitempty"` + + // Is a network device + // + // This type of device has network interfaces + IsNetworkDevice bool `json:"is_network_device,omitempty"` + + // Is a PDU + // + // This type of device has power outlets + IsPdu bool `json:"is_pdu,omitempty"` + + // Manufacturer + // Required: true + Manufacturer *int64 `json:"manufacturer"` + + // Model + // Required: true + // Max Length: 50 + Model *string `json:"model"` + + // Part number + // + // Discrete part number (optional) + // Max Length: 50 + PartNumber string `json:"part_number,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Parent/child status + // + // Parent devices house child devices in device bays. Select "None" if this device type is neither a parent nor a child. + SubdeviceRole *bool `json:"subdevice_role,omitempty"` + + // Height (U) + // Maximum: 32767 + // Minimum: 0 + UHeight *int64 `json:"u_height,omitempty"` +} + +// Validate validates this writable device type +func (m *WritableDeviceType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateInterfaceOrdering(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateManufacturer(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateModel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePartNumber(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSubdeviceRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUHeight(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var writableDeviceTypeTypeInterfaceOrderingPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,2]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableDeviceTypeTypeInterfaceOrderingPropEnum = append(writableDeviceTypeTypeInterfaceOrderingPropEnum, v) + } +} + +// prop value enum +func (m *WritableDeviceType) validateInterfaceOrderingEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableDeviceTypeTypeInterfaceOrderingPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableDeviceType) validateInterfaceOrdering(formats strfmt.Registry) error { + + if swag.IsZero(m.InterfaceOrdering) { // not required + return nil + } + + // value enum + if err := m.validateInterfaceOrderingEnum("interface_ordering", "body", m.InterfaceOrdering); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceType) validateManufacturer(formats strfmt.Registry) error { + + if err := validate.Required("manufacturer", "body", m.Manufacturer); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceType) validateModel(formats strfmt.Registry) error { + + if err := validate.Required("model", "body", m.Model); err != nil { + return err + } + + if err := validate.MaxLength("model", "body", string(*m.Model), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceType) validatePartNumber(formats strfmt.Registry) error { + + if swag.IsZero(m.PartNumber) { // not required + return nil + } + + if err := validate.MaxLength("part_number", "body", string(m.PartNumber), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceType) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +var writableDeviceTypeTypeSubdeviceRolePropEnum []interface{} + +func init() { + var res []bool + if err := json.Unmarshal([]byte(`[null,true,false]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableDeviceTypeTypeSubdeviceRolePropEnum = append(writableDeviceTypeTypeSubdeviceRolePropEnum, v) + } +} + +// prop value enum +func (m *WritableDeviceType) validateSubdeviceRoleEnum(path, location string, value bool) error { + if err := validate.Enum(path, location, value, writableDeviceTypeTypeSubdeviceRolePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableDeviceType) validateSubdeviceRole(formats strfmt.Registry) error { + + if swag.IsZero(m.SubdeviceRole) { // not required + return nil + } + + // value enum + if err := m.validateSubdeviceRoleEnum("subdevice_role", "body", *m.SubdeviceRole); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceType) validateUHeight(formats strfmt.Registry) error { + + if swag.IsZero(m.UHeight) { // not required + return nil + } + + if err := validate.MinimumInt("u_height", "body", int64(*m.UHeight), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("u_height", "body", int64(*m.UHeight), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableDeviceType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableDeviceType) UnmarshalBinary(b []byte) error { + var res WritableDeviceType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_graph.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_graph.go new file mode 100644 index 0000000..a986362 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_graph.go @@ -0,0 +1,209 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableGraph writable graph +// swagger:model WritableGraph +type WritableGraph struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Link URL + // Max Length: 200 + Link strfmt.URI `json:"link,omitempty"` + + // Name + // Required: true + // Max Length: 100 + Name *string `json:"name"` + + // Source URL + // Required: true + // Max Length: 500 + Source *string `json:"source"` + + // Type + // Required: true + Type *int64 `json:"type"` + + // Weight + // Maximum: 32767 + // Minimum: 0 + Weight *int64 `json:"weight,omitempty"` +} + +// Validate validates this writable graph +func (m *WritableGraph) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLink(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSource(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateWeight(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableGraph) validateLink(formats strfmt.Registry) error { + + if swag.IsZero(m.Link) { // not required + return nil + } + + if err := validate.MaxLength("link", "body", string(m.Link), 200); err != nil { + return err + } + + if err := validate.FormatOf("link", "body", "uri", m.Link.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableGraph) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableGraph) validateSource(formats strfmt.Registry) error { + + if err := validate.Required("source", "body", m.Source); err != nil { + return err + } + + if err := validate.MaxLength("source", "body", string(*m.Source), 500); err != nil { + return err + } + + return nil +} + +var writableGraphTypeTypePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[100,200,300]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableGraphTypeTypePropEnum = append(writableGraphTypeTypePropEnum, v) + } +} + +// prop value enum +func (m *WritableGraph) validateTypeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableGraphTypeTypePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableGraph) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +func (m *WritableGraph) validateWeight(formats strfmt.Registry) error { + + if swag.IsZero(m.Weight) { // not required + return nil + } + + if err := validate.MinimumInt("weight", "body", int64(*m.Weight), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("weight", "body", int64(*m.Weight), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableGraph) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableGraph) UnmarshalBinary(b []byte) error { + var res WritableGraph + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_image_attachment.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_image_attachment.go new file mode 100644 index 0000000..a2b0778 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_image_attachment.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableImageAttachment writable image attachment +// swagger:model WritableImageAttachment +type WritableImageAttachment struct { + + // Content type + // Required: true + ContentType *string `json:"content_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Image + // Required: true + // Read Only: true + Image strfmt.URI `json:"image"` + + // Name + // Max Length: 50 + Name string `json:"name,omitempty"` + + // Object id + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + ObjectID *int64 `json:"object_id"` +} + +// Validate validates this writable image attachment +func (m *WritableImageAttachment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContentType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateImage(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateObjectID(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableImageAttachment) validateContentType(formats strfmt.Registry) error { + + if err := validate.Required("content_type", "body", m.ContentType); err != nil { + return err + } + + return nil +} + +func (m *WritableImageAttachment) validateImage(formats strfmt.Registry) error { + + if err := validate.Required("image", "body", strfmt.URI(m.Image)); err != nil { + return err + } + + if err := validate.FormatOf("image", "body", "uri", m.Image.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableImageAttachment) validateName(formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableImageAttachment) 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", int64(*m.ObjectID), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("object_id", "body", int64(*m.ObjectID), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableImageAttachment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableImageAttachment) UnmarshalBinary(b []byte) error { + var res WritableImageAttachment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_interface.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_interface.go new file mode 100644 index 0000000..caa972f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_interface.go @@ -0,0 +1,280 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableInterface writable interface +// swagger:model WritableInterface +type WritableInterface struct { + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Device + // Required: true + Device *int64 `json:"device"` + + // Enabled + Enabled bool `json:"enabled,omitempty"` + + // Form factor + FormFactor int64 `json:"form_factor,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Parent LAG + Lag int64 `json:"lag,omitempty"` + + // MAC Address + MacAddress string `json:"mac_address,omitempty"` + + // OOB Management + // + // This interface is used only for out-of-band management + MgmtOnly bool `json:"mgmt_only,omitempty"` + + // Mode + Mode int64 `json:"mode,omitempty"` + + // MTU + // Maximum: 32767 + // Minimum: 0 + Mtu *int64 `json:"mtu,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // tagged vlans + // Unique: true + TaggedVlans []int64 `json:"tagged_vlans"` + + // Untagged VLAN + UntaggedVlan int64 `json:"untagged_vlan,omitempty"` +} + +// Validate validates this writable interface +func (m *WritableInterface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFormFactor(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateMode(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateMtu(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTaggedVlans(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableInterface) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableInterface) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +var writableInterfaceTypeFormFactorPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[0,200,800,1000,1150,1170,1050,1100,1200,1300,1310,1320,1350,1400,1500,1510,1520,1550,1600,2600,2610,2620,2630,2640,3010,3020,3040,3080,3160,4000,4010,4040,4050,5000,5050,5100,5150,5200,32767]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableInterfaceTypeFormFactorPropEnum = append(writableInterfaceTypeFormFactorPropEnum, v) + } +} + +// prop value enum +func (m *WritableInterface) validateFormFactorEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableInterfaceTypeFormFactorPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableInterface) validateFormFactor(formats strfmt.Registry) error { + + if swag.IsZero(m.FormFactor) { // not required + return nil + } + + // value enum + if err := m.validateFormFactorEnum("form_factor", "body", m.FormFactor); err != nil { + return err + } + + return nil +} + +var writableInterfaceTypeModePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[100,200,300]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableInterfaceTypeModePropEnum = append(writableInterfaceTypeModePropEnum, v) + } +} + +// prop value enum +func (m *WritableInterface) validateModeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableInterfaceTypeModePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableInterface) validateMode(formats strfmt.Registry) error { + + if swag.IsZero(m.Mode) { // not required + return nil + } + + // value enum + if err := m.validateModeEnum("mode", "body", m.Mode); err != nil { + return err + } + + return nil +} + +func (m *WritableInterface) validateMtu(formats strfmt.Registry) error { + + if swag.IsZero(m.Mtu) { // not required + return nil + } + + if err := validate.MinimumInt("mtu", "body", int64(*m.Mtu), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("mtu", "body", int64(*m.Mtu), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *WritableInterface) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *WritableInterface) validateTaggedVlans(formats strfmt.Registry) error { + + if swag.IsZero(m.TaggedVlans) { // not required + return nil + } + + if err := validate.UniqueItems("tagged_vlans", "body", m.TaggedVlans); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableInterface) UnmarshalBinary(b []byte) error { + var res WritableInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_interface_connection.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_interface_connection.go new file mode 100644 index 0000000..c650520 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_interface_connection.go @@ -0,0 +1,145 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableInterfaceConnection writable interface connection +// swagger:model WritableInterfaceConnection +type WritableInterfaceConnection struct { + + // Status + ConnectionStatus bool `json:"connection_status,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"` +} + +// Validate validates this writable interface connection +func (m *WritableInterfaceConnection) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConnectionStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateInterfaceA(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateInterfaceB(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var writableInterfaceConnectionTypeConnectionStatusPropEnum []interface{} + +func init() { + var res []bool + if err := json.Unmarshal([]byte(`[false,true]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableInterfaceConnectionTypeConnectionStatusPropEnum = append(writableInterfaceConnectionTypeConnectionStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableInterfaceConnection) validateConnectionStatusEnum(path, location string, value bool) error { + if err := validate.Enum(path, location, value, writableInterfaceConnectionTypeConnectionStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableInterfaceConnection) validateConnectionStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.ConnectionStatus) { // not required + return nil + } + + // value enum + if err := m.validateConnectionStatusEnum("connection_status", "body", m.ConnectionStatus); err != nil { + return err + } + + return nil +} + +func (m *WritableInterfaceConnection) validateInterfaceA(formats strfmt.Registry) error { + + if err := validate.Required("interface_a", "body", m.InterfaceA); err != nil { + return err + } + + return nil +} + +func (m *WritableInterfaceConnection) validateInterfaceB(formats strfmt.Registry) error { + + if err := validate.Required("interface_b", "body", m.InterfaceB); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableInterfaceConnection) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableInterfaceConnection) UnmarshalBinary(b []byte) error { + var res WritableInterfaceConnection + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_interface_template.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_interface_template.go new file mode 100644 index 0000000..2471de6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_interface_template.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableInterfaceTemplate writable interface template +// swagger:model WritableInterfaceTemplate +type WritableInterfaceTemplate struct { + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // Form factor + FormFactor int64 `json:"form_factor,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Management only + MgmtOnly bool `json:"mgmt_only,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` +} + +// Validate validates this writable interface template +func (m *WritableInterfaceTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFormFactor(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableInterfaceTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +var writableInterfaceTemplateTypeFormFactorPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[0,200,800,1000,1150,1170,1050,1100,1200,1300,1310,1320,1350,1400,1500,1510,1520,1550,1600,2600,2610,2620,2630,2640,3010,3020,3040,3080,3160,4000,4010,4040,4050,5000,5050,5100,5150,5200,32767]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableInterfaceTemplateTypeFormFactorPropEnum = append(writableInterfaceTemplateTypeFormFactorPropEnum, v) + } +} + +// prop value enum +func (m *WritableInterfaceTemplate) validateFormFactorEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableInterfaceTemplateTypeFormFactorPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableInterfaceTemplate) validateFormFactor(formats strfmt.Registry) error { + + if swag.IsZero(m.FormFactor) { // not required + return nil + } + + // value enum + if err := m.validateFormFactorEnum("form_factor", "body", m.FormFactor); err != nil { + return err + } + + return nil +} + +func (m *WritableInterfaceTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableInterfaceTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableInterfaceTemplate) UnmarshalBinary(b []byte) error { + var res WritableInterfaceTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_inventory_item.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_inventory_item.go new file mode 100644 index 0000000..bf646d6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_inventory_item.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableInventoryItem writable inventory item +// swagger:model WritableInventoryItem +type WritableInventoryItem struct { + + // Asset tag + // + // A unique tag used to identify this item + // Max Length: 50 + AssetTag string `json:"asset_tag,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Device + // Required: true + Device *int64 `json:"device"` + + // Discovered + Discovered bool `json:"discovered,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Manufacturer + Manufacturer int64 `json:"manufacturer,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Parent + Parent int64 `json:"parent,omitempty"` + + // Part ID + // Max Length: 50 + PartID string `json:"part_id,omitempty"` + + // Serial number + // Max Length: 50 + Serial string `json:"serial,omitempty"` +} + +// Validate validates this writable inventory item +func (m *WritableInventoryItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssetTag(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePartID(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSerial(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableInventoryItem) validateAssetTag(formats strfmt.Registry) error { + + if swag.IsZero(m.AssetTag) { // not required + return nil + } + + if err := validate.MaxLength("asset_tag", "body", string(m.AssetTag), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableInventoryItem) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableInventoryItem) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +func (m *WritableInventoryItem) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableInventoryItem) validatePartID(formats strfmt.Registry) error { + + if swag.IsZero(m.PartID) { // not required + return nil + } + + if err := validate.MaxLength("part_id", "body", string(m.PartID), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableInventoryItem) validateSerial(formats strfmt.Registry) error { + + if swag.IsZero(m.Serial) { // not required + return nil + } + + if err := validate.MaxLength("serial", "body", string(m.Serial), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableInventoryItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableInventoryItem) UnmarshalBinary(b []byte) error { + var res WritableInventoryItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_ip_address.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_ip_address.go new file mode 100644 index 0000000..c03f795 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_ip_address.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableIPAddress writable IP address +// swagger:model WritableIPAddress +type WritableIPAddress struct { + + // Address + // + // IPv4 or IPv6 address (with mask) + // Required: true + Address *string `json:"address"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Interface + Interface int64 `json:"interface,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // NAT (Inside) + // + // The IP for which this address is the "outside" IP + NatInside int64 `json:"nat_inside,omitempty"` + + // Role + // + // The functional role of this IP + Role int64 `json:"role,omitempty"` + + // Status + // + // The operational status of this IP + Status int64 `json:"status,omitempty"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` + + // VRF + Vrf int64 `json:"vrf,omitempty"` +} + +// Validate validates this writable IP address +func (m *WritableIPAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableIPAddress) validateAddress(formats strfmt.Registry) error { + + if err := validate.Required("address", "body", m.Address); err != nil { + return err + } + + return nil +} + +func (m *WritableIPAddress) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +var writableIpAddressTypeRolePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[10,20,30,40,41,42,43,44]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableIpAddressTypeRolePropEnum = append(writableIpAddressTypeRolePropEnum, v) + } +} + +// prop value enum +func (m *WritableIPAddress) validateRoleEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableIpAddressTypeRolePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableIPAddress) validateRole(formats strfmt.Registry) error { + + if swag.IsZero(m.Role) { // not required + return nil + } + + // value enum + if err := m.validateRoleEnum("role", "body", m.Role); err != nil { + return err + } + + return nil +} + +var writableIpAddressTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,2,3,5]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableIpAddressTypeStatusPropEnum = append(writableIpAddressTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableIPAddress) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableIpAddressTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableIPAddress) 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 +} + +// MarshalBinary interface implementation +func (m *WritableIPAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableIPAddress) UnmarshalBinary(b []byte) error { + var res WritableIPAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_platform.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_platform.go new file mode 100644 index 0000000..1b17784 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_platform.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritablePlatform writable platform +// swagger:model WritablePlatform +type WritablePlatform struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Manufacturer + // + // Optionally limit this platform to devices of a certain manufacturer + Manufacturer int64 `json:"manufacturer,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // NAPALM driver + // + // The name of the NAPALM driver to use when interacting with devices + // Max Length: 50 + NapalmDriver string `json:"napalm_driver,omitempty"` + + // Legacy RPC client + RPCClient string `json:"rpc_client,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this writable platform +func (m *WritablePlatform) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateNapalmDriver(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRPCClient(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritablePlatform) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *WritablePlatform) validateNapalmDriver(formats strfmt.Registry) error { + + if swag.IsZero(m.NapalmDriver) { // not required + return nil + } + + if err := validate.MaxLength("napalm_driver", "body", string(m.NapalmDriver), 50); err != nil { + return err + } + + return nil +} + +var writablePlatformTypeRPCClientPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["juniper-junos","cisco-ios","opengear"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writablePlatformTypeRPCClientPropEnum = append(writablePlatformTypeRPCClientPropEnum, v) + } +} + +const ( + // WritablePlatformRPCClientJuniperJunos captures enum value "juniper-junos" + WritablePlatformRPCClientJuniperJunos string = "juniper-junos" + // WritablePlatformRPCClientCiscoIos captures enum value "cisco-ios" + WritablePlatformRPCClientCiscoIos string = "cisco-ios" + // WritablePlatformRPCClientOpengear captures enum value "opengear" + WritablePlatformRPCClientOpengear string = "opengear" +) + +// prop value enum +func (m *WritablePlatform) validateRPCClientEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, writablePlatformTypeRPCClientPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritablePlatform) validateRPCClient(formats strfmt.Registry) error { + + if swag.IsZero(m.RPCClient) { // not required + return nil + } + + // value enum + if err := m.validateRPCClientEnum("rpc_client", "body", m.RPCClient); err != nil { + return err + } + + return nil +} + +func (m *WritablePlatform) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritablePlatform) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritablePlatform) UnmarshalBinary(b []byte) error { + var res WritablePlatform + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_power_outlet.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_power_outlet.go new file mode 100644 index 0000000..81896b1 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_power_outlet.go @@ -0,0 +1,106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritablePowerOutlet writable power outlet +// swagger:model WritablePowerOutlet +type WritablePowerOutlet struct { + + // Device + // Required: true + Device *int64 `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable power outlet +func (m *WritablePowerOutlet) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritablePowerOutlet) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerOutlet) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritablePowerOutlet) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritablePowerOutlet) UnmarshalBinary(b []byte) error { + var res WritablePowerOutlet + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_power_outlet_template.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_power_outlet_template.go new file mode 100644 index 0000000..7ac79b7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_power_outlet_template.go @@ -0,0 +1,106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritablePowerOutletTemplate writable power outlet template +// swagger:model WritablePowerOutletTemplate +type WritablePowerOutletTemplate struct { + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable power outlet template +func (m *WritablePowerOutletTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritablePowerOutletTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerOutletTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritablePowerOutletTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritablePowerOutletTemplate) UnmarshalBinary(b []byte) error { + var res WritablePowerOutletTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_power_port.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_power_port.go new file mode 100644 index 0000000..1e1ae59 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_power_port.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritablePowerPort writable power port +// swagger:model WritablePowerPort +type WritablePowerPort struct { + + // Connection status + ConnectionStatus bool `json:"connection_status,omitempty"` + + // Device + // Required: true + Device *int64 `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Power outlet + PowerOutlet int64 `json:"power_outlet,omitempty"` +} + +// Validate validates this writable power port +func (m *WritablePowerPort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConnectionStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var writablePowerPortTypeConnectionStatusPropEnum []interface{} + +func init() { + var res []bool + if err := json.Unmarshal([]byte(`[false,true]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writablePowerPortTypeConnectionStatusPropEnum = append(writablePowerPortTypeConnectionStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritablePowerPort) validateConnectionStatusEnum(path, location string, value bool) error { + if err := validate.Enum(path, location, value, writablePowerPortTypeConnectionStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritablePowerPort) validateConnectionStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.ConnectionStatus) { // not required + return nil + } + + // value enum + if err := m.validateConnectionStatusEnum("connection_status", "body", m.ConnectionStatus); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerPort) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerPort) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritablePowerPort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritablePowerPort) UnmarshalBinary(b []byte) error { + var res WritablePowerPort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_power_port_template.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_power_port_template.go new file mode 100644 index 0000000..511a277 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_power_port_template.go @@ -0,0 +1,106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritablePowerPortTemplate writable power port template +// swagger:model WritablePowerPortTemplate +type WritablePowerPortTemplate struct { + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable power port template +func (m *WritablePowerPortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritablePowerPortTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerPortTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritablePowerPortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritablePowerPortTemplate) UnmarshalBinary(b []byte) error { + var res WritablePowerPortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_prefix.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_prefix.go new file mode 100644 index 0000000..a777ca6 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_prefix.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritablePrefix writable prefix +// swagger:model WritablePrefix +type WritablePrefix struct { + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Is a pool + // + // All IP addresses within this prefix are considered usable + IsPool bool `json:"is_pool,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Prefix + // + // IPv4 or IPv6 network with mask + // Required: true + Prefix *string `json:"prefix"` + + // Role + // + // The primary function of this prefix + Role int64 `json:"role,omitempty"` + + // Site + Site int64 `json:"site,omitempty"` + + // Status + // + // Operational status of this prefix + Status int64 `json:"status,omitempty"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` + + // VLAN + Vlan int64 `json:"vlan,omitempty"` + + // VRF + Vrf int64 `json:"vrf,omitempty"` +} + +// Validate validates this writable prefix +func (m *WritablePrefix) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrefix(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritablePrefix) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritablePrefix) validatePrefix(formats strfmt.Registry) error { + + if err := validate.Required("prefix", "body", m.Prefix); err != nil { + return err + } + + return nil +} + +var writablePrefixTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[0,1,2,3]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writablePrefixTypeStatusPropEnum = append(writablePrefixTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritablePrefix) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writablePrefixTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritablePrefix) 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 +} + +// MarshalBinary interface implementation +func (m *WritablePrefix) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritablePrefix) UnmarshalBinary(b []byte) error { + var res WritablePrefix + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_provider.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_provider.go new file mode 100644 index 0000000..65af6ed --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_provider.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableProvider writable provider +// swagger:model WritableProvider +type WritableProvider struct { + + // Account number + // Max Length: 30 + Account string `json:"account,omitempty"` + + // Admin contact + AdminContact string `json:"admin_contact,omitempty"` + + // ASN + // Maximum: 4.294967295e+09 + // Minimum: 1 + Asn int64 `json:"asn,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // NOC contact + NocContact string `json:"noc_contact,omitempty"` + + // Portal + // Max Length: 200 + PortalURL strfmt.URI `json:"portal_url,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this writable provider +func (m *WritableProvider) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateAsn(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePortalURL(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableProvider) validateAccount(formats strfmt.Registry) error { + + if swag.IsZero(m.Account) { // not required + return nil + } + + if err := validate.MaxLength("account", "body", string(m.Account), 30); err != nil { + return err + } + + return nil +} + +func (m *WritableProvider) validateAsn(formats strfmt.Registry) error { + + if swag.IsZero(m.Asn) { // not required + return nil + } + + if err := validate.MinimumInt("asn", "body", int64(m.Asn), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("asn", "body", int64(m.Asn), 4.294967295e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableProvider) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableProvider) validatePortalURL(formats strfmt.Registry) error { + + if swag.IsZero(m.PortalURL) { // not required + return nil + } + + if err := validate.MaxLength("portal_url", "body", string(m.PortalURL), 200); err != nil { + return err + } + + if err := validate.FormatOf("portal_url", "body", "uri", m.PortalURL.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableProvider) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableProvider) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableProvider) UnmarshalBinary(b []byte) error { + var res WritableProvider + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_rack.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_rack.go new file mode 100644 index 0000000..b3a8d28 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_rack.go @@ -0,0 +1,293 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableRack writable rack +// swagger:model WritableRack +type WritableRack struct { + + // Comments + Comments string `json:"comments,omitempty"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Descending units + // + // Units are numbered top-to-bottom + DescUnits bool `json:"desc_units,omitempty"` + + // Facility ID + // Max Length: 50 + FacilityID string `json:"facility_id,omitempty"` + + // Group + Group int64 `json:"group,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Role + Role int64 `json:"role,omitempty"` + + // Serial number + // Max Length: 50 + Serial string `json:"serial,omitempty"` + + // Site + // Required: true + Site *int64 `json:"site"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` + + // Type + Type int64 `json:"type,omitempty"` + + // Height (U) + // Maximum: 100 + // Minimum: 1 + UHeight int64 `json:"u_height,omitempty"` + + // Width + // + // Rail-to-rail width + Width int64 `json:"width,omitempty"` +} + +// Validate validates this writable rack +func (m *WritableRack) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFacilityID(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSerial(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUHeight(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateWidth(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableRack) validateFacilityID(formats strfmt.Registry) error { + + if swag.IsZero(m.FacilityID) { // not required + return nil + } + + if err := validate.MaxLength("facility_id", "body", string(m.FacilityID), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableRack) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableRack) validateSerial(formats strfmt.Registry) error { + + if swag.IsZero(m.Serial) { // not required + return nil + } + + if err := validate.MaxLength("serial", "body", string(m.Serial), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableRack) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + return nil +} + +var writableRackTypeTypePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[100,200,300,1000,1100]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableRackTypeTypePropEnum = append(writableRackTypeTypePropEnum, v) + } +} + +// prop value enum +func (m *WritableRack) validateTypeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableRackTypeTypePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableRack) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + // value enum + if err := m.validateTypeEnum("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +func (m *WritableRack) validateUHeight(formats strfmt.Registry) error { + + if swag.IsZero(m.UHeight) { // not required + return nil + } + + if err := validate.MinimumInt("u_height", "body", int64(m.UHeight), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("u_height", "body", int64(m.UHeight), 100, false); err != nil { + return err + } + + return nil +} + +var writableRackTypeWidthPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[19,23]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableRackTypeWidthPropEnum = append(writableRackTypeWidthPropEnum, v) + } +} + +// prop value enum +func (m *WritableRack) validateWidthEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableRackTypeWidthPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableRack) validateWidth(formats strfmt.Registry) error { + + if swag.IsZero(m.Width) { // not required + return nil + } + + // value enum + if err := m.validateWidthEnum("width", "body", m.Width); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableRack) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableRack) UnmarshalBinary(b []byte) error { + var res WritableRack + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_rack_group.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_rack_group.go new file mode 100644 index 0000000..e409f49 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_rack_group.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableRackGroup writable rack group +// swagger:model WritableRackGroup +type WritableRackGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Site + // Required: true + Site *int64 `json:"site"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this writable rack group +func (m *WritableRackGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableRackGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableRackGroup) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + return nil +} + +func (m *WritableRackGroup) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableRackGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableRackGroup) UnmarshalBinary(b []byte) error { + var res WritableRackGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_rack_reservation.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_rack_reservation.go new file mode 100644 index 0000000..e66d7c3 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_rack_reservation.go @@ -0,0 +1,160 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableRackReservation writable rack reservation +// swagger:model WritableRackReservation +type WritableRackReservation struct { + + // Description + // Required: true + // Max Length: 100 + Description *string `json:"description"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Rack + // Required: true + Rack *int64 `json:"rack"` + + // units + // Required: true + Units []*int64 `json:"units"` + + // User + // Required: true + User *int64 `json:"user"` +} + +// Validate validates this writable rack reservation +func (m *WritableRackReservation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRack(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUnits(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUser(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableRackReservation) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + if err := validate.MaxLength("description", "body", string(*m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableRackReservation) validateRack(formats strfmt.Registry) error { + + if err := validate.Required("rack", "body", m.Rack); err != nil { + return err + } + + return nil +} + +func (m *WritableRackReservation) validateUnits(formats strfmt.Registry) error { + + if err := validate.Required("units", "body", m.Units); err != nil { + return err + } + + for i := 0; i < len(m.Units); i++ { + + if swag.IsZero(m.Units[i]) { // not required + continue + } + + if err := validate.MinimumInt("units"+"."+strconv.Itoa(i), "body", int64(*m.Units[i]), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("units"+"."+strconv.Itoa(i), "body", int64(*m.Units[i]), 32767, false); err != nil { + return err + } + + } + + return nil +} + +func (m *WritableRackReservation) validateUser(formats strfmt.Registry) error { + + if err := validate.Required("user", "body", m.User); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableRackReservation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableRackReservation) UnmarshalBinary(b []byte) error { + var res WritableRackReservation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_region.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_region.go new file mode 100644 index 0000000..9581986 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_region.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableRegion writable region +// swagger:model WritableRegion +type WritableRegion struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Parent + Parent int64 `json:"parent,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this writable region +func (m *WritableRegion) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableRegion) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableRegion) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableRegion) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableRegion) UnmarshalBinary(b []byte) error { + var res WritableRegion + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_secret.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_secret.go new file mode 100644 index 0000000..e068649 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_secret.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableSecret writable secret +// swagger:model WritableSecret +type WritableSecret struct { + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Device + // Required: true + Device *int64 `json:"device"` + + // Hash + // Read Only: true + Hash string `json:"hash,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Max Length: 100 + Name string `json:"name,omitempty"` + + // Plaintext + // Required: true + Plaintext *string `json:"plaintext"` + + // Role + // Required: true + Role *int64 `json:"role"` +} + +// Validate validates this writable secret +func (m *WritableSecret) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePlaintext(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableSecret) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +func (m *WritableSecret) validateName(formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := validate.MaxLength("name", "body", string(m.Name), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableSecret) validatePlaintext(formats strfmt.Registry) error { + + if err := validate.Required("plaintext", "body", m.Plaintext); err != nil { + return err + } + + return nil +} + +func (m *WritableSecret) validateRole(formats strfmt.Registry) error { + + if err := validate.Required("role", "body", m.Role); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableSecret) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableSecret) UnmarshalBinary(b []byte) error { + var res WritableSecret + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_service.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_service.go new file mode 100644 index 0000000..fc4ea39 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_service.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableService writable service +// swagger:model WritableService +type WritableService struct { + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Device + Device int64 `json:"device,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // ipaddresses + // Unique: true + Ipaddresses []int64 `json:"ipaddresses"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 30 + Name *string `json:"name"` + + // Port number + // Required: true + // Maximum: 65535 + // Minimum: 1 + Port *int64 `json:"port"` + + // Protocol + // Required: true + Protocol *int64 `json:"protocol"` + + // Virtual machine + VirtualMachine int64 `json:"virtual_machine,omitempty"` +} + +// Validate validates this writable service +func (m *WritableService) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateIpaddresses(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePort(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateProtocol(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableService) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableService) validateIpaddresses(formats strfmt.Registry) error { + + if swag.IsZero(m.Ipaddresses) { // not required + return nil + } + + if err := validate.UniqueItems("ipaddresses", "body", m.Ipaddresses); err != nil { + return err + } + + return nil +} + +func (m *WritableService) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 30); err != nil { + return err + } + + return nil +} + +func (m *WritableService) validatePort(formats strfmt.Registry) error { + + if err := validate.Required("port", "body", m.Port); err != nil { + return err + } + + if err := validate.MinimumInt("port", "body", int64(*m.Port), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("port", "body", int64(*m.Port), 65535, false); err != nil { + return err + } + + return nil +} + +var writableServiceTypeProtocolPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[6,17]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableServiceTypeProtocolPropEnum = append(writableServiceTypeProtocolPropEnum, v) + } +} + +// prop value enum +func (m *WritableService) validateProtocolEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableServiceTypeProtocolPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableService) 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 +} + +// MarshalBinary interface implementation +func (m *WritableService) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableService) UnmarshalBinary(b []byte) error { + var res WritableService + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_site.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_site.go new file mode 100644 index 0000000..85e1c5f --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_site.go @@ -0,0 +1,368 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableSite writable site +// swagger:model WritableSite +type WritableSite struct { + + // ASN + // Maximum: 4.294967295e+09 + // Minimum: 1 + Asn int64 `json:"asn,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Contact E-mail + // Max Length: 254 + ContactEmail strfmt.Email `json:"contact_email,omitempty"` + + // Contact name + // Max Length: 50 + ContactName string `json:"contact_name,omitempty"` + + // Contact phone + // Max Length: 20 + ContactPhone string `json:"contact_phone,omitempty"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Facility + // Max Length: 50 + Facility string `json:"facility,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Physical address + // Max Length: 200 + PhysicalAddress string `json:"physical_address,omitempty"` + + // Region + Region int64 `json:"region,omitempty"` + + // Shipping address + // Max Length: 200 + ShippingAddress string `json:"shipping_address,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Status + Status int64 `json:"status,omitempty"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` + + // Time zone + TimeZone string `json:"time_zone,omitempty"` +} + +// Validate validates this writable site +func (m *WritableSite) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAsn(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateContactEmail(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateContactName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateContactPhone(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFacility(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePhysicalAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateShippingAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableSite) validateAsn(formats strfmt.Registry) error { + + if swag.IsZero(m.Asn) { // not required + return nil + } + + if err := validate.MinimumInt("asn", "body", int64(m.Asn), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("asn", "body", int64(m.Asn), 4.294967295e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) validateContactEmail(formats strfmt.Registry) error { + + if swag.IsZero(m.ContactEmail) { // not required + return nil + } + + if err := validate.MaxLength("contact_email", "body", string(m.ContactEmail), 254); err != nil { + return err + } + + if err := validate.FormatOf("contact_email", "body", "email", m.ContactEmail.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) validateContactName(formats strfmt.Registry) error { + + if swag.IsZero(m.ContactName) { // not required + return nil + } + + if err := validate.MaxLength("contact_name", "body", string(m.ContactName), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) validateContactPhone(formats strfmt.Registry) error { + + if swag.IsZero(m.ContactPhone) { // not required + return nil + } + + if err := validate.MaxLength("contact_phone", "body", string(m.ContactPhone), 20); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) validateFacility(formats strfmt.Registry) error { + + if swag.IsZero(m.Facility) { // not required + return nil + } + + if err := validate.MaxLength("facility", "body", string(m.Facility), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) validatePhysicalAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.PhysicalAddress) { // not required + return nil + } + + if err := validate.MaxLength("physical_address", "body", string(m.PhysicalAddress), 200); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) validateShippingAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.ShippingAddress) { // not required + return nil + } + + if err := validate.MaxLength("shipping_address", "body", string(m.ShippingAddress), 200); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +var writableSiteTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,2,4]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableSiteTypeStatusPropEnum = append(writableSiteTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableSite) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableSiteTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableSite) 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 +} + +// MarshalBinary interface implementation +func (m *WritableSite) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableSite) UnmarshalBinary(b []byte) error { + var res WritableSite + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_tenant.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_tenant.go new file mode 100644 index 0000000..f430ea5 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_tenant.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableTenant writable tenant +// swagger:model WritableTenant +type WritableTenant struct { + + // Comments + Comments string `json:"comments,omitempty"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // + // Long-form name (optional) + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Group + Group int64 `json:"group,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 30 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this writable tenant +func (m *WritableTenant) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableTenant) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableTenant) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 30); err != nil { + return err + } + + return nil +} + +func (m *WritableTenant) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableTenant) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableTenant) UnmarshalBinary(b []byte) error { + var res WritableTenant + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_topology_map.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_topology_map.go new file mode 100644 index 0000000..c78e654 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_topology_map.go @@ -0,0 +1,161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableTopologyMap writable topology map +// swagger:model WritableTopologyMap +type WritableTopologyMap struct { + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Device patterns + // + // Identify devices to include in the diagram using regular expressions, one per line. Each line will result in a new tier of the drawing. Separate multiple regexes within a line using semicolons. Devices will be rendered in the order they are defined. + // Required: true + DevicePatterns *string `json:"device_patterns"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Site + Site int64 `json:"site,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this writable topology map +func (m *WritableTopologyMap) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevicePatterns(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableTopologyMap) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableTopologyMap) validateDevicePatterns(formats strfmt.Registry) error { + + if err := validate.Required("device_patterns", "body", m.DevicePatterns); err != nil { + return err + } + + return nil +} + +func (m *WritableTopologyMap) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableTopologyMap) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableTopologyMap) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableTopologyMap) UnmarshalBinary(b []byte) error { + var res WritableTopologyMap + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_virtual_chassis.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_virtual_chassis.go new file mode 100644 index 0000000..e204361 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_virtual_chassis.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableVirtualChassis writable virtual chassis +// swagger:model WritableVirtualChassis +type WritableVirtualChassis struct { + + // Domain + // Max Length: 30 + Domain string `json:"domain,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Master + // Required: true + Master *int64 `json:"master"` +} + +// Validate validates this writable virtual chassis +func (m *WritableVirtualChassis) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDomain(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateMaster(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableVirtualChassis) validateDomain(formats strfmt.Registry) error { + + if swag.IsZero(m.Domain) { // not required + return nil + } + + if err := validate.MaxLength("domain", "body", string(m.Domain), 30); err != nil { + return err + } + + return nil +} + +func (m *WritableVirtualChassis) validateMaster(formats strfmt.Registry) error { + + if err := validate.Required("master", "body", m.Master); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableVirtualChassis) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableVirtualChassis) UnmarshalBinary(b []byte) error { + var res WritableVirtualChassis + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_virtual_machine.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_virtual_machine.go new file mode 100644 index 0000000..4ba7fe7 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_virtual_machine.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableVirtualMachine writable virtual machine +// swagger:model WritableVirtualMachine +type WritableVirtualMachine struct { + + // Cluster + // Required: true + Cluster *int64 `json:"cluster"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Disk (GB) + // Maximum: 2.147483647e+09 + // Minimum: 0 + Disk *int64 `json:"disk,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Memory (MB) + // Maximum: 2.147483647e+09 + // Minimum: 0 + Memory *int64 `json:"memory,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // Platform + Platform int64 `json:"platform,omitempty"` + + // Primary IPv4 + PrimaryIp4 int64 `json:"primary_ip4,omitempty"` + + // Primary IPv6 + PrimaryIp6 int64 `json:"primary_ip6,omitempty"` + + // Role + Role int64 `json:"role,omitempty"` + + // Status + Status int64 `json:"status,omitempty"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` + + // VCPUs + // Maximum: 32767 + // Minimum: 0 + Vcpus *int64 `json:"vcpus,omitempty"` +} + +// Validate validates this writable virtual machine +func (m *WritableVirtualMachine) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCluster(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDisk(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateMemory(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVcpus(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableVirtualMachine) validateCluster(formats strfmt.Registry) error { + + if err := validate.Required("cluster", "body", m.Cluster); err != nil { + return err + } + + return nil +} + +func (m *WritableVirtualMachine) validateDisk(formats strfmt.Registry) error { + + if swag.IsZero(m.Disk) { // not required + return nil + } + + if err := validate.MinimumInt("disk", "body", int64(*m.Disk), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("disk", "body", int64(*m.Disk), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableVirtualMachine) validateMemory(formats strfmt.Registry) error { + + if swag.IsZero(m.Memory) { // not required + return nil + } + + if err := validate.MinimumInt("memory", "body", int64(*m.Memory), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("memory", "body", int64(*m.Memory), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableVirtualMachine) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +var writableVirtualMachineTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,0,3]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableVirtualMachineTypeStatusPropEnum = append(writableVirtualMachineTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableVirtualMachine) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableVirtualMachineTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableVirtualMachine) 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 *WritableVirtualMachine) validateVcpus(formats strfmt.Registry) error { + + if swag.IsZero(m.Vcpus) { // not required + return nil + } + + if err := validate.MinimumInt("vcpus", "body", int64(*m.Vcpus), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("vcpus", "body", int64(*m.Vcpus), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableVirtualMachine) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableVirtualMachine) UnmarshalBinary(b []byte) error { + var res WritableVirtualMachine + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_vlan.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_vlan.go new file mode 100644 index 0000000..9a0feab --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_vlan.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableVLAN writable v l a n +// swagger:model WritableVLAN +type WritableVLAN struct { + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Group + Group int64 `json:"group,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // Role + Role int64 `json:"role,omitempty"` + + // Site + Site int64 `json:"site,omitempty"` + + // Status + Status int64 `json:"status,omitempty"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` + + // ID + // Required: true + // Maximum: 4094 + // Minimum: 1 + Vid *int64 `json:"vid"` +} + +// Validate validates this writable v l a n +func (m *WritableVLAN) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVid(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableVLAN) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableVLAN) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +var writableVLANTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,2,3]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableVLANTypeStatusPropEnum = append(writableVLANTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableVLAN) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableVLANTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableVLAN) 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 *WritableVLAN) validateVid(formats strfmt.Registry) error { + + if err := validate.Required("vid", "body", m.Vid); err != nil { + return err + } + + if err := validate.MinimumInt("vid", "body", int64(*m.Vid), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("vid", "body", int64(*m.Vid), 4094, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableVLAN) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableVLAN) UnmarshalBinary(b []byte) error { + var res WritableVLAN + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_vlangroup.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_vlangroup.go new file mode 100644 index 0000000..1e55728 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_vlangroup.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableVLANGroup writable v l a n group +// swagger:model WritableVLANGroup +type WritableVLANGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Site + Site int64 `json:"site,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this writable v l a n group +func (m *WritableVLANGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableVLANGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableVLANGroup) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableVLANGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableVLANGroup) UnmarshalBinary(b []byte) error { + var res WritableVLANGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_vrf.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_vrf.go new file mode 100644 index 0000000..546f47e --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/models/writable_vrf.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox 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 models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableVRF writable v r f +// swagger:model WritableVRF +type WritableVRF struct { + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Enforce unique space + // + // Prevent duplicate prefixes/IP addresses within this VRF + EnforceUnique bool `json:"enforce_unique,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Route distinguisher + // Required: true + // Max Length: 21 + Rd *string `json:"rd"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` +} + +// Validate validates this writable v r f +func (m *WritableVRF) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRd(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableVRF) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableVRF) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableVRF) validateRd(formats strfmt.Registry) error { + + if err := validate.Required("rd", "body", m.Rd); err != nil { + return err + } + + if err := validate.MaxLength("rd", "body", string(*m.Rd), 21); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableVRF) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableVRF) UnmarshalBinary(b []byte) error { + var res WritableVRF + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/netbox/netbox.go b/go/vendor/github.com/digitalocean/go-netbox/netbox/netbox.go new file mode 100644 index 0000000..2784872 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/netbox/netbox.go @@ -0,0 +1,43 @@ +// Copyright 2018 The go-netbox 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 netbox + +import ( + "fmt" + + "github.com/go-openapi/strfmt" + runtimeclient "github.com/go-openapi/runtime/client" + + "github.com/digitalocean/go-netbox/netbox/client" +) + +// NewNetboxAt returns a client which will connect to the given +// hostname, which can optionally include a port, e.g. localhost:8000 +func NewNetboxAt(host string) *client.NetBox { + t := client.DefaultTransportConfig().WithHost(host) + return client.NewHTTPClientWithConfig(strfmt.Default, t) +} + +const authHeaderName = "Authorization" +const authHeaderFormat = "Token %v" + +// NewNetboxWithAPIKey returna client which will connect to the given +// hostname (and optionally port), and will set the expected Authorization +// header on each request +func NewNetboxWithAPIKey(host string, apiToken string) *client.NetBox { + t := runtimeclient.New(host, client.DefaultBasePath, client.DefaultSchemes) + t.DefaultAuthentication = runtimeclient.APIKeyAuth(authHeaderName, "header", fmt.Sprintf(authHeaderFormat, apiToken)) + return client.New(t, strfmt.Default) +} diff --git a/go/vendor/github.com/digitalocean/go-netbox/scripts/licensecheck.sh b/go/vendor/github.com/digitalocean/go-netbox/scripts/licensecheck.sh new file mode 100755 index 0000000..bfa6241 --- /dev/null +++ b/go/vendor/github.com/digitalocean/go-netbox/scripts/licensecheck.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# Verify that the correct license block is present in all Go source +# files. +IFS=$'\n' read -r -d '' -a EXPECTED < + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. 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/go/vendor/github.com/globalsign/mgo/bson/LICENSE b/go/vendor/github.com/globalsign/mgo/bson/LICENSE new file mode 100644 index 0000000..8903260 --- /dev/null +++ b/go/vendor/github.com/globalsign/mgo/bson/LICENSE @@ -0,0 +1,25 @@ +BSON library for Go + +Copyright (c) 2010-2012 - Gustavo Niemeyer + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. 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/go/vendor/github.com/globalsign/mgo/bson/README.md b/go/vendor/github.com/globalsign/mgo/bson/README.md new file mode 100644 index 0000000..5c5819e --- /dev/null +++ b/go/vendor/github.com/globalsign/mgo/bson/README.md @@ -0,0 +1,12 @@ +[![GoDoc](https://godoc.org/github.com/globalsign/mgo/bson?status.svg)](https://godoc.org/github.com/globalsign/mgo/bson) + +An Implementation of BSON for Go +-------------------------------- + +Package bson is an implementation of the [BSON specification](http://bsonspec.org) for Go. + +While the BSON package implements the BSON spec as faithfully as possible, there +is some MongoDB specific behaviour (such as map keys `$in`, `$all`, etc) in the +`bson` package. The priority is for backwards compatibility for the `mgo` +driver, though fixes for obviously buggy behaviour is welcome (and features, etc +behind feature flags). diff --git a/go/vendor/github.com/globalsign/mgo/bson/bson.go b/go/vendor/github.com/globalsign/mgo/bson/bson.go new file mode 100644 index 0000000..eb87ef6 --- /dev/null +++ b/go/vendor/github.com/globalsign/mgo/bson/bson.go @@ -0,0 +1,836 @@ +// BSON library for Go +// +// Copyright (c) 2010-2012 - Gustavo Niemeyer +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// 2. 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. + +// Package bson is an implementation of the BSON specification for Go: +// +// http://bsonspec.org +// +// It was created as part of the mgo MongoDB driver for Go, but is standalone +// and may be used on its own without the driver. +package bson + +import ( + "bytes" + "crypto/md5" + "crypto/rand" + "encoding/binary" + "encoding/hex" + "encoding/json" + "errors" + "fmt" + "io" + "math" + "os" + "reflect" + "runtime" + "strings" + "sync" + "sync/atomic" + "time" +) + +//go:generate go run bson_corpus_spec_test_generator.go + +// -------------------------------------------------------------------------- +// The public API. + +// Element types constants from BSON specification. +const ( + ElementFloat64 byte = 0x01 + ElementString byte = 0x02 + ElementDocument byte = 0x03 + ElementArray byte = 0x04 + ElementBinary byte = 0x05 + Element06 byte = 0x06 + ElementObjectId byte = 0x07 + ElementBool byte = 0x08 + ElementDatetime byte = 0x09 + ElementNil byte = 0x0A + ElementRegEx byte = 0x0B + ElementDBPointer byte = 0x0C + ElementJavaScriptWithoutScope byte = 0x0D + ElementSymbol byte = 0x0E + ElementJavaScriptWithScope byte = 0x0F + ElementInt32 byte = 0x10 + ElementTimestamp byte = 0x11 + ElementInt64 byte = 0x12 + ElementDecimal128 byte = 0x13 + ElementMinKey byte = 0xFF + ElementMaxKey byte = 0x7F + + BinaryGeneric byte = 0x00 + BinaryFunction byte = 0x01 + BinaryBinaryOld byte = 0x02 + BinaryUUIDOld byte = 0x03 + BinaryUUID byte = 0x04 + BinaryMD5 byte = 0x05 + BinaryUserDefined byte = 0x80 +) + +// Getter interface: a value implementing the bson.Getter interface will have its GetBSON +// method called when the given value has to be marshalled, and the result +// of this method will be marshaled in place of the actual object. +// +// If GetBSON returns return a non-nil error, the marshalling procedure +// will stop and error out with the provided value. +type Getter interface { + GetBSON() (interface{}, error) +} + +// Setter interface: a value implementing the bson.Setter interface will receive the BSON +// value via the SetBSON method during unmarshaling, and the object +// itself will not be changed as usual. +// +// If setting the value works, the method should return nil or alternatively +// bson.ErrSetZero to set the respective field to its zero value (nil for +// pointer types). If SetBSON returns a value of type bson.TypeError, the +// BSON value will be omitted from a map or slice being decoded and the +// unmarshalling will continue. If it returns any other non-nil error, the +// unmarshalling procedure will stop and error out with the provided value. +// +// This interface is generally useful in pointer receivers, since the method +// will want to change the receiver. A type field that implements the Setter +// interface doesn't have to be a pointer, though. +// +// Unlike the usual behavior, unmarshalling onto a value that implements a +// Setter interface will NOT reset the value to its zero state. This allows +// the value to decide by itself how to be unmarshalled. +// +// For example: +// +// type MyString string +// +// func (s *MyString) SetBSON(raw bson.Raw) error { +// return raw.Unmarshal(s) +// } +// +type Setter interface { + SetBSON(raw Raw) error +} + +// ErrSetZero may be returned from a SetBSON method to have the value set to +// its respective zero value. When used in pointer values, this will set the +// field to nil rather than to the pre-allocated value. +var ErrSetZero = errors.New("set to zero") + +// M is a convenient alias for a map[string]interface{} map, useful for +// dealing with BSON in a native way. For instance: +// +// bson.M{"a": 1, "b": true} +// +// There's no special handling for this type in addition to what's done anyway +// for an equivalent map type. Elements in the map will be dumped in an +// undefined ordered. See also the bson.D type for an ordered alternative. +type M map[string]interface{} + +// D represents a BSON document containing ordered elements. For example: +// +// bson.D{{"a", 1}, {"b", true}} +// +// In some situations, such as when creating indexes for MongoDB, the order in +// which the elements are defined is important. If the order is not important, +// using a map is generally more comfortable. See bson.M and bson.RawD. +type D []DocElem + +// DocElem is an element of the bson.D document representation. +type DocElem struct { + Name string + Value interface{} +} + +// Map returns a map out of the ordered element name/value pairs in d. +func (d D) Map() (m M) { + m = make(M, len(d)) + for _, item := range d { + m[item.Name] = item.Value + } + return m +} + +// The Raw type represents raw unprocessed BSON documents and elements. +// Kind is the kind of element as defined per the BSON specification, and +// Data is the raw unprocessed data for the respective element. +// Using this type it is possible to unmarshal or marshal values partially. +// +// Relevant documentation: +// +// http://bsonspec.org/#/specification +// +type Raw struct { + Kind byte + Data []byte +} + +// RawD represents a BSON document containing raw unprocessed elements. +// This low-level representation may be useful when lazily processing +// documents of uncertain content, or when manipulating the raw content +// documents in general. +type RawD []RawDocElem + +// RawDocElem elements of RawD type. +type RawDocElem struct { + Name string + Value Raw +} + +// ObjectId is a unique ID identifying a BSON value. It must be exactly 12 bytes +// long. MongoDB objects by default have such a property set in their "_id" +// property. +// +// http://www.mongodb.org/display/DOCS/Object+Ids +type ObjectId string + +// ObjectIdHex returns an ObjectId from the provided hex representation. +// Calling this function with an invalid hex representation will +// cause a runtime panic. See the IsObjectIdHex function. +func ObjectIdHex(s string) ObjectId { + d, err := hex.DecodeString(s) + if err != nil || len(d) != 12 { + panic(fmt.Sprintf("invalid input to ObjectIdHex: %q", s)) + } + return ObjectId(d) +} + +// IsObjectIdHex returns whether s is a valid hex representation of +// an ObjectId. See the ObjectIdHex function. +func IsObjectIdHex(s string) bool { + if len(s) != 24 { + return false + } + _, err := hex.DecodeString(s) + return err == nil +} + +// objectIdCounter is atomically incremented when generating a new ObjectId +// using NewObjectId() function. It's used as a counter part of an id. +var objectIdCounter = readRandomUint32() + +// readRandomUint32 returns a random objectIdCounter. +func readRandomUint32() uint32 { + var b [4]byte + _, err := io.ReadFull(rand.Reader, b[:]) + if err != nil { + panic(fmt.Errorf("cannot read random object id: %v", err)) + } + return uint32((uint32(b[0]) << 0) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24)) +} + +// machineId stores machine id generated once and used in subsequent calls +// to NewObjectId function. +var machineId = readMachineId() +var processId = os.Getpid() + +// readMachineId generates and returns a machine id. +// If this function fails to get the hostname it will cause a runtime error. +func readMachineId() []byte { + var sum [3]byte + id := sum[:] + hostname, err1 := os.Hostname() + if err1 != nil { + _, err2 := io.ReadFull(rand.Reader, id) + if err2 != nil { + panic(fmt.Errorf("cannot get hostname: %v; %v", err1, err2)) + } + return id + } + hw := md5.New() + hw.Write([]byte(hostname)) + copy(id, hw.Sum(nil)) + return id +} + +// NewObjectId returns a new unique ObjectId. +func NewObjectId() ObjectId { + var b [12]byte + // Timestamp, 4 bytes, big endian + binary.BigEndian.PutUint32(b[:], uint32(time.Now().Unix())) + // Machine, first 3 bytes of md5(hostname) + b[4] = machineId[0] + b[5] = machineId[1] + b[6] = machineId[2] + // Pid, 2 bytes, specs don't specify endianness, but we use big endian. + b[7] = byte(processId >> 8) + b[8] = byte(processId) + // Increment, 3 bytes, big endian + i := atomic.AddUint32(&objectIdCounter, 1) + b[9] = byte(i >> 16) + b[10] = byte(i >> 8) + b[11] = byte(i) + return ObjectId(b[:]) +} + +// NewObjectIdWithTime returns a dummy ObjectId with the timestamp part filled +// with the provided number of seconds from epoch UTC, and all other parts +// filled with zeroes. It's not safe to insert a document with an id generated +// by this method, it is useful only for queries to find documents with ids +// generated before or after the specified timestamp. +func NewObjectIdWithTime(t time.Time) ObjectId { + var b [12]byte + binary.BigEndian.PutUint32(b[:4], uint32(t.Unix())) + return ObjectId(string(b[:])) +} + +// String returns a hex string representation of the id. +// Example: ObjectIdHex("4d88e15b60f486e428412dc9"). +func (id ObjectId) String() string { + return fmt.Sprintf(`ObjectIdHex("%x")`, string(id)) +} + +// Hex returns a hex representation of the ObjectId. +func (id ObjectId) Hex() string { + return hex.EncodeToString([]byte(id)) +} + +// MarshalJSON turns a bson.ObjectId into a json.Marshaller. +func (id ObjectId) MarshalJSON() ([]byte, error) { + return []byte(fmt.Sprintf(`"%x"`, string(id))), nil +} + +var nullBytes = []byte("null") + +// UnmarshalJSON turns *bson.ObjectId into a json.Unmarshaller. +func (id *ObjectId) UnmarshalJSON(data []byte) error { + if len(data) > 0 && (data[0] == '{' || data[0] == 'O') { + var v struct { + Id json.RawMessage `json:"$oid"` + Func struct { + Id json.RawMessage + } `json:"$oidFunc"` + } + err := jdec(data, &v) + if err == nil { + if len(v.Id) > 0 { + data = []byte(v.Id) + } else { + data = []byte(v.Func.Id) + } + } + } + if len(data) == 2 && data[0] == '"' && data[1] == '"' || bytes.Equal(data, nullBytes) { + *id = "" + return nil + } + if len(data) != 26 || data[0] != '"' || data[25] != '"' { + return fmt.Errorf("invalid ObjectId in JSON: %s", string(data)) + } + var buf [12]byte + _, err := hex.Decode(buf[:], data[1:25]) + if err != nil { + return fmt.Errorf("invalid ObjectId in JSON: %s (%s)", string(data), err) + } + *id = ObjectId(string(buf[:])) + return nil +} + +// MarshalText turns bson.ObjectId into an encoding.TextMarshaler. +func (id ObjectId) MarshalText() ([]byte, error) { + return []byte(fmt.Sprintf("%x", string(id))), nil +} + +// UnmarshalText turns *bson.ObjectId into an encoding.TextUnmarshaler. +func (id *ObjectId) UnmarshalText(data []byte) error { + if len(data) == 1 && data[0] == ' ' || len(data) == 0 { + *id = "" + return nil + } + if len(data) != 24 { + return fmt.Errorf("invalid ObjectId: %s", data) + } + var buf [12]byte + _, err := hex.Decode(buf[:], data[:]) + if err != nil { + return fmt.Errorf("invalid ObjectId: %s (%s)", data, err) + } + *id = ObjectId(string(buf[:])) + return nil +} + +// Valid returns true if id is valid. A valid id must contain exactly 12 bytes. +func (id ObjectId) Valid() bool { + return len(id) == 12 +} + +// byteSlice returns byte slice of id from start to end. +// Calling this function with an invalid id will cause a runtime panic. +func (id ObjectId) byteSlice(start, end int) []byte { + if len(id) != 12 { + panic(fmt.Sprintf("invalid ObjectId: %q", string(id))) + } + return []byte(string(id)[start:end]) +} + +// Time returns the timestamp part of the id. +// It's a runtime error to call this method with an invalid id. +func (id ObjectId) Time() time.Time { + // First 4 bytes of ObjectId is 32-bit big-endian seconds from epoch. + secs := int64(binary.BigEndian.Uint32(id.byteSlice(0, 4))) + return time.Unix(secs, 0) +} + +// Machine returns the 3-byte machine id part of the id. +// It's a runtime error to call this method with an invalid id. +func (id ObjectId) Machine() []byte { + return id.byteSlice(4, 7) +} + +// Pid returns the process id part of the id. +// It's a runtime error to call this method with an invalid id. +func (id ObjectId) Pid() uint16 { + return binary.BigEndian.Uint16(id.byteSlice(7, 9)) +} + +// Counter returns the incrementing value part of the id. +// It's a runtime error to call this method with an invalid id. +func (id ObjectId) Counter() int32 { + b := id.byteSlice(9, 12) + // Counter is stored as big-endian 3-byte value + return int32(uint32(b[0])<<16 | uint32(b[1])<<8 | uint32(b[2])) +} + +// The Symbol type is similar to a string and is used in languages with a +// distinct symbol type. +type Symbol string + +// Now returns the current time with millisecond precision. MongoDB stores +// timestamps with the same precision, so a Time returned from this method +// will not change after a roundtrip to the database. That's the only reason +// why this function exists. Using the time.Now function also works fine +// otherwise. +func Now() time.Time { + return time.Unix(0, time.Now().UnixNano()/1e6*1e6) +} + +// MongoTimestamp is a special internal type used by MongoDB that for some +// strange reason has its own datatype defined in BSON. +type MongoTimestamp int64 + +// Time returns the time part of ts which is stored with second precision. +func (ts MongoTimestamp) Time() time.Time { + return time.Unix(int64(uint64(ts)>>32), 0) +} + +// Counter returns the counter part of ts. +func (ts MongoTimestamp) Counter() uint32 { + return uint32(ts) +} + +// NewMongoTimestamp creates a timestamp using the given +// date `t` (with second precision) and counter `c` (unique for `t`). +// +// Returns an error if time `t` is not between 1970-01-01T00:00:00Z +// and 2106-02-07T06:28:15Z (inclusive). +// +// Note that two MongoTimestamps should never have the same (time, counter) combination: +// the caller must ensure the counter `c` is increased if creating multiple MongoTimestamp +// values for the same time `t` (ignoring fractions of seconds). +func NewMongoTimestamp(t time.Time, c uint32) (MongoTimestamp, error) { + u := t.Unix() + if u < 0 || u > math.MaxUint32 { + return -1, errors.New("invalid value for time") + } + + i := int64(u<<32 | int64(c)) + + return MongoTimestamp(i), nil +} + +type orderKey int64 + +// MaxKey is a special value that compares higher than all other possible BSON +// values in a MongoDB database. +var MaxKey = orderKey(1<<63 - 1) + +// MinKey is a special value that compares lower than all other possible BSON +// values in a MongoDB database. +var MinKey = orderKey(-1 << 63) + +type undefined struct{} + +// Undefined represents the undefined BSON value. +var Undefined undefined + +// Binary is a representation for non-standard binary values. Any kind should +// work, but the following are known as of this writing: +// +// 0x00 - Generic. This is decoded as []byte(data), not Binary{0x00, data}. +// 0x01 - Function (!?) +// 0x02 - Obsolete generic. +// 0x03 - UUID +// 0x05 - MD5 +// 0x80 - User defined. +// +type Binary struct { + Kind byte + Data []byte +} + +// RegEx represents a regular expression. The Options field may contain +// individual characters defining the way in which the pattern should be +// applied, and must be sorted. Valid options as of this writing are 'i' for +// case insensitive matching, 'm' for multi-line matching, 'x' for verbose +// mode, 'l' to make \w, \W, and similar be locale-dependent, 's' for dot-all +// mode (a '.' matches everything), and 'u' to make \w, \W, and similar match +// unicode. The value of the Options parameter is not verified before being +// marshaled into the BSON format. +type RegEx struct { + Pattern string + Options string +} + +// JavaScript is a type that holds JavaScript code. If Scope is non-nil, it +// will be marshaled as a mapping from identifiers to values that may be +// used when evaluating the provided Code. +type JavaScript struct { + Code string + Scope interface{} +} + +// DBPointer refers to a document id in a namespace. +// +// This type is deprecated in the BSON specification and should not be used +// except for backwards compatibility with ancient applications. +type DBPointer struct { + Namespace string + Id ObjectId +} + +const initialBufferSize = 64 + +func handleErr(err *error) { + if r := recover(); r != nil { + if _, ok := r.(runtime.Error); ok { + panic(r) + } else if _, ok := r.(externalPanic); ok { + panic(r) + } else if s, ok := r.(string); ok { + *err = errors.New(s) + } else if e, ok := r.(error); ok { + *err = e + } else { + panic(r) + } + } +} + +// Marshal serializes the in value, which may be a map or a struct value. +// In the case of struct values, only exported fields will be serialized, +// and the order of serialized fields will match that of the struct itself. +// The lowercased field name is used as the key for each exported field, +// but this behavior may be changed using the respective field tag. +// The tag may also contain flags to tweak the marshalling behavior for +// the field. The tag formats accepted are: +// +// "[][,[,]]" +// +// `(...) bson:"[][,[,]]" (...)` +// +// The following flags are currently supported: +// +// omitempty Only include the field if it's not set to the zero +// value for the type or to empty slices or maps. +// +// minsize Marshal an int64 value as an int32, if that's feasible +// while preserving the numeric value. +// +// inline Inline the field, which must be a struct or a map, +// causing all of its fields or keys to be processed as if +// they were part of the outer struct. For maps, keys must +// not conflict with the bson keys of other struct fields. +// +// Some examples: +// +// type T struct { +// A bool +// B int "myb" +// C string "myc,omitempty" +// D string `bson:",omitempty" json:"jsonkey"` +// E int64 ",minsize" +// F int64 "myf,omitempty,minsize" +// } +// +func Marshal(in interface{}) (out []byte, err error) { + return MarshalBuffer(in, make([]byte, 0, initialBufferSize)) +} + +// MarshalBuffer behaves the same way as Marshal, except that instead of +// allocating a new byte slice it tries to use the received byte slice and +// only allocates more memory if necessary to fit the marshaled value. +func MarshalBuffer(in interface{}, buf []byte) (out []byte, err error) { + defer handleErr(&err) + e := &encoder{buf} + e.addDoc(reflect.ValueOf(in)) + return e.out, nil +} + +// Unmarshal deserializes data from in into the out value. The out value +// must be a map, a pointer to a struct, or a pointer to a bson.D value. +// In the case of struct values, only exported fields will be deserialized. +// The lowercased field name is used as the key for each exported field, +// but this behavior may be changed using the respective field tag. +// The tag may also contain flags to tweak the marshalling behavior for +// the field. The tag formats accepted are: +// +// "[][,[,]]" +// +// `(...) bson:"[][,[,]]" (...)` +// +// The following flags are currently supported during unmarshal (see the +// Marshal method for other flags): +// +// inline Inline the field, which must be a struct or a map. +// Inlined structs are handled as if its fields were part +// of the outer struct. An inlined map causes keys that do +// not match any other struct field to be inserted in the +// map rather than being discarded as usual. +// +// The target field or element types of out may not necessarily match +// the BSON values of the provided data. The following conversions are +// made automatically: +// +// - Numeric types are converted if at least the integer part of the +// value would be preserved correctly +// - Bools are converted to numeric types as 1 or 0 +// - Numeric types are converted to bools as true if not 0 or false otherwise +// - Binary and string BSON data is converted to a string, array or byte slice +// +// If the value would not fit the type and cannot be converted, it's +// silently skipped. +// +// Pointer values are initialized when necessary. +func Unmarshal(in []byte, out interface{}) (err error) { + if raw, ok := out.(*Raw); ok { + raw.Kind = 3 + raw.Data = in + return nil + } + defer handleErr(&err) + v := reflect.ValueOf(out) + switch v.Kind() { + case reflect.Ptr: + fallthrough + case reflect.Map: + d := newDecoder(in) + d.readDocTo(v) + if d.i < len(d.in) { + return errors.New("document is corrupted") + } + case reflect.Struct: + return errors.New("unmarshal can't deal with struct values. Use a pointer") + default: + return errors.New("unmarshal needs a map or a pointer to a struct") + } + return nil +} + +// Unmarshal deserializes raw into the out value. If the out value type +// is not compatible with raw, a *bson.TypeError is returned. +// +// See the Unmarshal function documentation for more details on the +// unmarshalling process. +func (raw Raw) Unmarshal(out interface{}) (err error) { + defer handleErr(&err) + v := reflect.ValueOf(out) + switch v.Kind() { + case reflect.Ptr: + v = v.Elem() + fallthrough + case reflect.Map: + d := newDecoder(raw.Data) + good := d.readElemTo(v, raw.Kind) + if !good { + return &TypeError{v.Type(), raw.Kind} + } + case reflect.Struct: + return errors.New("raw Unmarshal can't deal with struct values. Use a pointer") + default: + return errors.New("raw Unmarshal needs a map or a valid pointer") + } + return nil +} + +// TypeError store details for type error occuring +// during unmarshaling +type TypeError struct { + Type reflect.Type + Kind byte +} + +func (e *TypeError) Error() string { + return fmt.Sprintf("BSON kind 0x%02x isn't compatible with type %s", e.Kind, e.Type.String()) +} + +// -------------------------------------------------------------------------- +// Maintain a mapping of keys to structure field indexes + +type structInfo struct { + FieldsMap map[string]fieldInfo + FieldsList []fieldInfo + InlineMap int + Zero reflect.Value +} + +type fieldInfo struct { + Key string + Num int + OmitEmpty bool + MinSize bool + Inline []int +} + +var structMap = make(map[reflect.Type]*structInfo) +var structMapMutex sync.RWMutex + +type externalPanic string + +func (e externalPanic) String() string { + return string(e) +} + +func getStructInfo(st reflect.Type) (*structInfo, error) { + structMapMutex.RLock() + sinfo, found := structMap[st] + structMapMutex.RUnlock() + if found { + return sinfo, nil + } + n := st.NumField() + fieldsMap := make(map[string]fieldInfo) + fieldsList := make([]fieldInfo, 0, n) + inlineMap := -1 + for i := 0; i != n; i++ { + field := st.Field(i) + if field.PkgPath != "" && !field.Anonymous { + continue // Private field + } + + info := fieldInfo{Num: i} + + tag := field.Tag.Get("bson") + + // Fall-back to JSON struct tag, if feature flag is set. + if tag == "" && useJSONTagFallback { + tag = field.Tag.Get("json") + } + + // If there's no bson/json tag available. + if tag == "" { + // If there's no tag, and also no tag: value splits (i.e. no colon) + // then assume the entire tag is the value + if strings.Index(string(field.Tag), ":") < 0 { + tag = string(field.Tag) + } + } + + if tag == "-" { + continue + } + + inline := false + fields := strings.Split(tag, ",") + if len(fields) > 1 { + for _, flag := range fields[1:] { + switch flag { + case "omitempty": + info.OmitEmpty = true + case "minsize": + info.MinSize = true + case "inline": + inline = true + default: + msg := fmt.Sprintf("Unsupported flag %q in tag %q of type %s", flag, tag, st) + panic(externalPanic(msg)) + } + } + tag = fields[0] + } + + if inline { + switch field.Type.Kind() { + case reflect.Map: + if inlineMap >= 0 { + return nil, errors.New("Multiple ,inline maps in struct " + st.String()) + } + if field.Type.Key() != reflect.TypeOf("") { + return nil, errors.New("Option ,inline needs a map with string keys in struct " + st.String()) + } + inlineMap = info.Num + case reflect.Ptr: + // allow only pointer to struct + if kind := field.Type.Elem().Kind(); kind != reflect.Struct { + return nil, errors.New("Option ,inline allows a pointer only to a struct, was given pointer to " + kind.String()) + } + + field.Type = field.Type.Elem() + fallthrough + case reflect.Struct: + sinfo, err := getStructInfo(field.Type) + if err != nil { + return nil, err + } + for _, finfo := range sinfo.FieldsList { + if _, found := fieldsMap[finfo.Key]; found { + msg := "Duplicated key '" + finfo.Key + "' in struct " + st.String() + return nil, errors.New(msg) + } + if finfo.Inline == nil { + finfo.Inline = []int{i, finfo.Num} + } else { + finfo.Inline = append([]int{i}, finfo.Inline...) + } + fieldsMap[finfo.Key] = finfo + fieldsList = append(fieldsList, finfo) + } + default: + panic("Option ,inline needs a struct value or a pointer to a struct or map field") + } + continue + } + + if tag != "" { + info.Key = tag + } else { + info.Key = strings.ToLower(field.Name) + } + + if _, found = fieldsMap[info.Key]; found { + msg := "Duplicated key '" + info.Key + "' in struct " + st.String() + return nil, errors.New(msg) + } + + fieldsList = append(fieldsList, info) + fieldsMap[info.Key] = info + } + sinfo = &structInfo{ + fieldsMap, + fieldsList, + inlineMap, + reflect.New(st).Elem(), + } + structMapMutex.Lock() + structMap[st] = sinfo + structMapMutex.Unlock() + return sinfo, nil +} diff --git a/go/vendor/github.com/globalsign/mgo/bson/bson_corpus_spec_test_generator.go b/go/vendor/github.com/globalsign/mgo/bson/bson_corpus_spec_test_generator.go new file mode 100644 index 0000000..3525a00 --- /dev/null +++ b/go/vendor/github.com/globalsign/mgo/bson/bson_corpus_spec_test_generator.go @@ -0,0 +1,294 @@ +// +build ignore + +package main + +import ( + "bytes" + "fmt" + "go/format" + "html/template" + "io/ioutil" + "log" + "path/filepath" + "strings" + + "github.com/globalsign/mgo/internal/json" +) + +func main() { + log.SetFlags(0) + log.SetPrefix(name + ": ") + + var g Generator + + fmt.Fprintf(&g, "// Code generated by \"%s.go\"; DO NOT EDIT\n\n", name) + + src := g.generate() + + err := ioutil.WriteFile(fmt.Sprintf("%s.go", strings.TrimSuffix(name, "_generator")), src, 0644) + if err != nil { + log.Fatalf("writing output: %s", err) + } +} + +// Generator holds the state of the analysis. Primarily used to buffer +// the output for format.Source. +type Generator struct { + bytes.Buffer // Accumulated output. +} + +// format returns the gofmt-ed contents of the Generator's buffer. +func (g *Generator) format() []byte { + src, err := format.Source(g.Bytes()) + if err != nil { + // Should never happen, but can arise when developing this code. + // The user can compile the output to see the error. + log.Printf("warning: internal error: invalid Go generated: %s", err) + log.Printf("warning: compile the package to analyze the error") + return g.Bytes() + } + return src +} + +// EVERYTHING ABOVE IS CONSTANT BETWEEN THE GENERATORS + +const name = "bson_corpus_spec_test_generator" + +func (g *Generator) generate() []byte { + + testFiles, err := filepath.Glob("./specdata/specifications/source/bson-corpus/tests/*.json") + if err != nil { + log.Fatalf("error reading bson-corpus files: %s", err) + } + + tests, err := g.loadTests(testFiles) + if err != nil { + log.Fatalf("error loading tests: %s", err) + } + + tmpl, err := g.getTemplate() + if err != nil { + log.Fatalf("error loading template: %s", err) + } + + tmpl.Execute(&g.Buffer, tests) + + return g.format() +} + +func (g *Generator) loadTests(filenames []string) ([]*testDef, error) { + var tests []*testDef + for _, filename := range filenames { + test, err := g.loadTest(filename) + if err != nil { + return nil, err + } + + tests = append(tests, test) + } + + return tests, nil +} + +func (g *Generator) loadTest(filename string) (*testDef, error) { + content, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + + var testDef testDef + err = json.Unmarshal(content, &testDef) + if err != nil { + return nil, err + } + + names := make(map[string]struct{}) + + for i := len(testDef.Valid) - 1; i >= 0; i-- { + if testDef.BsonType == "0x05" && testDef.Valid[i].Description == "subtype 0x02" { + testDef.Valid = append(testDef.Valid[:i], testDef.Valid[i+1:]...) + continue + } + + name := cleanupFuncName(testDef.Description + "_" + testDef.Valid[i].Description) + nameIdx := name + j := 1 + for { + if _, ok := names[nameIdx]; !ok { + break + } + + nameIdx = fmt.Sprintf("%s_%d", name, j) + } + + names[nameIdx] = struct{}{} + + testDef.Valid[i].TestDef = &testDef + testDef.Valid[i].Name = nameIdx + testDef.Valid[i].StructTest = testDef.TestKey != "" && + (testDef.BsonType != "0x05" || strings.Contains(testDef.Valid[i].Description, "0x00")) && + !testDef.Deprecated + } + + for i := len(testDef.DecodeErrors) - 1; i >= 0; i-- { + if strings.Contains(testDef.DecodeErrors[i].Description, "UTF-8") { + testDef.DecodeErrors = append(testDef.DecodeErrors[:i], testDef.DecodeErrors[i+1:]...) + continue + } + + name := cleanupFuncName(testDef.Description + "_" + testDef.DecodeErrors[i].Description) + nameIdx := name + j := 1 + for { + if _, ok := names[nameIdx]; !ok { + break + } + + nameIdx = fmt.Sprintf("%s_%d", name, j) + } + names[nameIdx] = struct{}{} + + testDef.DecodeErrors[i].Name = nameIdx + } + + return &testDef, nil +} + +func (g *Generator) getTemplate() (*template.Template, error) { + content := `package bson_test + +import ( + "encoding/hex" + "time" + + . "gopkg.in/check.v1" + "github.com/globalsign/mgo/bson" +) + +func testValid(c *C, in []byte, expected []byte, result interface{}) { + err := bson.Unmarshal(in, result) + c.Assert(err, IsNil) + + out, err := bson.Marshal(result) + c.Assert(err, IsNil) + + c.Assert(string(expected), Equals, string(out), Commentf("roundtrip failed for %T, expected '%x' but got '%x'", result, expected, out)) +} + +func testDecodeSkip(c *C, in []byte) { + err := bson.Unmarshal(in, &struct{}{}) + c.Assert(err, IsNil) +} + +func testDecodeError(c *C, in []byte, result interface{}) { + err := bson.Unmarshal(in, result) + c.Assert(err, Not(IsNil)) +} + +{{range .}} +{{range .Valid}} +func (s *S) Test{{.Name}}(c *C) { + b, err := hex.DecodeString("{{.Bson}}") + c.Assert(err, IsNil) + + {{if .CanonicalBson}} + cb, err := hex.DecodeString("{{.CanonicalBson}}") + c.Assert(err, IsNil) + {{else}} + cb := b + {{end}} + + var resultD bson.D + testValid(c, b, cb, &resultD) + {{if .StructTest}}var resultS struct { + Element {{.TestDef.GoType}} ` + "`bson:\"{{.TestDef.TestKey}}\"`" + ` + } + testValid(c, b, cb, &resultS){{end}} + + testDecodeSkip(c, b) +} +{{end}} + +{{range .DecodeErrors}} +func (s *S) Test{{.Name}}(c *C) { + b, err := hex.DecodeString("{{.Bson}}") + c.Assert(err, IsNil) + + var resultD bson.D + testDecodeError(c, b, &resultD) +} +{{end}} +{{end}} +` + tmpl, err := template.New("").Parse(content) + if err != nil { + return nil, err + } + return tmpl, nil +} + +func cleanupFuncName(name string) string { + return strings.Map(func(r rune) rune { + if (r >= 48 && r <= 57) || (r >= 65 && r <= 90) || (r >= 97 && r <= 122) { + return r + } + return '_' + }, name) +} + +type testDef struct { + Description string `json:"description"` + BsonType string `json:"bson_type"` + TestKey string `json:"test_key"` + Valid []*valid `json:"valid"` + DecodeErrors []*decodeError `json:"decodeErrors"` + Deprecated bool `json:"deprecated"` +} + +func (t *testDef) GoType() string { + switch t.BsonType { + case "0x01": + return "float64" + case "0x02": + return "string" + case "0x03": + return "bson.D" + case "0x04": + return "[]interface{}" + case "0x05": + return "[]byte" + case "0x07": + return "bson.ObjectId" + case "0x08": + return "bool" + case "0x09": + return "time.Time" + case "0x0E": + return "string" + case "0x10": + return "int32" + case "0x12": + return "int64" + case "0x13": + return "bson.Decimal" + default: + return "interface{}" + } +} + +type valid struct { + Description string `json:"description"` + Bson string `json:"bson"` + CanonicalBson string `json:"canonical_bson"` + + Name string + StructTest bool + TestDef *testDef +} + +type decodeError struct { + Description string `json:"description"` + Bson string `json:"bson"` + + Name string +} diff --git a/go/vendor/github.com/globalsign/mgo/bson/compatibility.go b/go/vendor/github.com/globalsign/mgo/bson/compatibility.go new file mode 100644 index 0000000..66efd46 --- /dev/null +++ b/go/vendor/github.com/globalsign/mgo/bson/compatibility.go @@ -0,0 +1,29 @@ +package bson + +// Current state of the JSON tag fallback option. +var useJSONTagFallback = false +var useRespectNilValues = false + +// SetJSONTagFallback enables or disables the JSON-tag fallback for structure tagging. When this is enabled, structures +// without BSON tags on a field will fall-back to using the JSON tag (if present). +func SetJSONTagFallback(state bool) { + useJSONTagFallback = state +} + +// JSONTagFallbackState returns the current status of the JSON tag fallback compatability option. See SetJSONTagFallback +// for more information. +func JSONTagFallbackState() bool { + return useJSONTagFallback +} + +// SetRespectNilValues enables or disables serializing nil slices or maps to `null` values. +// In other words it enables `encoding/json` compatible behaviour. +func SetRespectNilValues(state bool) { + useRespectNilValues = state +} + +// RespectNilValuesState returns the current status of the JSON nil slices and maps fallback compatibility option. +// See SetRespectNilValues for more information. +func RespectNilValuesState() bool { + return useRespectNilValues +} diff --git a/go/vendor/github.com/globalsign/mgo/bson/decimal.go b/go/vendor/github.com/globalsign/mgo/bson/decimal.go new file mode 100644 index 0000000..672ba18 --- /dev/null +++ b/go/vendor/github.com/globalsign/mgo/bson/decimal.go @@ -0,0 +1,312 @@ +// BSON library for Go +// +// Copyright (c) 2010-2012 - Gustavo Niemeyer +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// 2. 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. + +package bson + +import ( + "fmt" + "strconv" + "strings" +) + +// Decimal128 holds decimal128 BSON values. +type Decimal128 struct { + h, l uint64 +} + +func (d Decimal128) String() string { + var pos int // positive sign + var e int // exponent + var h, l uint64 // significand high/low + + if d.h>>63&1 == 0 { + pos = 1 + } + + switch d.h >> 58 & (1<<5 - 1) { + case 0x1F: + return "NaN" + case 0x1E: + return "-Inf"[pos:] + } + + l = d.l + if d.h>>61&3 == 3 { + // Bits: 1*sign 2*ignored 14*exponent 111*significand. + // Implicit 0b100 prefix in significand. + e = int(d.h>>47&(1<<14-1)) - 6176 + //h = 4<<47 | d.h&(1<<47-1) + // Spec says all of these values are out of range. + h, l = 0, 0 + } else { + // Bits: 1*sign 14*exponent 113*significand + e = int(d.h>>49&(1<<14-1)) - 6176 + h = d.h & (1<<49 - 1) + } + + // Would be handled by the logic below, but that's trivial and common. + if h == 0 && l == 0 && e == 0 { + return "-0"[pos:] + } + + var repr [48]byte // Loop 5 times over 9 digits plus dot, negative sign, and leading zero. + var last = len(repr) + var i = len(repr) + var dot = len(repr) + e + var rem uint32 +Loop: + for d9 := 0; d9 < 5; d9++ { + h, l, rem = divmod(h, l, 1e9) + for d1 := 0; d1 < 9; d1++ { + // Handle "-0.0", "0.00123400", "-1.00E-6", "1.050E+3", etc. + if i < len(repr) && (dot == i || l == 0 && h == 0 && rem > 0 && rem < 10 && (dot < i-6 || e > 0)) { + e += len(repr) - i + i-- + repr[i] = '.' + last = i - 1 + dot = len(repr) // Unmark. + } + c := '0' + byte(rem%10) + rem /= 10 + i-- + repr[i] = c + // Handle "0E+3", "1E+3", etc. + if l == 0 && h == 0 && rem == 0 && i == len(repr)-1 && (dot < i-5 || e > 0) { + last = i + break Loop + } + if c != '0' { + last = i + } + // Break early. Works without it, but why. + if dot > i && l == 0 && h == 0 && rem == 0 { + break Loop + } + } + } + repr[last-1] = '-' + last-- + + if e > 0 { + return string(repr[last+pos:]) + "E+" + strconv.Itoa(e) + } + if e < 0 { + return string(repr[last+pos:]) + "E" + strconv.Itoa(e) + } + return string(repr[last+pos:]) +} + +func divmod(h, l uint64, div uint32) (qh, ql uint64, rem uint32) { + div64 := uint64(div) + a := h >> 32 + aq := a / div64 + ar := a % div64 + b := ar<<32 + h&(1<<32-1) + bq := b / div64 + br := b % div64 + c := br<<32 + l>>32 + cq := c / div64 + cr := c % div64 + d := cr<<32 + l&(1<<32-1) + dq := d / div64 + dr := d % div64 + return (aq<<32 | bq), (cq<<32 | dq), uint32(dr) +} + +var dNaN = Decimal128{0x1F << 58, 0} +var dPosInf = Decimal128{0x1E << 58, 0} +var dNegInf = Decimal128{0x3E << 58, 0} + +func dErr(s string) (Decimal128, error) { + return dNaN, fmt.Errorf("cannot parse %q as a decimal128", s) +} + +// ParseDecimal128 parse a string and return the corresponding value as +// a decimal128 +func ParseDecimal128(s string) (Decimal128, error) { + orig := s + if s == "" { + return dErr(orig) + } + neg := s[0] == '-' + if neg || s[0] == '+' { + s = s[1:] + } + + if (len(s) == 3 || len(s) == 8) && (s[0] == 'N' || s[0] == 'n' || s[0] == 'I' || s[0] == 'i') { + if s == "NaN" || s == "nan" || strings.EqualFold(s, "nan") { + return dNaN, nil + } + if s == "Inf" || s == "inf" || strings.EqualFold(s, "inf") || strings.EqualFold(s, "infinity") { + if neg { + return dNegInf, nil + } + return dPosInf, nil + } + return dErr(orig) + } + + var h, l uint64 + var e int + + var add, ovr uint32 + var mul uint32 = 1 + var dot = -1 + var digits = 0 + var i = 0 + for i < len(s) { + c := s[i] + if mul == 1e9 { + h, l, ovr = muladd(h, l, mul, add) + mul, add = 1, 0 + if ovr > 0 || h&((1<<15-1)<<49) > 0 { + return dErr(orig) + } + } + if c >= '0' && c <= '9' { + i++ + if c > '0' || digits > 0 { + digits++ + } + if digits > 34 { + if c == '0' { + // Exact rounding. + e++ + continue + } + return dErr(orig) + } + mul *= 10 + add *= 10 + add += uint32(c - '0') + continue + } + if c == '.' { + i++ + if dot >= 0 || i == 1 && len(s) == 1 { + return dErr(orig) + } + if i == len(s) { + break + } + if s[i] < '0' || s[i] > '9' || e > 0 { + return dErr(orig) + } + dot = i + continue + } + break + } + if i == 0 { + return dErr(orig) + } + if mul > 1 { + h, l, ovr = muladd(h, l, mul, add) + if ovr > 0 || h&((1<<15-1)<<49) > 0 { + return dErr(orig) + } + } + if dot >= 0 { + e += dot - i + } + if i+1 < len(s) && (s[i] == 'E' || s[i] == 'e') { + i++ + eneg := s[i] == '-' + if eneg || s[i] == '+' { + i++ + if i == len(s) { + return dErr(orig) + } + } + n := 0 + for i < len(s) && n < 1e4 { + c := s[i] + i++ + if c < '0' || c > '9' { + return dErr(orig) + } + n *= 10 + n += int(c - '0') + } + if eneg { + n = -n + } + e += n + for e < -6176 { + // Subnormal. + var div uint32 = 1 + for div < 1e9 && e < -6176 { + div *= 10 + e++ + } + var rem uint32 + h, l, rem = divmod(h, l, div) + if rem > 0 { + return dErr(orig) + } + } + for e > 6111 { + // Clamped. + var mul uint32 = 1 + for mul < 1e9 && e > 6111 { + mul *= 10 + e-- + } + h, l, ovr = muladd(h, l, mul, 0) + if ovr > 0 || h&((1<<15-1)<<49) > 0 { + return dErr(orig) + } + } + if e < -6176 || e > 6111 { + return dErr(orig) + } + } + + if i < len(s) { + return dErr(orig) + } + + h |= uint64(e+6176) & uint64(1<<14-1) << 49 + if neg { + h |= 1 << 63 + } + return Decimal128{h, l}, nil +} + +func muladd(h, l uint64, mul uint32, add uint32) (resh, resl uint64, overflow uint32) { + mul64 := uint64(mul) + a := mul64 * (l & (1<<32 - 1)) + b := a>>32 + mul64*(l>>32) + c := b>>32 + mul64*(h&(1<<32-1)) + d := c>>32 + mul64*(h>>32) + + a = a&(1<<32-1) + uint64(add) + b = b&(1<<32-1) + a>>32 + c = c&(1<<32-1) + b>>32 + d = d&(1<<32-1) + c>>32 + + return (d<<32 | c&(1<<32-1)), (b<<32 | a&(1<<32-1)), uint32(d >> 32) +} diff --git a/go/vendor/github.com/globalsign/mgo/bson/decode.go b/go/vendor/github.com/globalsign/mgo/bson/decode.go new file mode 100644 index 0000000..658856a --- /dev/null +++ b/go/vendor/github.com/globalsign/mgo/bson/decode.go @@ -0,0 +1,1055 @@ +// BSON library for Go +// +// Copyright (c) 2010-2012 - Gustavo Niemeyer +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// 2. 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. +// gobson - BSON library for Go. + +package bson + +import ( + "errors" + "fmt" + "io" + "math" + "net/url" + "reflect" + "strconv" + "sync" + "time" +) + +type decoder struct { + in []byte + i int + docType reflect.Type +} + +var typeM = reflect.TypeOf(M{}) + +func newDecoder(in []byte) *decoder { + return &decoder{in, 0, typeM} +} + +// -------------------------------------------------------------------------- +// Some helper functions. + +func corrupted() { + panic("Document is corrupted") +} + +// -------------------------------------------------------------------------- +// Unmarshaling of documents. + +const ( + setterUnknown = iota + setterNone + setterType + setterAddr +) + +var setterStyles map[reflect.Type]int +var setterIface reflect.Type +var setterMutex sync.RWMutex + +func init() { + var iface Setter + setterIface = reflect.TypeOf(&iface).Elem() + setterStyles = make(map[reflect.Type]int) +} + +func setterStyle(outt reflect.Type) int { + setterMutex.RLock() + style := setterStyles[outt] + setterMutex.RUnlock() + if style != setterUnknown { + return style + } + + setterMutex.Lock() + defer setterMutex.Unlock() + if outt.Implements(setterIface) { + style = setterType + } else if reflect.PtrTo(outt).Implements(setterIface) { + style = setterAddr + } else { + style = setterNone + } + setterStyles[outt] = style + return style +} + +func getSetter(outt reflect.Type, out reflect.Value) Setter { + style := setterStyle(outt) + if style == setterNone { + return nil + } + if style == setterAddr { + if !out.CanAddr() { + return nil + } + out = out.Addr() + } else if outt.Kind() == reflect.Ptr && out.IsNil() { + out.Set(reflect.New(outt.Elem())) + } + return out.Interface().(Setter) +} + +func clearMap(m reflect.Value) { + var none reflect.Value + for _, k := range m.MapKeys() { + m.SetMapIndex(k, none) + } +} + +func (d *decoder) readDocTo(out reflect.Value) { + var elemType reflect.Type + outt := out.Type() + outk := outt.Kind() + + for { + if outk == reflect.Ptr && out.IsNil() { + out.Set(reflect.New(outt.Elem())) + } + if setter := getSetter(outt, out); setter != nil { + raw := d.readRaw(ElementDocument) + err := setter.SetBSON(raw) + if _, ok := err.(*TypeError); err != nil && !ok { + panic(err) + } + return + } + if outk == reflect.Ptr { + out = out.Elem() + outt = out.Type() + outk = out.Kind() + continue + } + break + } + + var fieldsMap map[string]fieldInfo + var inlineMap reflect.Value + if outt == typeRaw { + out.Set(reflect.ValueOf(d.readRaw(ElementDocument))) + return + } + + origout := out + if outk == reflect.Interface { + if d.docType.Kind() == reflect.Map { + mv := reflect.MakeMap(d.docType) + out.Set(mv) + out = mv + } else { + dv := reflect.New(d.docType).Elem() + out.Set(dv) + out = dv + } + outt = out.Type() + outk = outt.Kind() + } + + docType := d.docType + keyType := typeString + convertKey := false + switch outk { + case reflect.Map: + keyType = outt.Key() + if keyType != typeString { + convertKey = true + } + elemType = outt.Elem() + if elemType == typeIface { + d.docType = outt + } + if out.IsNil() { + out.Set(reflect.MakeMap(out.Type())) + } else if out.Len() > 0 { + clearMap(out) + } + case reflect.Struct: + sinfo, err := getStructInfo(out.Type()) + if err != nil { + panic(err) + } + fieldsMap = sinfo.FieldsMap + out.Set(sinfo.Zero) + if sinfo.InlineMap != -1 { + inlineMap = out.Field(sinfo.InlineMap) + if !inlineMap.IsNil() && inlineMap.Len() > 0 { + clearMap(inlineMap) + } + elemType = inlineMap.Type().Elem() + if elemType == typeIface { + d.docType = inlineMap.Type() + } + } + case reflect.Slice: + switch outt.Elem() { + case typeDocElem: + origout.Set(d.readDocElems(outt)) + return + case typeRawDocElem: + origout.Set(d.readRawDocElems(outt)) + return + } + fallthrough + default: + panic("Unsupported document type for unmarshalling: " + out.Type().String()) + } + + end := int(d.readInt32()) + end += d.i - 4 + if end <= d.i || end > len(d.in) || d.in[end-1] != '\x00' { + corrupted() + } + for d.in[d.i] != '\x00' { + kind := d.readByte() + name := d.readCStr() + if d.i >= end { + corrupted() + } + + switch outk { + case reflect.Map: + e := reflect.New(elemType).Elem() + if d.readElemTo(e, kind) { + k := reflect.ValueOf(name) + if convertKey { + mapKeyType := out.Type().Key() + mapKeyKind := mapKeyType.Kind() + + switch mapKeyKind { + case reflect.Int: + fallthrough + case reflect.Int8: + fallthrough + case reflect.Int16: + fallthrough + case reflect.Int32: + fallthrough + case reflect.Int64: + fallthrough + case reflect.Uint: + fallthrough + case reflect.Uint8: + fallthrough + case reflect.Uint16: + fallthrough + case reflect.Uint32: + fallthrough + case reflect.Uint64: + fallthrough + case reflect.Float32: + fallthrough + case reflect.Float64: + parsed := d.parseMapKeyAsFloat(k, mapKeyKind) + k = reflect.ValueOf(parsed) + case reflect.String: + mapKeyType = keyType + default: + panic("BSON map must have string or decimal keys. Got: " + outt.String()) + } + + k = k.Convert(mapKeyType) + } + out.SetMapIndex(k, e) + } + case reflect.Struct: + if info, ok := fieldsMap[name]; ok { + if info.Inline == nil { + d.readElemTo(out.Field(info.Num), kind) + } else { + d.readElemTo(out.FieldByIndex(info.Inline), kind) + } + } else if inlineMap.IsValid() { + if inlineMap.IsNil() { + inlineMap.Set(reflect.MakeMap(inlineMap.Type())) + } + e := reflect.New(elemType).Elem() + if d.readElemTo(e, kind) { + inlineMap.SetMapIndex(reflect.ValueOf(name), e) + } + } else { + d.dropElem(kind) + } + case reflect.Slice: + } + + if d.i >= end { + corrupted() + } + } + d.i++ // '\x00' + if d.i != end { + corrupted() + } + d.docType = docType +} + +func (decoder) parseMapKeyAsFloat(k reflect.Value, mapKeyKind reflect.Kind) float64 { + parsed, err := strconv.ParseFloat(k.String(), 64) + if err != nil { + panic("Map key is defined to be a decimal type (" + mapKeyKind.String() + ") but got error " + + err.Error()) + } + + return parsed +} + +func (d *decoder) readArrayDocTo(out reflect.Value) { + end := int(d.readInt32()) + end += d.i - 4 + if end <= d.i || end > len(d.in) || d.in[end-1] != '\x00' { + corrupted() + } + i := 0 + l := out.Len() + for d.in[d.i] != '\x00' { + if i >= l { + panic("Length mismatch on array field") + } + kind := d.readByte() + for d.i < end && d.in[d.i] != '\x00' { + d.i++ + } + if d.i >= end { + corrupted() + } + d.i++ + d.readElemTo(out.Index(i), kind) + if d.i >= end { + corrupted() + } + i++ + } + if i != l { + panic("Length mismatch on array field") + } + d.i++ // '\x00' + if d.i != end { + corrupted() + } +} + +func (d *decoder) readSliceDoc(t reflect.Type) interface{} { + tmp := make([]reflect.Value, 0, 8) + elemType := t.Elem() + if elemType == typeRawDocElem { + d.dropElem(ElementArray) + return reflect.Zero(t).Interface() + } + if elemType == typeRaw { + return d.readSliceOfRaw() + } + + end := int(d.readInt32()) + end += d.i - 4 + if end <= d.i || end > len(d.in) || d.in[end-1] != '\x00' { + corrupted() + } + for d.in[d.i] != '\x00' { + kind := d.readByte() + for d.i < end && d.in[d.i] != '\x00' { + d.i++ + } + if d.i >= end { + corrupted() + } + d.i++ + e := reflect.New(elemType).Elem() + if d.readElemTo(e, kind) { + tmp = append(tmp, e) + } + if d.i >= end { + corrupted() + } + } + d.i++ // '\x00' + if d.i != end { + corrupted() + } + + n := len(tmp) + slice := reflect.MakeSlice(t, n, n) + for i := 0; i != n; i++ { + slice.Index(i).Set(tmp[i]) + } + return slice.Interface() +} + +func BSONElementSize(kind byte, offset int, buffer []byte) (int, error) { + switch kind { + case ElementFloat64: // Float64 + return 8, nil + case ElementJavaScriptWithoutScope: // JavaScript without scope + fallthrough + case ElementSymbol: // Symbol + fallthrough + case ElementString: // UTF-8 string + size, err := getSize(offset, buffer) + if err != nil { + return 0, err + } + if size < 1 { + return 0, errors.New("String size can't be less then one byte") + } + size += 4 + if offset+size > len(buffer) { + return 0, io.ErrUnexpectedEOF + } + if buffer[offset+size-1] != 0 { + return 0, errors.New("Invalid string: non zero-terminated") + } + return size, nil + case ElementArray: // Array + fallthrough + case ElementDocument: // Document + size, err := getSize(offset, buffer) + if err != nil { + return 0, err + } + if size < 5 { + return 0, errors.New("Declared document size is too small") + } + return size, nil + case ElementBinary: // Binary + size, err := getSize(offset, buffer) + if err != nil { + return 0, err + } + if size < 0 { + return 0, errors.New("Binary data size can't be negative") + } + return size + 5, nil + case Element06: // Undefined (obsolete, but still seen in the wild) + return 0, nil + case ElementObjectId: // ObjectId + return 12, nil + case ElementBool: // Bool + return 1, nil + case ElementDatetime: // Timestamp + return 8, nil + case ElementNil: // Nil + return 0, nil + case ElementRegEx: // RegEx + end := offset + for i := 0; i < 2; i++ { + for end < len(buffer) && buffer[end] != '\x00' { + end++ + } + end++ + } + if end > len(buffer) { + return 0, io.ErrUnexpectedEOF + } + return end - offset, nil + case ElementDBPointer: // DBPointer + size, err := getSize(offset, buffer) + if err != nil { + return 0, err + } + if size < 1 { + return 0, errors.New("String size can't be less then one byte") + } + return size + 12 + 4, nil + case ElementJavaScriptWithScope: // JavaScript with scope + size, err := getSize(offset, buffer) + if err != nil { + return 0, err + } + if size < 4+5+5 { + return 0, errors.New("Declared document element is too small") + } + return size, nil + case ElementInt32: // Int32 + return 4, nil + case ElementTimestamp: // Mongo-specific timestamp + return 8, nil + case ElementInt64: // Int64 + return 8, nil + case ElementDecimal128: // Decimal128 + return 16, nil + case ElementMaxKey: // Max key + return 0, nil + case ElementMinKey: // Min key + return 0, nil + default: + return 0, errors.New(fmt.Sprintf("Unknown element kind (0x%02X)", kind)) + } +} + +func (d *decoder) readRaw(kind byte) Raw { + size, err := BSONElementSize(kind, d.i, d.in) + if err != nil { + corrupted() + } + if d.i+size > len(d.in) { + corrupted() + } + d.i += size + return Raw{ + Kind: kind, + Data: d.in[d.i-size : d.i], + } +} + +func (d *decoder) readSliceOfRaw() interface{} { + tmp := make([]Raw, 0, 8) + end := int(d.readInt32()) + end += d.i - 4 + if end <= d.i || end > len(d.in) || d.in[end-1] != '\x00' { + corrupted() + } + for d.in[d.i] != '\x00' { + kind := d.readByte() + for d.i < end && d.in[d.i] != '\x00' { + d.i++ + } + if d.i >= end { + corrupted() + } + d.i++ + e := d.readRaw(kind) + tmp = append(tmp, e) + if d.i >= end { + corrupted() + } + } + d.i++ // '\x00' + if d.i != end { + corrupted() + } + return tmp +} + +var typeSlice = reflect.TypeOf([]interface{}{}) +var typeIface = typeSlice.Elem() + +func (d *decoder) readDocElems(typ reflect.Type) reflect.Value { + docType := d.docType + d.docType = typ + slice := make([]DocElem, 0, 8) + d.readDocWith(func(kind byte, name string) { + e := DocElem{Name: name} + v := reflect.ValueOf(&e.Value) + if d.readElemTo(v.Elem(), kind) { + slice = append(slice, e) + } + }) + slicev := reflect.New(typ).Elem() + slicev.Set(reflect.ValueOf(slice)) + d.docType = docType + return slicev +} + +func (d *decoder) readRawDocElems(typ reflect.Type) reflect.Value { + docType := d.docType + d.docType = typ + slice := make([]RawDocElem, 0, 8) + d.readDocWith(func(kind byte, name string) { + e := RawDocElem{Name: name, Value: d.readRaw(kind)} + slice = append(slice, e) + }) + slicev := reflect.New(typ).Elem() + slicev.Set(reflect.ValueOf(slice)) + d.docType = docType + return slicev +} + +func (d *decoder) readDocWith(f func(kind byte, name string)) { + end := int(d.readInt32()) + end += d.i - 4 + if end <= d.i || end > len(d.in) || d.in[end-1] != '\x00' { + corrupted() + } + for d.in[d.i] != '\x00' { + kind := d.readByte() + name := d.readCStr() + if d.i >= end { + corrupted() + } + f(kind, name) + if d.i >= end { + corrupted() + } + } + d.i++ // '\x00' + if d.i != end { + corrupted() + } +} + +// -------------------------------------------------------------------------- +// Unmarshaling of individual elements within a document. +func (d *decoder) dropElem(kind byte) { + size, err := BSONElementSize(kind, d.i, d.in) + if err != nil { + corrupted() + } + if d.i+size > len(d.in) { + corrupted() + } + d.i += size +} + +// Attempt to decode an element from the document and put it into out. +// If the types are not compatible, the returned ok value will be +// false and out will be unchanged. +func (d *decoder) readElemTo(out reflect.Value, kind byte) (good bool) { + outt := out.Type() + + if outt == typeRaw { + out.Set(reflect.ValueOf(d.readRaw(kind))) + return true + } + + if outt == typeRawPtr { + raw := d.readRaw(kind) + out.Set(reflect.ValueOf(&raw)) + return true + } + + if kind == ElementDocument { + // Delegate unmarshaling of documents. + outt := out.Type() + outk := out.Kind() + switch outk { + case reflect.Interface, reflect.Ptr, reflect.Struct, reflect.Map: + d.readDocTo(out) + return true + } + if setterStyle(outt) != setterNone { + d.readDocTo(out) + return true + } + if outk == reflect.Slice { + switch outt.Elem() { + case typeDocElem: + out.Set(d.readDocElems(outt)) + case typeRawDocElem: + out.Set(d.readRawDocElems(outt)) + default: + d.dropElem(kind) + } + return true + } + d.dropElem(kind) + return true + } + + if setter := getSetter(outt, out); setter != nil { + err := setter.SetBSON(d.readRaw(kind)) + if err == ErrSetZero { + out.Set(reflect.Zero(outt)) + return true + } + if err == nil { + return true + } + if _, ok := err.(*TypeError); !ok { + panic(err) + } + return false + } + + var in interface{} + + switch kind { + case ElementFloat64: + in = d.readFloat64() + case ElementString: + in = d.readStr() + case ElementDocument: + panic("Can't happen. Handled above.") + case ElementArray: + outt := out.Type() + if setterStyle(outt) != setterNone { + // Skip the value so its data is handed to the setter below. + d.dropElem(kind) + break + } + for outt.Kind() == reflect.Ptr { + outt = outt.Elem() + } + switch outt.Kind() { + case reflect.Array: + d.readArrayDocTo(out) + return true + case reflect.Slice: + in = d.readSliceDoc(outt) + default: + in = d.readSliceDoc(typeSlice) + } + case ElementBinary: + b := d.readBinary() + if b.Kind == BinaryGeneric || b.Kind == BinaryBinaryOld { + in = b.Data + } else { + in = b + } + case Element06: // Undefined (obsolete, but still seen in the wild) + in = Undefined + case ElementObjectId: + in = ObjectId(d.readBytes(12)) + case ElementBool: + in = d.readBool() + case ElementDatetime: // Timestamp + // MongoDB handles timestamps as milliseconds. + i := d.readInt64() + if i == -62135596800000 { + in = time.Time{} // In UTC for convenience. + } else { + in = time.Unix(i/1e3, i%1e3*1e6).UTC() + } + case ElementNil: + in = nil + case ElementRegEx: + in = d.readRegEx() + case ElementDBPointer: + in = DBPointer{Namespace: d.readStr(), Id: ObjectId(d.readBytes(12))} + case ElementJavaScriptWithoutScope: + in = JavaScript{Code: d.readStr()} + case ElementSymbol: + in = Symbol(d.readStr()) + case ElementJavaScriptWithScope: + start := d.i + l := int(d.readInt32()) + js := JavaScript{d.readStr(), make(M)} + d.readDocTo(reflect.ValueOf(js.Scope)) + if d.i != start+l { + corrupted() + } + in = js + case ElementInt32: + in = int(d.readInt32()) + case ElementTimestamp: // Mongo-specific timestamp + in = MongoTimestamp(d.readInt64()) + case ElementInt64: + switch out.Type() { + case typeTimeDuration: + in = time.Duration(time.Duration(d.readInt64()) * time.Millisecond) + default: + in = d.readInt64() + } + case ElementDecimal128: + in = Decimal128{ + l: uint64(d.readInt64()), + h: uint64(d.readInt64()), + } + case ElementMaxKey: + in = MaxKey + case ElementMinKey: + in = MinKey + default: + panic(fmt.Sprintf("Unknown element kind (0x%02X)", kind)) + } + + if in == nil { + out.Set(reflect.Zero(outt)) + return true + } + + outk := outt.Kind() + + // Dereference and initialize pointer if necessary. + first := true + for outk == reflect.Ptr { + if !out.IsNil() { + out = out.Elem() + } else { + elem := reflect.New(outt.Elem()) + if first { + // Only set if value is compatible. + first = false + defer func(out, elem reflect.Value) { + if good { + out.Set(elem) + } + }(out, elem) + } else { + out.Set(elem) + } + out = elem + } + outt = out.Type() + outk = outt.Kind() + } + + inv := reflect.ValueOf(in) + if outt == inv.Type() { + out.Set(inv) + return true + } + + switch outk { + case reflect.Interface: + out.Set(inv) + return true + case reflect.String: + switch inv.Kind() { + case reflect.String: + out.SetString(inv.String()) + return true + case reflect.Slice: + if b, ok := in.([]byte); ok { + out.SetString(string(b)) + return true + } + case reflect.Int, reflect.Int64: + if outt == typeJSONNumber { + out.SetString(strconv.FormatInt(inv.Int(), 10)) + return true + } + case reflect.Float64: + if outt == typeJSONNumber { + out.SetString(strconv.FormatFloat(inv.Float(), 'f', -1, 64)) + return true + } + } + case reflect.Slice, reflect.Array: + // Remember, array (0x04) slices are built with the correct + // element type. If we are here, must be a cross BSON kind + // conversion (e.g. 0x05 unmarshalling on string). + if outt.Elem().Kind() != reflect.Uint8 { + break + } + switch inv.Kind() { + case reflect.String: + slice := []byte(inv.String()) + out.Set(reflect.ValueOf(slice)) + return true + case reflect.Slice: + switch outt.Kind() { + case reflect.Array: + reflect.Copy(out, inv) + case reflect.Slice: + out.SetBytes(inv.Bytes()) + } + return true + } + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + switch inv.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + out.SetInt(inv.Int()) + return true + case reflect.Float32, reflect.Float64: + out.SetInt(int64(inv.Float())) + return true + case reflect.Bool: + if inv.Bool() { + out.SetInt(1) + } else { + out.SetInt(0) + } + return true + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + panic("can't happen: no uint types in BSON (!?)") + } + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + switch inv.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + out.SetUint(uint64(inv.Int())) + return true + case reflect.Float32, reflect.Float64: + out.SetUint(uint64(inv.Float())) + return true + case reflect.Bool: + if inv.Bool() { + out.SetUint(1) + } else { + out.SetUint(0) + } + return true + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + panic("Can't happen. No uint types in BSON.") + } + case reflect.Float32, reflect.Float64: + switch inv.Kind() { + case reflect.Float32, reflect.Float64: + out.SetFloat(inv.Float()) + return true + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + out.SetFloat(float64(inv.Int())) + return true + case reflect.Bool: + if inv.Bool() { + out.SetFloat(1) + } else { + out.SetFloat(0) + } + return true + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + panic("Can't happen. No uint types in BSON?") + } + case reflect.Bool: + switch inv.Kind() { + case reflect.Bool: + out.SetBool(inv.Bool()) + return true + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + out.SetBool(inv.Int() != 0) + return true + case reflect.Float32, reflect.Float64: + out.SetBool(inv.Float() != 0) + return true + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + panic("Can't happen. No uint types in BSON?") + } + case reflect.Struct: + if outt == typeURL && inv.Kind() == reflect.String { + u, err := url.Parse(inv.String()) + if err != nil { + panic(err) + } + out.Set(reflect.ValueOf(u).Elem()) + return true + } + if outt == typeBinary { + if b, ok := in.([]byte); ok { + out.Set(reflect.ValueOf(Binary{Data: b})) + return true + } + } + } + + return false +} + +// -------------------------------------------------------------------------- +// Parsers of basic types. + +func (d *decoder) readRegEx() RegEx { + re := RegEx{} + re.Pattern = d.readCStr() + re.Options = d.readCStr() + return re +} + +func (d *decoder) readBinary() Binary { + l := d.readInt32() + b := Binary{} + b.Kind = d.readByte() + if b.Kind == BinaryBinaryOld && l > 4 { + // Weird obsolete format with redundant length. + rl := d.readInt32() + if rl != l-4 { + corrupted() + } + l = rl + } + b.Data = d.readBytes(l) + return b +} + +func (d *decoder) readStr() string { + l := d.readInt32() + b := d.readBytes(l - 1) + if d.readByte() != '\x00' { + corrupted() + } + return string(b) +} + +func (d *decoder) readCStr() string { + start := d.i + end := start + l := len(d.in) + for ; end != l; end++ { + if d.in[end] == '\x00' { + break + } + } + d.i = end + 1 + if d.i > l { + corrupted() + } + return string(d.in[start:end]) +} + +func (d *decoder) readBool() bool { + b := d.readByte() + if b == 0 { + return false + } + if b == 1 { + return true + } + panic(fmt.Sprintf("encoded boolean must be 1 or 0, found %d", b)) +} + +func (d *decoder) readFloat64() float64 { + return math.Float64frombits(uint64(d.readInt64())) +} + +func (d *decoder) readInt32() int32 { + b := d.readBytes(4) + return int32((uint32(b[0]) << 0) | + (uint32(b[1]) << 8) | + (uint32(b[2]) << 16) | + (uint32(b[3]) << 24)) +} + +func getSize(offset int, b []byte) (int, error) { + if offset+4 > len(b) { + return 0, io.ErrUnexpectedEOF + } + return int((uint32(b[offset]) << 0) | + (uint32(b[offset+1]) << 8) | + (uint32(b[offset+2]) << 16) | + (uint32(b[offset+3]) << 24)), nil +} + +func (d *decoder) readInt64() int64 { + b := d.readBytes(8) + return int64((uint64(b[0]) << 0) | + (uint64(b[1]) << 8) | + (uint64(b[2]) << 16) | + (uint64(b[3]) << 24) | + (uint64(b[4]) << 32) | + (uint64(b[5]) << 40) | + (uint64(b[6]) << 48) | + (uint64(b[7]) << 56)) +} + +func (d *decoder) readByte() byte { + i := d.i + d.i++ + if d.i > len(d.in) { + corrupted() + } + return d.in[i] +} + +func (d *decoder) readBytes(length int32) []byte { + if length < 0 { + corrupted() + } + start := d.i + d.i += int(length) + if d.i < start || d.i > len(d.in) { + corrupted() + } + return d.in[start : start+int(length)] +} diff --git a/go/vendor/github.com/globalsign/mgo/bson/encode.go b/go/vendor/github.com/globalsign/mgo/bson/encode.go new file mode 100644 index 0000000..d0c6b2a --- /dev/null +++ b/go/vendor/github.com/globalsign/mgo/bson/encode.go @@ -0,0 +1,645 @@ +// BSON library for Go +// +// Copyright (c) 2010-2012 - Gustavo Niemeyer +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// 2. 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. +// gobson - BSON library for Go. + +package bson + +import ( + "encoding/json" + "fmt" + "math" + "net/url" + "reflect" + "sort" + "strconv" + "sync" + "time" +) + +// -------------------------------------------------------------------------- +// Some internal infrastructure. + +var ( + typeBinary = reflect.TypeOf(Binary{}) + typeObjectId = reflect.TypeOf(ObjectId("")) + typeDBPointer = reflect.TypeOf(DBPointer{"", ObjectId("")}) + typeSymbol = reflect.TypeOf(Symbol("")) + typeMongoTimestamp = reflect.TypeOf(MongoTimestamp(0)) + typeOrderKey = reflect.TypeOf(MinKey) + typeDocElem = reflect.TypeOf(DocElem{}) + typeRawDocElem = reflect.TypeOf(RawDocElem{}) + typeRaw = reflect.TypeOf(Raw{}) + typeRawPtr = reflect.PtrTo(reflect.TypeOf(Raw{})) + typeURL = reflect.TypeOf(url.URL{}) + typeTime = reflect.TypeOf(time.Time{}) + typeString = reflect.TypeOf("") + typeJSONNumber = reflect.TypeOf(json.Number("")) + typeTimeDuration = reflect.TypeOf(time.Duration(0)) +) + +var ( + // spec for []uint8 or []byte encoding + arrayOps = map[string]bool{ + "$in": true, + "$nin": true, + "$all": true, + } +) + +const itoaCacheSize = 32 + +const ( + getterUnknown = iota + getterNone + getterTypeVal + getterTypePtr + getterAddr +) + +var itoaCache []string + +var getterStyles map[reflect.Type]int +var getterIface reflect.Type +var getterMutex sync.RWMutex + +func init() { + itoaCache = make([]string, itoaCacheSize) + for i := 0; i != itoaCacheSize; i++ { + itoaCache[i] = strconv.Itoa(i) + } + var iface Getter + getterIface = reflect.TypeOf(&iface).Elem() + getterStyles = make(map[reflect.Type]int) +} + +func itoa(i int) string { + if i < itoaCacheSize { + return itoaCache[i] + } + return strconv.Itoa(i) +} + +func getterStyle(outt reflect.Type) int { + getterMutex.RLock() + style := getterStyles[outt] + getterMutex.RUnlock() + if style != getterUnknown { + return style + } + + getterMutex.Lock() + defer getterMutex.Unlock() + if outt.Implements(getterIface) { + vt := outt + for vt.Kind() == reflect.Ptr { + vt = vt.Elem() + } + if vt.Implements(getterIface) { + style = getterTypeVal + } else { + style = getterTypePtr + } + } else if reflect.PtrTo(outt).Implements(getterIface) { + style = getterAddr + } else { + style = getterNone + } + getterStyles[outt] = style + return style +} + +func getGetter(outt reflect.Type, out reflect.Value) Getter { + style := getterStyle(outt) + if style == getterNone { + return nil + } + if style == getterAddr { + if !out.CanAddr() { + return nil + } + return out.Addr().Interface().(Getter) + } + if style == getterTypeVal && out.Kind() == reflect.Ptr && out.IsNil() { + return nil + } + return out.Interface().(Getter) +} + +// -------------------------------------------------------------------------- +// Marshaling of the document value itself. + +type encoder struct { + out []byte +} + +func (e *encoder) addDoc(v reflect.Value) { + for { + if vi, ok := v.Interface().(Getter); ok { + getv, err := vi.GetBSON() + if err != nil { + panic(err) + } + v = reflect.ValueOf(getv) + continue + } + if v.Kind() == reflect.Ptr { + v = v.Elem() + continue + } + break + } + + if v.Type() == typeRaw { + raw := v.Interface().(Raw) + if raw.Kind != 0x03 && raw.Kind != 0x00 { + panic("Attempted to marshal Raw kind " + strconv.Itoa(int(raw.Kind)) + " as a document") + } + if len(raw.Data) == 0 { + panic("Attempted to marshal empty Raw document") + } + e.addBytes(raw.Data...) + return + } + + start := e.reserveInt32() + + switch v.Kind() { + case reflect.Map: + e.addMap(v) + case reflect.Struct: + e.addStruct(v) + case reflect.Array, reflect.Slice: + e.addSlice(v) + default: + panic("Can't marshal " + v.Type().String() + " as a BSON document") + } + + e.addBytes(0) + e.setInt32(start, int32(len(e.out)-start)) +} + +func (e *encoder) addMap(v reflect.Value) { + for _, k := range v.MapKeys() { + e.addElem(fmt.Sprint(k), v.MapIndex(k), false) + } +} + +func (e *encoder) addStruct(v reflect.Value) { + sinfo, err := getStructInfo(v.Type()) + if err != nil { + panic(err) + } + var value reflect.Value + if sinfo.InlineMap >= 0 { + m := v.Field(sinfo.InlineMap) + if m.Len() > 0 { + for _, k := range m.MapKeys() { + ks := k.String() + if _, found := sinfo.FieldsMap[ks]; found { + panic(fmt.Sprintf("Can't have key %q in inlined map; conflicts with struct field", ks)) + } + e.addElem(ks, m.MapIndex(k), false) + } + } + } + for _, info := range sinfo.FieldsList { + if info.Inline == nil { + value = v.Field(info.Num) + } else { + // as pointers to struct are allowed here, + // there is no guarantee that pointer won't be nil. + // + // It is expected allowed behaviour + // so info.Inline MAY consist index to a nil pointer + // and that is why we safely call v.FieldByIndex and just continue on panic + field, errField := safeFieldByIndex(v, info.Inline) + if errField != nil { + continue + } + + value = field + } + if info.OmitEmpty && isZero(value) { + continue + } + if useRespectNilValues && + (value.Kind() == reflect.Slice || value.Kind() == reflect.Map) && + value.IsNil() { + e.addElem(info.Key, reflect.ValueOf(nil), info.MinSize) + continue + } + e.addElem(info.Key, value, info.MinSize) + } +} + +func safeFieldByIndex(v reflect.Value, index []int) (result reflect.Value, err error) { + defer func() { + if recovered := recover(); recovered != nil { + switch r := recovered.(type) { + case string: + err = fmt.Errorf("%s", r) + case error: + err = r + } + } + }() + + result = v.FieldByIndex(index) + return +} + +func isZero(v reflect.Value) bool { + switch v.Kind() { + case reflect.String: + return len(v.String()) == 0 + case reflect.Ptr, reflect.Interface: + return v.IsNil() + case reflect.Slice: + return v.Len() == 0 + case reflect.Map: + return v.Len() == 0 + 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.Bool: + return !v.Bool() + case reflect.Struct: + vt := v.Type() + if vt == typeTime { + return v.Interface().(time.Time).IsZero() + } + for i := 0; i < v.NumField(); i++ { + if vt.Field(i).PkgPath != "" && !vt.Field(i).Anonymous { + continue // Private field + } + if !isZero(v.Field(i)) { + return false + } + } + return true + } + return false +} + +func (e *encoder) addSlice(v reflect.Value) { + vi := v.Interface() + if d, ok := vi.(D); ok { + for _, elem := range d { + e.addElem(elem.Name, reflect.ValueOf(elem.Value), false) + } + return + } + if d, ok := vi.(RawD); ok { + for _, elem := range d { + e.addElem(elem.Name, reflect.ValueOf(elem.Value), false) + } + return + } + l := v.Len() + et := v.Type().Elem() + if et == typeDocElem { + for i := 0; i < l; i++ { + elem := v.Index(i).Interface().(DocElem) + e.addElem(elem.Name, reflect.ValueOf(elem.Value), false) + } + return + } + if et == typeRawDocElem { + for i := 0; i < l; i++ { + elem := v.Index(i).Interface().(RawDocElem) + e.addElem(elem.Name, reflect.ValueOf(elem.Value), false) + } + return + } + for i := 0; i < l; i++ { + e.addElem(itoa(i), v.Index(i), false) + } +} + +// -------------------------------------------------------------------------- +// Marshaling of elements in a document. + +func (e *encoder) addElemName(kind byte, name string) { + e.addBytes(kind) + e.addBytes([]byte(name)...) + e.addBytes(0) +} + +func (e *encoder) addElem(name string, v reflect.Value, minSize bool) { + + if !v.IsValid() { + e.addElemName(0x0A, name) + return + } + + if getter := getGetter(v.Type(), v); getter != nil { + getv, err := getter.GetBSON() + if err != nil { + panic(err) + } + e.addElem(name, reflect.ValueOf(getv), minSize) + return + } + + switch v.Kind() { + + case reflect.Interface: + e.addElem(name, v.Elem(), minSize) + + case reflect.Ptr: + e.addElem(name, v.Elem(), minSize) + + case reflect.String: + s := v.String() + switch v.Type() { + case typeObjectId: + if len(s) != 12 { + panic("ObjectIDs must be exactly 12 bytes long (got " + + strconv.Itoa(len(s)) + ")") + } + e.addElemName(0x07, name) + e.addBytes([]byte(s)...) + case typeSymbol: + e.addElemName(0x0E, name) + e.addStr(s) + case typeJSONNumber: + n := v.Interface().(json.Number) + if i, err := n.Int64(); err == nil { + e.addElemName(0x12, name) + e.addInt64(i) + } else if f, err := n.Float64(); err == nil { + e.addElemName(0x01, name) + e.addFloat64(f) + } else { + panic("failed to convert json.Number to a number: " + s) + } + default: + e.addElemName(0x02, name) + e.addStr(s) + } + + case reflect.Float32, reflect.Float64: + e.addElemName(0x01, name) + e.addFloat64(v.Float()) + + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + u := v.Uint() + if int64(u) < 0 { + panic("BSON has no uint64 type, and value is too large to fit correctly in an int64") + } else if u <= math.MaxInt32 && (minSize || v.Kind() <= reflect.Uint32) { + e.addElemName(0x10, name) + e.addInt32(int32(u)) + } else { + e.addElemName(0x12, name) + e.addInt64(int64(u)) + } + + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + switch v.Type() { + case typeMongoTimestamp: + e.addElemName(0x11, name) + e.addInt64(v.Int()) + + case typeOrderKey: + if v.Int() == int64(MaxKey) { + e.addElemName(0x7F, name) + } else { + e.addElemName(0xFF, name) + } + case typeTimeDuration: + // Stored as int64 + e.addElemName(0x12, name) + + e.addInt64(int64(v.Int() / 1e6)) + default: + i := v.Int() + if (minSize || v.Type().Kind() != reflect.Int64) && i >= math.MinInt32 && i <= math.MaxInt32 { + // It fits into an int32, encode as such. + e.addElemName(0x10, name) + e.addInt32(int32(i)) + } else { + e.addElemName(0x12, name) + e.addInt64(i) + } + } + + case reflect.Bool: + e.addElemName(0x08, name) + if v.Bool() { + e.addBytes(1) + } else { + e.addBytes(0) + } + + case reflect.Map: + e.addElemName(0x03, name) + e.addDoc(v) + + case reflect.Slice: + vt := v.Type() + et := vt.Elem() + if et.Kind() == reflect.Uint8 { + if arrayOps[name] { + e.addElemName(0x04, name) + e.addDoc(v) + } else { + e.addElemName(0x05, name) + e.addBinary(0x00, v.Bytes()) + } + } else if et == typeDocElem || et == typeRawDocElem { + e.addElemName(0x03, name) + e.addDoc(v) + } else { + e.addElemName(0x04, name) + e.addDoc(v) + } + + case reflect.Array: + et := v.Type().Elem() + if et.Kind() == reflect.Uint8 { + if arrayOps[name] { + e.addElemName(0x04, name) + e.addDoc(v) + } else { + e.addElemName(0x05, name) + if v.CanAddr() { + e.addBinary(0x00, v.Slice(0, v.Len()).Interface().([]byte)) + } else { + n := v.Len() + e.addInt32(int32(n)) + e.addBytes(0x00) + for i := 0; i < n; i++ { + el := v.Index(i) + e.addBytes(byte(el.Uint())) + } + } + } + } else { + e.addElemName(0x04, name) + e.addDoc(v) + } + + case reflect.Struct: + switch s := v.Interface().(type) { + + case Raw: + kind := s.Kind + if kind == 0x00 { + kind = 0x03 + } + if len(s.Data) == 0 && kind != 0x06 && kind != 0x0A && kind != 0xFF && kind != 0x7F { + panic("Attempted to marshal empty Raw document") + } + e.addElemName(kind, name) + e.addBytes(s.Data...) + + case Binary: + e.addElemName(0x05, name) + e.addBinary(s.Kind, s.Data) + + case Decimal128: + e.addElemName(0x13, name) + e.addInt64(int64(s.l)) + e.addInt64(int64(s.h)) + + case DBPointer: + e.addElemName(0x0C, name) + e.addStr(s.Namespace) + if len(s.Id) != 12 { + panic("ObjectIDs must be exactly 12 bytes long (got " + + strconv.Itoa(len(s.Id)) + ")") + } + e.addBytes([]byte(s.Id)...) + + case RegEx: + e.addElemName(0x0B, name) + e.addCStr(s.Pattern) + options := runes(s.Options) + sort.Sort(options) + e.addCStr(string(options)) + + case JavaScript: + if s.Scope == nil { + e.addElemName(0x0D, name) + e.addStr(s.Code) + } else { + e.addElemName(0x0F, name) + start := e.reserveInt32() + e.addStr(s.Code) + e.addDoc(reflect.ValueOf(s.Scope)) + e.setInt32(start, int32(len(e.out)-start)) + } + + case time.Time: + // MongoDB handles timestamps as milliseconds. + e.addElemName(0x09, name) + e.addInt64(s.Unix()*1000 + int64(s.Nanosecond()/1e6)) + + case url.URL: + e.addElemName(0x02, name) + e.addStr(s.String()) + + case undefined: + e.addElemName(0x06, name) + + default: + e.addElemName(0x03, name) + e.addDoc(v) + } + + default: + panic("Can't marshal " + v.Type().String() + " in a BSON document") + } +} + +// ------------- +// Helper method for sorting regex options +type runes []rune + +func (a runes) Len() int { return len(a) } +func (a runes) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a runes) Less(i, j int) bool { return a[i] < a[j] } + +// -------------------------------------------------------------------------- +// Marshaling of base types. + +func (e *encoder) addBinary(subtype byte, v []byte) { + if subtype == 0x02 { + // Wonder how that brilliant idea came to life. Obsolete, luckily. + e.addInt32(int32(len(v) + 4)) + e.addBytes(subtype) + e.addInt32(int32(len(v))) + } else { + e.addInt32(int32(len(v))) + e.addBytes(subtype) + } + e.addBytes(v...) +} + +func (e *encoder) addStr(v string) { + e.addInt32(int32(len(v) + 1)) + e.addCStr(v) +} + +func (e *encoder) addCStr(v string) { + e.addBytes([]byte(v)...) + e.addBytes(0) +} + +func (e *encoder) reserveInt32() (pos int) { + pos = len(e.out) + e.addBytes(0, 0, 0, 0) + return pos +} + +func (e *encoder) setInt32(pos int, v int32) { + e.out[pos+0] = byte(v) + e.out[pos+1] = byte(v >> 8) + e.out[pos+2] = byte(v >> 16) + e.out[pos+3] = byte(v >> 24) +} + +func (e *encoder) addInt32(v int32) { + u := uint32(v) + e.addBytes(byte(u), byte(u>>8), byte(u>>16), byte(u>>24)) +} + +func (e *encoder) addInt64(v int64) { + u := uint64(v) + e.addBytes(byte(u), byte(u>>8), byte(u>>16), byte(u>>24), + byte(u>>32), byte(u>>40), byte(u>>48), byte(u>>56)) +} + +func (e *encoder) addFloat64(v float64) { + e.addInt64(int64(math.Float64bits(v))) +} + +func (e *encoder) addBytes(v ...byte) { + e.out = append(e.out, v...) +} diff --git a/go/vendor/github.com/globalsign/mgo/bson/json.go b/go/vendor/github.com/globalsign/mgo/bson/json.go new file mode 100644 index 0000000..045c713 --- /dev/null +++ b/go/vendor/github.com/globalsign/mgo/bson/json.go @@ -0,0 +1,384 @@ +package bson + +import ( + "bytes" + "encoding/base64" + "fmt" + "strconv" + "strings" + "time" + + "github.com/globalsign/mgo/internal/json" +) + +// UnmarshalJSON unmarshals a JSON value that may hold non-standard +// syntax as defined in BSON's extended JSON specification. +func UnmarshalJSON(data []byte, value interface{}) error { + d := json.NewDecoder(bytes.NewBuffer(data)) + d.Extend(&jsonExt) + return d.Decode(value) +} + +// MarshalJSON marshals a JSON value that may hold non-standard +// syntax as defined in BSON's extended JSON specification. +func MarshalJSON(value interface{}) ([]byte, error) { + var buf bytes.Buffer + e := json.NewEncoder(&buf) + e.Extend(&jsonExt) + err := e.Encode(value) + if err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +// jdec is used internally by the JSON decoding functions +// so they may unmarshal functions without getting into endless +// recursion due to keyed objects. +func jdec(data []byte, value interface{}) error { + d := json.NewDecoder(bytes.NewBuffer(data)) + d.Extend(&funcExt) + return d.Decode(value) +} + +var jsonExt json.Extension +var funcExt json.Extension + +// TODO +// - Shell regular expressions ("/regexp/opts") + +func init() { + jsonExt.DecodeUnquotedKeys(true) + jsonExt.DecodeTrailingCommas(true) + + funcExt.DecodeFunc("BinData", "$binaryFunc", "$type", "$binary") + jsonExt.DecodeKeyed("$binary", jdecBinary) + jsonExt.DecodeKeyed("$binaryFunc", jdecBinary) + jsonExt.EncodeType([]byte(nil), jencBinarySlice) + jsonExt.EncodeType(Binary{}, jencBinaryType) + + funcExt.DecodeFunc("ISODate", "$dateFunc", "S") + funcExt.DecodeFunc("new Date", "$dateFunc", "S") + jsonExt.DecodeKeyed("$date", jdecDate) + jsonExt.DecodeKeyed("$dateFunc", jdecDate) + jsonExt.EncodeType(time.Time{}, jencDate) + + funcExt.DecodeFunc("Timestamp", "$timestamp", "t", "i") + jsonExt.DecodeKeyed("$timestamp", jdecTimestamp) + jsonExt.EncodeType(MongoTimestamp(0), jencTimestamp) + + funcExt.DecodeConst("undefined", Undefined) + + jsonExt.DecodeKeyed("$regex", jdecRegEx) + jsonExt.EncodeType(RegEx{}, jencRegEx) + + funcExt.DecodeFunc("ObjectId", "$oidFunc", "Id") + jsonExt.DecodeKeyed("$oid", jdecObjectId) + jsonExt.DecodeKeyed("$oidFunc", jdecObjectId) + jsonExt.EncodeType(ObjectId(""), jencObjectId) + + funcExt.DecodeFunc("DBRef", "$dbrefFunc", "$ref", "$id") + jsonExt.DecodeKeyed("$dbrefFunc", jdecDBRef) + + funcExt.DecodeFunc("NumberLong", "$numberLongFunc", "N") + jsonExt.DecodeKeyed("$numberLong", jdecNumberLong) + jsonExt.DecodeKeyed("$numberLongFunc", jdecNumberLong) + jsonExt.EncodeType(int64(0), jencNumberLong) + jsonExt.EncodeType(int(0), jencInt) + + funcExt.DecodeConst("MinKey", MinKey) + funcExt.DecodeConst("MaxKey", MaxKey) + jsonExt.DecodeKeyed("$minKey", jdecMinKey) + jsonExt.DecodeKeyed("$maxKey", jdecMaxKey) + jsonExt.EncodeType(orderKey(0), jencMinMaxKey) + + jsonExt.DecodeKeyed("$undefined", jdecUndefined) + jsonExt.EncodeType(Undefined, jencUndefined) + + jsonExt.Extend(&funcExt) +} + +func fbytes(format string, args ...interface{}) []byte { + var buf bytes.Buffer + fmt.Fprintf(&buf, format, args...) + return buf.Bytes() +} + +func jdecBinary(data []byte) (interface{}, error) { + var v struct { + Binary []byte `json:"$binary"` + Type string `json:"$type"` + Func struct { + Binary []byte `json:"$binary"` + Type int64 `json:"$type"` + } `json:"$binaryFunc"` + } + err := jdec(data, &v) + if err != nil { + return nil, err + } + + var binData []byte + var binKind int64 + if v.Type == "" && v.Binary == nil { + binData = v.Func.Binary + binKind = v.Func.Type + } else if v.Type == "" { + return v.Binary, nil + } else { + binData = v.Binary + binKind, err = strconv.ParseInt(v.Type, 0, 64) + if err != nil { + binKind = -1 + } + } + + if binKind == 0 { + return binData, nil + } + if binKind < 0 || binKind > 255 { + return nil, fmt.Errorf("invalid type in binary object: %s", data) + } + + return Binary{Kind: byte(binKind), Data: binData}, nil +} + +func jencBinarySlice(v interface{}) ([]byte, error) { + in := v.([]byte) + out := make([]byte, base64.StdEncoding.EncodedLen(len(in))) + base64.StdEncoding.Encode(out, in) + return fbytes(`{"$binary":"%s","$type":"0x0"}`, out), nil +} + +func jencBinaryType(v interface{}) ([]byte, error) { + in := v.(Binary) + out := make([]byte, base64.StdEncoding.EncodedLen(len(in.Data))) + base64.StdEncoding.Encode(out, in.Data) + return fbytes(`{"$binary":"%s","$type":"0x%x"}`, out, in.Kind), nil +} + +const jdateFormat = "2006-01-02T15:04:05.999Z07:00" + +func jdecDate(data []byte) (interface{}, error) { + var v struct { + S string `json:"$date"` + Func struct { + S string + } `json:"$dateFunc"` + } + _ = jdec(data, &v) + if v.S == "" { + v.S = v.Func.S + } + if v.S != "" { + var errs []string + for _, format := range []string{jdateFormat, "2006-01-02"} { + t, err := time.Parse(format, v.S) + if err == nil { + return t, nil + } + errs = append(errs, err.Error()) + } + return nil, fmt.Errorf("cannot parse date: %q [%s]", v.S, strings.Join(errs, ", ")) + } + + var vn struct { + Date struct { + N int64 `json:"$numberLong,string"` + } `json:"$date"` + Func struct { + S int64 + } `json:"$dateFunc"` + } + err := jdec(data, &vn) + if err != nil { + return nil, fmt.Errorf("cannot parse date: %q", data) + } + n := vn.Date.N + if n == 0 { + n = vn.Func.S + } + return time.Unix(n/1000, n%1000*1e6).UTC(), nil +} + +func jencDate(v interface{}) ([]byte, error) { + t := v.(time.Time) + return fbytes(`{"$date":%q}`, t.Format(jdateFormat)), nil +} + +func jdecTimestamp(data []byte) (interface{}, error) { + var v struct { + Func struct { + T int32 `json:"t"` + I int32 `json:"i"` + } `json:"$timestamp"` + } + err := jdec(data, &v) + if err != nil { + return nil, err + } + return MongoTimestamp(uint64(v.Func.T)<<32 | uint64(uint32(v.Func.I))), nil +} + +func jencTimestamp(v interface{}) ([]byte, error) { + ts := uint64(v.(MongoTimestamp)) + return fbytes(`{"$timestamp":{"t":%d,"i":%d}}`, ts>>32, uint32(ts)), nil +} + +func jdecRegEx(data []byte) (interface{}, error) { + var v struct { + Regex string `json:"$regex"` + Options string `json:"$options"` + } + err := jdec(data, &v) + if err != nil { + return nil, err + } + return RegEx{v.Regex, v.Options}, nil +} + +func jencRegEx(v interface{}) ([]byte, error) { + re := v.(RegEx) + type regex struct { + Regex string `json:"$regex"` + Options string `json:"$options"` + } + return json.Marshal(regex{re.Pattern, re.Options}) +} + +func jdecObjectId(data []byte) (interface{}, error) { + var v struct { + Id string `json:"$oid"` + Func struct { + Id string + } `json:"$oidFunc"` + } + err := jdec(data, &v) + if err != nil { + return nil, err + } + if v.Id == "" { + v.Id = v.Func.Id + } + return ObjectIdHex(v.Id), nil +} + +func jencObjectId(v interface{}) ([]byte, error) { + return fbytes(`{"$oid":"%s"}`, v.(ObjectId).Hex()), nil +} + +func jdecDBRef(data []byte) (interface{}, error) { + // TODO Support unmarshaling $ref and $id into the input value. + var v struct { + Obj map[string]interface{} `json:"$dbrefFunc"` + } + // TODO Fix this. Must not be required. + v.Obj = make(map[string]interface{}) + err := jdec(data, &v) + if err != nil { + return nil, err + } + return v.Obj, nil +} + +func jdecNumberLong(data []byte) (interface{}, error) { + var v struct { + N int64 `json:"$numberLong,string"` + Func struct { + N int64 `json:",string"` + } `json:"$numberLongFunc"` + } + var vn struct { + N int64 `json:"$numberLong"` + Func struct { + N int64 + } `json:"$numberLongFunc"` + } + err := jdec(data, &v) + if err != nil { + err = jdec(data, &vn) + v.N = vn.N + v.Func.N = vn.Func.N + } + if err != nil { + return nil, err + } + if v.N != 0 { + return v.N, nil + } + return v.Func.N, nil +} + +func jencNumberLong(v interface{}) ([]byte, error) { + n := v.(int64) + f := `{"$numberLong":"%d"}` + if n <= 1<<53 { + f = `{"$numberLong":%d}` + } + return fbytes(f, n), nil +} + +func jencInt(v interface{}) ([]byte, error) { + n := v.(int) + f := `{"$numberLong":"%d"}` + if int64(n) <= 1<<53 { + f = `%d` + } + return fbytes(f, n), nil +} + +func jdecMinKey(data []byte) (interface{}, error) { + var v struct { + N int64 `json:"$minKey"` + } + err := jdec(data, &v) + if err != nil { + return nil, err + } + if v.N != 1 { + return nil, fmt.Errorf("invalid $minKey object: %s", data) + } + return MinKey, nil +} + +func jdecMaxKey(data []byte) (interface{}, error) { + var v struct { + N int64 `json:"$maxKey"` + } + err := jdec(data, &v) + if err != nil { + return nil, err + } + if v.N != 1 { + return nil, fmt.Errorf("invalid $maxKey object: %s", data) + } + return MaxKey, nil +} + +func jencMinMaxKey(v interface{}) ([]byte, error) { + switch v.(orderKey) { + case MinKey: + return []byte(`{"$minKey":1}`), nil + case MaxKey: + return []byte(`{"$maxKey":1}`), nil + } + panic(fmt.Sprintf("invalid $minKey/$maxKey value: %d", v)) +} + +func jdecUndefined(data []byte) (interface{}, error) { + var v struct { + B bool `json:"$undefined"` + } + err := jdec(data, &v) + if err != nil { + return nil, err + } + if !v.B { + return nil, fmt.Errorf("invalid $undefined object: %s", data) + } + return Undefined, nil +} + +func jencUndefined(v interface{}) ([]byte, error) { + return []byte(`{"$undefined":true}`), nil +} diff --git a/go/vendor/github.com/globalsign/mgo/bson/stream.go b/go/vendor/github.com/globalsign/mgo/bson/stream.go new file mode 100644 index 0000000..4665284 --- /dev/null +++ b/go/vendor/github.com/globalsign/mgo/bson/stream.go @@ -0,0 +1,90 @@ +package bson + +import ( + "bytes" + "encoding/binary" + "fmt" + "io" +) + +const ( + // MinDocumentSize is the size of the smallest possible valid BSON document: + // an int32 size header + 0x00 (end of document). + MinDocumentSize = 5 + + // MaxDocumentSize is the largest possible size for a BSON document allowed by MongoDB, + // that is, 16 MiB (see https://docs.mongodb.com/manual/reference/limits/). + MaxDocumentSize = 16777216 +) + +// ErrInvalidDocumentSize is an error returned when a BSON document's header +// contains a size smaller than MinDocumentSize or greater than MaxDocumentSize. +type ErrInvalidDocumentSize struct { + DocumentSize int32 +} + +func (e ErrInvalidDocumentSize) Error() string { + return fmt.Sprintf("invalid document size %d", e.DocumentSize) +} + +// A Decoder reads and decodes BSON values from an input stream. +type Decoder struct { + source io.Reader +} + +// NewDecoder returns a new Decoder that reads from source. +// It does not add any extra buffering, and may not read data from source beyond the BSON values requested. +func NewDecoder(source io.Reader) *Decoder { + return &Decoder{source: source} +} + +// Decode reads the next BSON-encoded value from its input and stores it in the value pointed to by v. +// See the documentation for Unmarshal for details about the conversion of BSON into a Go value. +func (dec *Decoder) Decode(v interface{}) (err error) { + // BSON documents start with their size as a *signed* int32. + var docSize int32 + if err = binary.Read(dec.source, binary.LittleEndian, &docSize); err != nil { + return + } + + if docSize < MinDocumentSize || docSize > MaxDocumentSize { + return ErrInvalidDocumentSize{DocumentSize: docSize} + } + + docBuffer := bytes.NewBuffer(make([]byte, 0, docSize)) + if err = binary.Write(docBuffer, binary.LittleEndian, docSize); err != nil { + return + } + + // docSize is the *full* document's size (including the 4-byte size header, + // which has already been read). + if _, err = io.CopyN(docBuffer, dec.source, int64(docSize-4)); err != nil { + return + } + + // Let Unmarshal handle the rest. + defer handleErr(&err) + return Unmarshal(docBuffer.Bytes(), v) +} + +// An Encoder encodes and writes BSON values to an output stream. +type Encoder struct { + target io.Writer +} + +// NewEncoder returns a new Encoder that writes to target. +func NewEncoder(target io.Writer) *Encoder { + return &Encoder{target: target} +} + +// Encode encodes v to BSON, and if successful writes it to the Encoder's output stream. +// See the documentation for Marshal for details about the conversion of Go values to BSON. +func (enc *Encoder) Encode(v interface{}) error { + data, err := Marshal(v) + if err != nil { + return err + } + + _, err = enc.target.Write(data) + return err +} diff --git a/go/vendor/github.com/globalsign/mgo/internal/json/LICENSE b/go/vendor/github.com/globalsign/mgo/internal/json/LICENSE new file mode 100644 index 0000000..7448756 --- /dev/null +++ b/go/vendor/github.com/globalsign/mgo/internal/json/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2012 The Go 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. + * 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 +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/go/vendor/github.com/globalsign/mgo/internal/json/decode.go b/go/vendor/github.com/globalsign/mgo/internal/json/decode.go new file mode 100644 index 0000000..d5ca1f9 --- /dev/null +++ b/go/vendor/github.com/globalsign/mgo/internal/json/decode.go @@ -0,0 +1,1685 @@ +// Copyright 2010 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. + +// Represents JSON data structure using native Go types: booleans, floats, +// strings, arrays, and maps. + +package json + +import ( + "bytes" + "encoding" + "encoding/base64" + "errors" + "fmt" + "reflect" + "runtime" + "strconv" + "unicode" + "unicode/utf16" + "unicode/utf8" +) + +// Unmarshal parses the JSON-encoded data and stores the result +// in the value pointed to by v. +// +// Unmarshal uses the inverse of the encodings that +// Marshal uses, allocating maps, slices, and pointers as necessary, +// with the following additional rules: +// +// To unmarshal JSON into a pointer, Unmarshal first handles the case of +// the JSON being the JSON literal null. In that case, Unmarshal sets +// the pointer to nil. Otherwise, Unmarshal unmarshals the JSON into +// the value pointed at by the pointer. If the pointer is nil, Unmarshal +// allocates a new value for it to point to. +// +// To unmarshal JSON into a struct, Unmarshal matches incoming object +// keys to the keys used by Marshal (either the struct field name or its tag), +// preferring an exact match but also accepting a case-insensitive match. +// Unmarshal will only set exported fields of the struct. +// +// To unmarshal JSON into an interface value, +// Unmarshal stores one of these in the interface value: +// +// bool, for JSON booleans +// float64, for JSON numbers +// string, for JSON strings +// []interface{}, for JSON arrays +// map[string]interface{}, for JSON objects +// nil for JSON null +// +// To unmarshal a JSON array into a slice, Unmarshal resets the slice length +// to zero and then appends each element to the slice. +// As a special case, to unmarshal an empty JSON array into a slice, +// Unmarshal replaces the slice with a new empty slice. +// +// To unmarshal a JSON array into a Go array, Unmarshal decodes +// JSON array elements into corresponding Go array elements. +// If the Go array is smaller than the JSON array, +// the additional JSON array elements are discarded. +// If the JSON array is smaller than the Go array, +// the additional Go array elements are set to zero values. +// +// To unmarshal a JSON object into a map, Unmarshal first establishes a map to +// use, If the map is nil, Unmarshal allocates a new map. Otherwise Unmarshal +// reuses the existing map, keeping existing entries. Unmarshal then stores key- +// value pairs from the JSON object into the map. The map's key type must +// either be a string or implement encoding.TextUnmarshaler. +// +// If a JSON value is not appropriate for a given target type, +// or if a JSON number overflows the target type, Unmarshal +// skips that field and completes the unmarshaling as best it can. +// If no more serious errors are encountered, Unmarshal returns +// an UnmarshalTypeError describing the earliest such error. +// +// The JSON null value unmarshals into an interface, map, pointer, or slice +// by setting that Go value to nil. Because null is often used in JSON to mean +// ``not present,'' unmarshaling a JSON null into any other Go type has no effect +// on the value and produces no error. +// +// When unmarshaling quoted strings, invalid UTF-8 or +// invalid UTF-16 surrogate pairs are not treated as an error. +// Instead, they are replaced by the Unicode replacement +// character U+FFFD. +// +func Unmarshal(data []byte, v interface{}) error { + // Check for well-formedness. + // Avoids filling out half a data structure + // before discovering a JSON syntax error. + var d decodeState + err := checkValid(data, &d.scan) + if err != nil { + return err + } + + d.init(data) + return d.unmarshal(v) +} + +// Unmarshaler is the interface implemented by types +// that can unmarshal a JSON description of themselves. +// The input can be assumed to be a valid encoding of +// a JSON value. UnmarshalJSON must copy the JSON data +// if it wishes to retain the data after returning. +type Unmarshaler interface { + UnmarshalJSON([]byte) error +} + +// An UnmarshalTypeError describes a JSON value that was +// not appropriate for a value of a specific Go type. +type UnmarshalTypeError struct { + Value string // description of JSON value - "bool", "array", "number -5" + Type reflect.Type // type of Go value it could not be assigned to + Offset int64 // error occurred after reading Offset bytes +} + +func (e *UnmarshalTypeError) Error() string { + return "json: cannot unmarshal " + e.Value + " into Go value of type " + e.Type.String() +} + +// An UnmarshalFieldError describes a JSON object key that +// led to an unexported (and therefore unwritable) struct field. +// (No longer used; kept for compatibility.) +type UnmarshalFieldError struct { + Key string + Type reflect.Type + Field reflect.StructField +} + +func (e *UnmarshalFieldError) Error() string { + return "json: cannot unmarshal object key " + strconv.Quote(e.Key) + " into unexported field " + e.Field.Name + " of type " + e.Type.String() +} + +// An InvalidUnmarshalError describes an invalid argument passed to Unmarshal. +// (The argument to Unmarshal must be a non-nil pointer.) +type InvalidUnmarshalError struct { + Type reflect.Type +} + +func (e *InvalidUnmarshalError) Error() string { + if e.Type == nil { + return "json: Unmarshal(nil)" + } + + if e.Type.Kind() != reflect.Ptr { + return "json: Unmarshal(non-pointer " + e.Type.String() + ")" + } + return "json: Unmarshal(nil " + e.Type.String() + ")" +} + +func (d *decodeState) unmarshal(v interface{}) (err error) { + defer func() { + if r := recover(); r != nil { + if _, ok := r.(runtime.Error); ok { + panic(r) + } + err = r.(error) + } + }() + + rv := reflect.ValueOf(v) + if rv.Kind() != reflect.Ptr || rv.IsNil() { + return &InvalidUnmarshalError{reflect.TypeOf(v)} + } + + d.scan.reset() + // We decode rv not rv.Elem because the Unmarshaler interface + // test must be applied at the top level of the value. + d.value(rv) + return d.savedError +} + +// A Number represents a JSON number literal. +type Number string + +// String returns the literal text of the number. +func (n Number) String() string { return string(n) } + +// Float64 returns the number as a float64. +func (n Number) Float64() (float64, error) { + return strconv.ParseFloat(string(n), 64) +} + +// Int64 returns the number as an int64. +func (n Number) Int64() (int64, error) { + return strconv.ParseInt(string(n), 10, 64) +} + +// isValidNumber reports whether s is a valid JSON number literal. +func isValidNumber(s string) bool { + // This function implements the JSON numbers grammar. + // See https://tools.ietf.org/html/rfc7159#section-6 + // and http://json.org/number.gif + + if s == "" { + return false + } + + // Optional - + if s[0] == '-' { + s = s[1:] + if s == "" { + return false + } + } + + // Digits + switch { + default: + return false + + case s[0] == '0': + s = s[1:] + + case '1' <= s[0] && s[0] <= '9': + s = s[1:] + for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { + s = s[1:] + } + } + + // . followed by 1 or more digits. + if len(s) >= 2 && s[0] == '.' && '0' <= s[1] && s[1] <= '9' { + s = s[2:] + for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { + s = s[1:] + } + } + + // 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:] + if s[0] == '+' || s[0] == '-' { + s = s[1:] + if s == "" { + return false + } + } + for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { + s = s[1:] + } + } + + // Make sure we are at the end. + return s == "" +} + +// decodeState represents the state while decoding a JSON value. +type decodeState struct { + data []byte + off int // read offset in data + scan scanner + nextscan scanner // for calls to nextValue + savedError error + useNumber bool + ext Extension +} + +// errPhase is used for errors that should not happen unless +// there is a bug in the JSON decoder or something is editing +// the data slice while the decoder executes. +var errPhase = errors.New("JSON decoder out of sync - data changing underfoot?") + +func (d *decodeState) init(data []byte) *decodeState { + d.data = data + d.off = 0 + d.savedError = nil + return d +} + +// error aborts the decoding by panicking with err. +func (d *decodeState) error(err error) { + panic(err) +} + +// saveError saves the first err it is called with, +// for reporting at the end of the unmarshal. +func (d *decodeState) saveError(err error) { + if d.savedError == nil { + d.savedError = err + } +} + +// next cuts off and returns the next full JSON value in d.data[d.off:]. +// The next value is known to be an object or array, not a literal. +func (d *decodeState) next() []byte { + c := d.data[d.off] + item, rest, err := nextValue(d.data[d.off:], &d.nextscan) + if err != nil { + d.error(err) + } + d.off = len(d.data) - len(rest) + + // Our scanner has seen the opening brace/bracket + // and thinks we're still in the middle of the object. + // invent a closing brace/bracket to get it out. + if c == '{' { + d.scan.step(&d.scan, '}') + } else if c == '[' { + d.scan.step(&d.scan, ']') + } else { + // Was inside a function name. Get out of it. + d.scan.step(&d.scan, '(') + d.scan.step(&d.scan, ')') + } + + return item +} + +// scanWhile processes bytes in d.data[d.off:] until it +// receives a scan code not equal to op. +// It updates d.off and returns the new scan code. +func (d *decodeState) scanWhile(op int) int { + var newOp int + for { + if d.off >= len(d.data) { + newOp = d.scan.eof() + d.off = len(d.data) + 1 // mark processed EOF with len+1 + } else { + c := d.data[d.off] + d.off++ + newOp = d.scan.step(&d.scan, c) + } + if newOp != op { + break + } + } + return newOp +} + +// value decodes a JSON value from d.data[d.off:] into the value. +// it updates d.off to point past the decoded value. +func (d *decodeState) value(v reflect.Value) { + if !v.IsValid() { + _, rest, err := nextValue(d.data[d.off:], &d.nextscan) + if err != nil { + d.error(err) + } + d.off = len(d.data) - len(rest) + + // d.scan thinks we're still at the beginning of the item. + // Feed in an empty string - the shortest, simplest value - + // so that it knows we got to the end of the value. + if d.scan.redo { + // rewind. + d.scan.redo = false + d.scan.step = stateBeginValue + } + d.scan.step(&d.scan, '"') + d.scan.step(&d.scan, '"') + + n := len(d.scan.parseState) + if n > 0 && d.scan.parseState[n-1] == parseObjectKey { + // d.scan thinks we just read an object key; finish the object + d.scan.step(&d.scan, ':') + d.scan.step(&d.scan, '"') + d.scan.step(&d.scan, '"') + d.scan.step(&d.scan, '}') + } + + return + } + + switch op := d.scanWhile(scanSkipSpace); op { + default: + d.error(errPhase) + + case scanBeginArray: + d.array(v) + + case scanBeginObject: + d.object(v) + + case scanBeginLiteral: + d.literal(v) + + case scanBeginName: + d.name(v) + } +} + +type unquotedValue struct{} + +// valueQuoted is like value but decodes a +// quoted string literal or literal null into an interface value. +// If it finds anything other than a quoted string literal or null, +// valueQuoted returns unquotedValue{}. +func (d *decodeState) valueQuoted() interface{} { + switch op := d.scanWhile(scanSkipSpace); op { + default: + d.error(errPhase) + + case scanBeginArray: + d.array(reflect.Value{}) + + case scanBeginObject: + d.object(reflect.Value{}) + + case scanBeginName: + switch v := d.nameInterface().(type) { + case nil, string: + return v + } + + case scanBeginLiteral: + switch v := d.literalInterface().(type) { + case nil, string: + return v + } + } + return unquotedValue{} +} + +// indirect walks down v allocating pointers as needed, +// until it gets to a non-pointer. +// if it encounters an Unmarshaler, indirect stops and returns that. +// if decodingNull is true, indirect stops at the last pointer so it can be set to nil. +func (d *decodeState) indirect(v reflect.Value, decodingNull bool) (Unmarshaler, encoding.TextUnmarshaler, reflect.Value) { + // If v is a named type and is addressable, + // start with its address, so that if the type has pointer methods, + // we find them. + if v.Kind() != reflect.Ptr && v.Type().Name() != "" && v.CanAddr() { + v = v.Addr() + } + for { + // Load value from interface, but only if the result will be + // usefully addressable. + if v.Kind() == reflect.Interface && !v.IsNil() { + e := v.Elem() + if e.Kind() == reflect.Ptr && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Ptr) { + v = e + continue + } + } + + if v.Kind() != reflect.Ptr { + break + } + + if v.Elem().Kind() != reflect.Ptr && decodingNull && v.CanSet() { + break + } + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + if v.Type().NumMethod() > 0 { + if u, ok := v.Interface().(Unmarshaler); ok { + return u, nil, v + } + if u, ok := v.Interface().(encoding.TextUnmarshaler); ok { + return nil, u, v + } + } + v = v.Elem() + } + return nil, nil, v +} + +// array consumes an array from d.data[d.off-1:], decoding into the value v. +// the first byte of the array ('[') has been read already. +func (d *decodeState) array(v reflect.Value) { + // Check for unmarshaler. + u, ut, pv := d.indirect(v, false) + if u != nil { + d.off-- + err := u.UnmarshalJSON(d.next()) + if err != nil { + d.error(err) + } + return + } + if ut != nil { + d.saveError(&UnmarshalTypeError{"array", v.Type(), int64(d.off)}) + d.off-- + d.next() + return + } + + v = pv + + // Check type of target. + switch v.Kind() { + case reflect.Interface: + if v.NumMethod() == 0 { + // Decoding into nil interface? Switch to non-reflect code. + v.Set(reflect.ValueOf(d.arrayInterface())) + return + } + // Otherwise it's invalid. + fallthrough + default: + d.saveError(&UnmarshalTypeError{"array", v.Type(), int64(d.off)}) + d.off-- + d.next() + return + case reflect.Array: + case reflect.Slice: + break + } + + i := 0 + for { + // Look ahead for ] - can only happen on first iteration. + op := d.scanWhile(scanSkipSpace) + if op == scanEndArray { + break + } + + // Back up so d.value can have the byte we just read. + d.off-- + d.scan.undo(op) + + // Get element of array, growing if necessary. + if v.Kind() == reflect.Slice { + // Grow slice if necessary + if i >= v.Cap() { + newcap := v.Cap() + v.Cap()/2 + if newcap < 4 { + newcap = 4 + } + newv := reflect.MakeSlice(v.Type(), v.Len(), newcap) + reflect.Copy(newv, v) + v.Set(newv) + } + if i >= v.Len() { + v.SetLen(i + 1) + } + } + + if i < v.Len() { + // Decode into element. + d.value(v.Index(i)) + } else { + // Ran out of fixed array: skip. + d.value(reflect.Value{}) + } + i++ + + // Next token must be , or ]. + op = d.scanWhile(scanSkipSpace) + if op == scanEndArray { + break + } + if op != scanArrayValue { + d.error(errPhase) + } + } + + if i < v.Len() { + if v.Kind() == reflect.Array { + // Array. Zero the rest. + z := reflect.Zero(v.Type().Elem()) + for ; i < v.Len(); i++ { + v.Index(i).Set(z) + } + } else { + v.SetLen(i) + } + } + if i == 0 && v.Kind() == reflect.Slice { + v.Set(reflect.MakeSlice(v.Type(), 0, 0)) + } +} + +var nullLiteral = []byte("null") +var textUnmarshalerType = reflect.TypeOf(new(encoding.TextUnmarshaler)).Elem() + +// object consumes an object from d.data[d.off-1:], decoding into the value v. +// the first byte ('{') of the object has been read already. +func (d *decodeState) object(v reflect.Value) { + // Check for unmarshaler. + u, ut, pv := d.indirect(v, false) + if d.storeKeyed(pv) { + return + } + if u != nil { + d.off-- + err := u.UnmarshalJSON(d.next()) + if err != nil { + d.error(err) + } + return + } + if ut != nil { + d.saveError(&UnmarshalTypeError{"object", v.Type(), int64(d.off)}) + d.off-- + d.next() // skip over { } in input + return + } + v = pv + + // Decoding into nil interface? Switch to non-reflect code. + if v.Kind() == reflect.Interface && v.NumMethod() == 0 { + v.Set(reflect.ValueOf(d.objectInterface())) + return + } + + // Check type of target: + // struct or + // map[string]T or map[encoding.TextUnmarshaler]T + switch v.Kind() { + case reflect.Map: + // Map key must either have string kind or be an encoding.TextUnmarshaler. + t := v.Type() + if t.Key().Kind() != reflect.String && + !reflect.PtrTo(t.Key()).Implements(textUnmarshalerType) { + d.saveError(&UnmarshalTypeError{"object", v.Type(), int64(d.off)}) + d.off-- + d.next() // skip over { } in input + return + } + if v.IsNil() { + v.Set(reflect.MakeMap(t)) + } + case reflect.Struct: + + default: + d.saveError(&UnmarshalTypeError{"object", v.Type(), int64(d.off)}) + d.off-- + d.next() // skip over { } in input + return + } + + var mapElem reflect.Value + + empty := true + for { + // Read opening " of string key or closing }. + op := d.scanWhile(scanSkipSpace) + if op == scanEndObject { + if !empty && !d.ext.trailingCommas { + d.syntaxError("beginning of object key string") + } + break + } + empty = false + if op == scanBeginName { + if !d.ext.unquotedKeys { + d.syntaxError("beginning of object key string") + } + } else if op != scanBeginLiteral { + d.error(errPhase) + } + unquotedKey := op == scanBeginName + + // Read key. + start := d.off - 1 + op = d.scanWhile(scanContinue) + item := d.data[start : d.off-1] + var key []byte + if unquotedKey { + key = item + // TODO Fix code below to quote item when necessary. + } else { + var ok bool + key, ok = unquoteBytes(item) + if !ok { + d.error(errPhase) + } + } + + // Figure out field corresponding to key. + var subv reflect.Value + destring := false // whether the value is wrapped in a string to be decoded first + + if v.Kind() == reflect.Map { + elemType := v.Type().Elem() + if !mapElem.IsValid() { + mapElem = reflect.New(elemType).Elem() + } else { + mapElem.Set(reflect.Zero(elemType)) + } + subv = mapElem + } else { + var f *field + fields := cachedTypeFields(v.Type()) + for i := range fields { + ff := &fields[i] + if bytes.Equal(ff.nameBytes, key) { + f = ff + break + } + if f == nil && ff.equalFold(ff.nameBytes, key) { + f = ff + } + } + if f != nil { + subv = v + destring = f.quoted + for _, i := range f.index { + if subv.Kind() == reflect.Ptr { + if subv.IsNil() { + subv.Set(reflect.New(subv.Type().Elem())) + } + subv = subv.Elem() + } + subv = subv.Field(i) + } + } + } + + // Read : before value. + if op == scanSkipSpace { + op = d.scanWhile(scanSkipSpace) + } + if op != scanObjectKey { + d.error(errPhase) + } + + // Read value. + if destring { + switch qv := d.valueQuoted().(type) { + case nil: + d.literalStore(nullLiteral, subv, false) + case string: + d.literalStore([]byte(qv), subv, true) + default: + d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal unquoted value into %v", subv.Type())) + } + } else { + d.value(subv) + } + + // Write value back to map; + // if using struct, subv points into struct already. + if v.Kind() == reflect.Map { + kt := v.Type().Key() + var kv reflect.Value + switch { + case kt.Kind() == reflect.String: + kv = reflect.ValueOf(key).Convert(v.Type().Key()) + case reflect.PtrTo(kt).Implements(textUnmarshalerType): + kv = reflect.New(v.Type().Key()) + d.literalStore(item, kv, true) + kv = kv.Elem() + default: + panic("json: Unexpected key type") // should never occur + } + v.SetMapIndex(kv, subv) + } + + // Next token must be , or }. + op = d.scanWhile(scanSkipSpace) + if op == scanEndObject { + break + } + if op != scanObjectValue { + d.error(errPhase) + } + } +} + +// isNull returns whether there's a null literal at the provided offset. +func (d *decodeState) isNull(off int) bool { + if off+4 >= len(d.data) || d.data[off] != 'n' || d.data[off+1] != 'u' || d.data[off+2] != 'l' || d.data[off+3] != 'l' { + return false + } + d.nextscan.reset() + for i, c := range d.data[off:] { + if i > 4 { + return false + } + switch d.nextscan.step(&d.nextscan, c) { + case scanContinue, scanBeginName: + continue + } + break + } + return true +} + +// name consumes a const or function from d.data[d.off-1:], decoding into the value v. +// the first byte of the function name has been read already. +func (d *decodeState) name(v reflect.Value) { + if d.isNull(d.off - 1) { + d.literal(v) + return + } + + // Check for unmarshaler. + u, ut, pv := d.indirect(v, false) + if d.storeKeyed(pv) { + return + } + if u != nil { + d.off-- + err := u.UnmarshalJSON(d.next()) + if err != nil { + d.error(err) + } + return + } + if ut != nil { + d.saveError(&UnmarshalTypeError{"object", v.Type(), int64(d.off)}) + d.off-- + d.next() // skip over function in input + return + } + v = pv + + // Decoding into nil interface? Switch to non-reflect code. + if v.Kind() == reflect.Interface && v.NumMethod() == 0 { + out := d.nameInterface() + if out == nil { + v.Set(reflect.Zero(v.Type())) + } else { + v.Set(reflect.ValueOf(out)) + } + return + } + + nameStart := d.off - 1 + + op := d.scanWhile(scanContinue) + + name := d.data[nameStart : d.off-1] + if op != scanParam { + // Back up so the byte just read is consumed next. + d.off-- + d.scan.undo(op) + if l, ok := d.convertLiteral(name); ok { + d.storeValue(v, l) + return + } + d.error(&SyntaxError{fmt.Sprintf("json: unknown constant %q", name), int64(d.off)}) + } + + funcName := string(name) + funcData := d.ext.funcs[funcName] + if funcData.key == "" { + d.error(fmt.Errorf("json: unknown function %q", funcName)) + } + + // Check type of target: + // struct or + // map[string]T or map[encoding.TextUnmarshaler]T + switch v.Kind() { + case reflect.Map: + // Map key must either have string kind or be an encoding.TextUnmarshaler. + t := v.Type() + if t.Key().Kind() != reflect.String && + !reflect.PtrTo(t.Key()).Implements(textUnmarshalerType) { + d.saveError(&UnmarshalTypeError{"object", v.Type(), int64(d.off)}) + d.off-- + d.next() // skip over { } in input + return + } + if v.IsNil() { + v.Set(reflect.MakeMap(t)) + } + case reflect.Struct: + + default: + d.saveError(&UnmarshalTypeError{"object", v.Type(), int64(d.off)}) + d.off-- + d.next() // skip over { } in input + return + } + + // TODO Fix case of func field as map. + //topv := v + + // Figure out field corresponding to function. + key := []byte(funcData.key) + if v.Kind() == reflect.Map { + elemType := v.Type().Elem() + v = reflect.New(elemType).Elem() + } else { + var f *field + fields := cachedTypeFields(v.Type()) + for i := range fields { + ff := &fields[i] + if bytes.Equal(ff.nameBytes, key) { + f = ff + break + } + if f == nil && ff.equalFold(ff.nameBytes, key) { + f = ff + } + } + if f != nil { + for _, i := range f.index { + if v.Kind() == reflect.Ptr { + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + v = v.Elem() + } + v = v.Field(i) + } + if v.Kind() == reflect.Ptr { + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + v = v.Elem() + } + } + } + + // Check for unmarshaler on func field itself. + u, _, _ = d.indirect(v, false) + if u != nil { + d.off = nameStart + err := u.UnmarshalJSON(d.next()) + if err != nil { + d.error(err) + } + return + } + + var mapElem reflect.Value + + // Parse function arguments. + for i := 0; ; i++ { + // closing ) - can only happen on first iteration. + op := d.scanWhile(scanSkipSpace) + if op == scanEndParams { + break + } + + // Back up so d.value can have the byte we just read. + d.off-- + d.scan.undo(op) + + if i >= len(funcData.args) { + d.error(fmt.Errorf("json: too many arguments for function %s", funcName)) + } + key := []byte(funcData.args[i]) + + // Figure out field corresponding to key. + var subv reflect.Value + destring := false // whether the value is wrapped in a string to be decoded first + + if v.Kind() == reflect.Map { + elemType := v.Type().Elem() + if !mapElem.IsValid() { + mapElem = reflect.New(elemType).Elem() + } else { + mapElem.Set(reflect.Zero(elemType)) + } + subv = mapElem + } else { + var f *field + fields := cachedTypeFields(v.Type()) + for i := range fields { + ff := &fields[i] + if bytes.Equal(ff.nameBytes, key) { + f = ff + break + } + if f == nil && ff.equalFold(ff.nameBytes, key) { + f = ff + } + } + if f != nil { + subv = v + destring = f.quoted + for _, i := range f.index { + if subv.Kind() == reflect.Ptr { + if subv.IsNil() { + subv.Set(reflect.New(subv.Type().Elem())) + } + subv = subv.Elem() + } + subv = subv.Field(i) + } + } + } + + // Read value. + if destring { + switch qv := d.valueQuoted().(type) { + case nil: + d.literalStore(nullLiteral, subv, false) + case string: + d.literalStore([]byte(qv), subv, true) + default: + d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal unquoted value into %v", subv.Type())) + } + } else { + d.value(subv) + } + + // Write value back to map; + // if using struct, subv points into struct already. + if v.Kind() == reflect.Map { + kt := v.Type().Key() + var kv reflect.Value + switch { + case kt.Kind() == reflect.String: + kv = reflect.ValueOf(key).Convert(v.Type().Key()) + case reflect.PtrTo(kt).Implements(textUnmarshalerType): + kv = reflect.New(v.Type().Key()) + d.literalStore(key, kv, true) + kv = kv.Elem() + default: + panic("json: Unexpected key type") // should never occur + } + v.SetMapIndex(kv, subv) + } + + // Next token must be , or ). + op = d.scanWhile(scanSkipSpace) + if op == scanEndParams { + break + } + if op != scanParam { + d.error(errPhase) + } + } +} + +// keyed attempts to decode an object or function using a keyed doc extension, +// and returns the value and true on success, or nil and false otherwise. +func (d *decodeState) keyed() (interface{}, bool) { + if len(d.ext.keyed) == 0 { + return nil, false + } + + unquote := false + + // Look-ahead first key to check for a keyed document extension. + d.nextscan.reset() + var start, end int + for i, c := range d.data[d.off-1:] { + switch op := d.nextscan.step(&d.nextscan, c); op { + case scanSkipSpace, scanContinue, scanBeginObject: + continue + case scanBeginLiteral, scanBeginName: + unquote = op == scanBeginLiteral + start = i + continue + } + end = i + break + } + + name := bytes.Trim(d.data[d.off-1+start:d.off-1+end], " \n\t") + + var key []byte + var ok bool + if unquote { + key, ok = unquoteBytes(name) + if !ok { + d.error(errPhase) + } + } else { + funcData, ok := d.ext.funcs[string(name)] + if !ok { + return nil, false + } + key = []byte(funcData.key) + } + + decode, ok := d.ext.keyed[string(key)] + if !ok { + return nil, false + } + + d.off-- + out, err := decode(d.next()) + if err != nil { + d.error(err) + } + return out, true +} + +func (d *decodeState) storeKeyed(v reflect.Value) bool { + keyed, ok := d.keyed() + if !ok { + return false + } + d.storeValue(v, keyed) + return true +} + +var ( + trueBytes = []byte("true") + falseBytes = []byte("false") + nullBytes = []byte("null") +) + +func (d *decodeState) storeValue(v reflect.Value, from interface{}) { + switch from { + case nil: + d.literalStore(nullBytes, v, false) + return + case true: + d.literalStore(trueBytes, v, false) + return + case false: + d.literalStore(falseBytes, v, false) + return + } + fromv := reflect.ValueOf(from) + for fromv.Kind() == reflect.Ptr && !fromv.IsNil() { + fromv = fromv.Elem() + } + fromt := fromv.Type() + for v.Kind() == reflect.Ptr && !v.IsNil() { + v = v.Elem() + } + vt := v.Type() + if fromt.AssignableTo(vt) { + v.Set(fromv) + } else if fromt.ConvertibleTo(vt) { + v.Set(fromv.Convert(vt)) + } else { + d.saveError(&UnmarshalTypeError{"object", v.Type(), int64(d.off)}) + } +} + +func (d *decodeState) convertLiteral(name []byte) (interface{}, bool) { + if len(name) == 0 { + return nil, false + } + switch name[0] { + case 't': + if bytes.Equal(name, trueBytes) { + return true, true + } + case 'f': + if bytes.Equal(name, falseBytes) { + return false, true + } + case 'n': + if bytes.Equal(name, nullBytes) { + return nil, true + } + } + if l, ok := d.ext.consts[string(name)]; ok { + return l, true + } + return nil, false +} + +// literal consumes a literal from d.data[d.off-1:], decoding into the value v. +// The first byte of the literal has been read already +// (that's how the caller knows it's a literal). +func (d *decodeState) literal(v reflect.Value) { + // All bytes inside literal return scanContinue op code. + start := d.off - 1 + op := d.scanWhile(scanContinue) + + // Scan read one byte too far; back up. + d.off-- + d.scan.undo(op) + + d.literalStore(d.data[start:d.off], v, false) +} + +// convertNumber converts the number literal s to a float64 or a Number +// depending on the setting of d.useNumber. +func (d *decodeState) convertNumber(s string) (interface{}, error) { + if d.useNumber { + return Number(s), nil + } + f, err := strconv.ParseFloat(s, 64) + if err != nil { + return nil, &UnmarshalTypeError{"number " + s, reflect.TypeOf(0.0), int64(d.off)} + } + return f, nil +} + +var numberType = reflect.TypeOf(Number("")) + +// literalStore decodes a literal stored in item into v. +// +// fromQuoted indicates whether this literal came from unwrapping a +// string from the ",string" struct tag option. this is used only to +// produce more helpful error messages. +func (d *decodeState) literalStore(item []byte, v reflect.Value, fromQuoted bool) { + // Check for unmarshaler. + if len(item) == 0 { + //Empty string given + d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + return + } + wantptr := item[0] == 'n' // null + u, ut, pv := d.indirect(v, wantptr) + if u != nil { + err := u.UnmarshalJSON(item) + if err != nil { + d.error(err) + } + return + } + if ut != nil { + if item[0] != '"' { + if fromQuoted { + d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + } else { + d.saveError(&UnmarshalTypeError{"string", v.Type(), int64(d.off)}) + } + return + } + s, ok := unquoteBytes(item) + if !ok { + if fromQuoted { + d.error(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + } else { + d.error(errPhase) + } + } + err := ut.UnmarshalText(s) + if err != nil { + d.error(err) + } + return + } + + v = pv + + switch c := item[0]; c { + case 'n': // null + switch v.Kind() { + case reflect.Interface, reflect.Ptr, reflect.Map, reflect.Slice: + v.Set(reflect.Zero(v.Type())) + // otherwise, ignore null for primitives/string + } + case 't', 'f': // true, false + value := c == 't' + switch v.Kind() { + default: + if fromQuoted { + d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + } else { + d.saveError(&UnmarshalTypeError{"bool", v.Type(), int64(d.off)}) + } + case reflect.Bool: + v.SetBool(value) + case reflect.Interface: + if v.NumMethod() == 0 { + v.Set(reflect.ValueOf(value)) + } else { + d.saveError(&UnmarshalTypeError{"bool", v.Type(), int64(d.off)}) + } + } + + case '"': // string + s, ok := unquoteBytes(item) + if !ok { + if fromQuoted { + d.error(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + } else { + d.error(errPhase) + } + } + switch v.Kind() { + default: + d.saveError(&UnmarshalTypeError{"string", v.Type(), int64(d.off)}) + case reflect.Slice: + if v.Type().Elem().Kind() != reflect.Uint8 { + d.saveError(&UnmarshalTypeError{"string", v.Type(), int64(d.off)}) + break + } + b := make([]byte, base64.StdEncoding.DecodedLen(len(s))) + n, err := base64.StdEncoding.Decode(b, s) + if err != nil { + d.saveError(err) + break + } + v.SetBytes(b[:n]) + case reflect.String: + v.SetString(string(s)) + case reflect.Interface: + if v.NumMethod() == 0 { + v.Set(reflect.ValueOf(string(s))) + } else { + d.saveError(&UnmarshalTypeError{"string", v.Type(), int64(d.off)}) + } + } + + default: // number + if c != '-' && (c < '0' || c > '9') { + if fromQuoted { + d.error(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + } else { + d.error(errPhase) + } + } + s := string(item) + switch v.Kind() { + default: + if v.Kind() == reflect.String && v.Type() == numberType { + v.SetString(s) + if !isValidNumber(s) { + d.error(fmt.Errorf("json: invalid number literal, trying to unmarshal %q into Number", item)) + } + break + } + if fromQuoted { + d.error(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + } else { + d.error(&UnmarshalTypeError{"number", v.Type(), int64(d.off)}) + } + case reflect.Interface: + n, err := d.convertNumber(s) + if err != nil { + d.saveError(err) + break + } + if v.NumMethod() != 0 { + d.saveError(&UnmarshalTypeError{"number", v.Type(), int64(d.off)}) + break + } + v.Set(reflect.ValueOf(n)) + + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + n, err := strconv.ParseInt(s, 10, 64) + if err != nil || v.OverflowInt(n) { + d.saveError(&UnmarshalTypeError{"number " + s, v.Type(), int64(d.off)}) + break + } + v.SetInt(n) + + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + n, err := strconv.ParseUint(s, 10, 64) + if err != nil || v.OverflowUint(n) { + d.saveError(&UnmarshalTypeError{"number " + s, v.Type(), int64(d.off)}) + break + } + v.SetUint(n) + + case reflect.Float32, reflect.Float64: + n, err := strconv.ParseFloat(s, v.Type().Bits()) + if err != nil || v.OverflowFloat(n) { + d.saveError(&UnmarshalTypeError{"number " + s, v.Type(), int64(d.off)}) + break + } + v.SetFloat(n) + } + } +} + +// The xxxInterface routines build up a value to be stored +// in an empty interface. They are not strictly necessary, +// but they avoid the weight of reflection in this common case. + +// valueInterface is like value but returns interface{} +func (d *decodeState) valueInterface() interface{} { + switch d.scanWhile(scanSkipSpace) { + default: + d.error(errPhase) + panic("unreachable") + case scanBeginArray: + return d.arrayInterface() + case scanBeginObject: + return d.objectInterface() + case scanBeginLiteral: + return d.literalInterface() + case scanBeginName: + return d.nameInterface() + } +} + +func (d *decodeState) syntaxError(expected string) { + msg := fmt.Sprintf("invalid character '%c' looking for %s", d.data[d.off-1], expected) + d.error(&SyntaxError{msg, int64(d.off)}) +} + +// arrayInterface is like array but returns []interface{}. +func (d *decodeState) arrayInterface() []interface{} { + var v = make([]interface{}, 0) + for { + // Look ahead for ] - can only happen on first iteration. + op := d.scanWhile(scanSkipSpace) + if op == scanEndArray { + if len(v) > 0 && !d.ext.trailingCommas { + d.syntaxError("beginning of value") + } + break + } + + // Back up so d.value can have the byte we just read. + d.off-- + d.scan.undo(op) + + v = append(v, d.valueInterface()) + + // Next token must be , or ]. + op = d.scanWhile(scanSkipSpace) + if op == scanEndArray { + break + } + if op != scanArrayValue { + d.error(errPhase) + } + } + return v +} + +// objectInterface is like object but returns map[string]interface{}. +func (d *decodeState) objectInterface() interface{} { + v, ok := d.keyed() + if ok { + return v + } + + m := make(map[string]interface{}) + for { + // Read opening " of string key or closing }. + op := d.scanWhile(scanSkipSpace) + if op == scanEndObject { + if len(m) > 0 && !d.ext.trailingCommas { + d.syntaxError("beginning of object key string") + } + break + } + if op == scanBeginName { + if !d.ext.unquotedKeys { + d.syntaxError("beginning of object key string") + } + } else if op != scanBeginLiteral { + d.error(errPhase) + } + unquotedKey := op == scanBeginName + + // Read string key. + start := d.off - 1 + op = d.scanWhile(scanContinue) + item := d.data[start : d.off-1] + var key string + if unquotedKey { + key = string(item) + } else { + var ok bool + key, ok = unquote(item) + if !ok { + d.error(errPhase) + } + } + + // Read : before value. + if op == scanSkipSpace { + op = d.scanWhile(scanSkipSpace) + } + if op != scanObjectKey { + d.error(errPhase) + } + + // Read value. + m[key] = d.valueInterface() + + // Next token must be , or }. + op = d.scanWhile(scanSkipSpace) + if op == scanEndObject { + break + } + if op != scanObjectValue { + d.error(errPhase) + } + } + return m +} + +// literalInterface is like literal but returns an interface value. +func (d *decodeState) literalInterface() interface{} { + // All bytes inside literal return scanContinue op code. + start := d.off - 1 + op := d.scanWhile(scanContinue) + + // Scan read one byte too far; back up. + d.off-- + d.scan.undo(op) + item := d.data[start:d.off] + + switch c := item[0]; c { + case 'n': // null + return nil + + case 't', 'f': // true, false + return c == 't' + + case '"': // string + s, ok := unquote(item) + if !ok { + d.error(errPhase) + } + return s + + default: // number + if c != '-' && (c < '0' || c > '9') { + d.error(errPhase) + } + n, err := d.convertNumber(string(item)) + if err != nil { + d.saveError(err) + } + return n + } +} + +// nameInterface is like function but returns map[string]interface{}. +func (d *decodeState) nameInterface() interface{} { + v, ok := d.keyed() + if ok { + return v + } + + nameStart := d.off - 1 + + op := d.scanWhile(scanContinue) + + name := d.data[nameStart : d.off-1] + if op != scanParam { + // Back up so the byte just read is consumed next. + d.off-- + d.scan.undo(op) + if l, ok := d.convertLiteral(name); ok { + return l + } + d.error(&SyntaxError{fmt.Sprintf("json: unknown constant %q", name), int64(d.off)}) + } + + funcName := string(name) + funcData := d.ext.funcs[funcName] + if funcData.key == "" { + d.error(fmt.Errorf("json: unknown function %q", funcName)) + } + + m := make(map[string]interface{}) + for i := 0; ; i++ { + // Look ahead for ) - can only happen on first iteration. + op := d.scanWhile(scanSkipSpace) + if op == scanEndParams { + break + } + + // Back up so d.value can have the byte we just read. + d.off-- + d.scan.undo(op) + + if i >= len(funcData.args) { + d.error(fmt.Errorf("json: too many arguments for function %s", funcName)) + } + m[funcData.args[i]] = d.valueInterface() + + // Next token must be , or ). + op = d.scanWhile(scanSkipSpace) + if op == scanEndParams { + break + } + if op != scanParam { + d.error(errPhase) + } + } + return map[string]interface{}{funcData.key: m} +} + +// getu4 decodes \uXXXX from the beginning of s, returning the hex value, +// or it returns -1. +func getu4(s []byte) rune { + if len(s) < 6 || s[0] != '\\' || s[1] != 'u' { + return -1 + } + r, err := strconv.ParseUint(string(s[2:6]), 16, 64) + if err != nil { + return -1 + } + return rune(r) +} + +// unquote converts a quoted JSON string literal s into an actual string t. +// The rules are different than for Go, so cannot use strconv.Unquote. +func unquote(s []byte) (t string, ok bool) { + s, ok = unquoteBytes(s) + t = string(s) + return +} + +func unquoteBytes(s []byte) (t []byte, ok bool) { + if len(s) < 2 || s[0] != '"' || s[len(s)-1] != '"' { + return + } + s = s[1 : len(s)-1] + + // Check for unusual characters. If there are none, + // then no unquoting is needed, so return a slice of the + // original bytes. + r := 0 + for r < len(s) { + c := s[r] + if c == '\\' || c == '"' || c < ' ' { + break + } + if c < utf8.RuneSelf { + r++ + continue + } + rr, size := utf8.DecodeRune(s[r:]) + if rr == utf8.RuneError && size == 1 { + break + } + r += size + } + if r == len(s) { + return s, true + } + + b := make([]byte, len(s)+2*utf8.UTFMax) + w := copy(b, s[0:r]) + for r < len(s) { + // Out of room? Can only happen if s is full of + // malformed UTF-8 and we're replacing each + // byte with RuneError. + if w >= len(b)-2*utf8.UTFMax { + nb := make([]byte, (len(b)+utf8.UTFMax)*2) + copy(nb, b[0:w]) + b = nb + } + switch c := s[r]; { + case c == '\\': + r++ + if r >= len(s) { + return + } + switch s[r] { + default: + return + case '"', '\\', '/', '\'': + b[w] = s[r] + r++ + w++ + case 'b': + b[w] = '\b' + r++ + w++ + case 'f': + b[w] = '\f' + r++ + w++ + case 'n': + b[w] = '\n' + r++ + w++ + case 'r': + b[w] = '\r' + r++ + w++ + case 't': + b[w] = '\t' + r++ + w++ + case 'u': + r-- + rr := getu4(s[r:]) + if rr < 0 { + return + } + r += 6 + if utf16.IsSurrogate(rr) { + rr1 := getu4(s[r:]) + if dec := utf16.DecodeRune(rr, rr1); dec != unicode.ReplacementChar { + // A valid pair; consume. + r += 6 + w += utf8.EncodeRune(b[w:], dec) + break + } + // Invalid surrogate; fall back to replacement rune. + rr = unicode.ReplacementChar + } + w += utf8.EncodeRune(b[w:], rr) + } + + // Quote, control characters are invalid. + case c == '"', c < ' ': + return + + // ASCII + case c < utf8.RuneSelf: + b[w] = c + r++ + w++ + + // Coerce to well-formed UTF-8. + default: + rr, size := utf8.DecodeRune(s[r:]) + r += size + w += utf8.EncodeRune(b[w:], rr) + } + } + return b[0:w], true +} diff --git a/go/vendor/github.com/globalsign/mgo/internal/json/encode.go b/go/vendor/github.com/globalsign/mgo/internal/json/encode.go new file mode 100644 index 0000000..e4b8f86 --- /dev/null +++ b/go/vendor/github.com/globalsign/mgo/internal/json/encode.go @@ -0,0 +1,1260 @@ +// Copyright 2010 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 implements encoding and decoding of JSON as defined in +// RFC 4627. The mapping between JSON and Go values is described +// in the documentation for the Marshal and Unmarshal functions. +// +// See "JSON and Go" for an introduction to this package: +// https://golang.org/doc/articles/json_and_go.html +package json + +import ( + "bytes" + "encoding" + "encoding/base64" + "fmt" + "math" + "reflect" + "runtime" + "sort" + "strconv" + "strings" + "sync" + "unicode" + "unicode/utf8" +) + +// Marshal returns the JSON encoding of v. +// +// Marshal traverses the value v recursively. +// If an encountered value implements the Marshaler interface +// and is not a nil pointer, Marshal calls its MarshalJSON method +// to produce JSON. If no MarshalJSON method is present but the +// value implements encoding.TextMarshaler instead, Marshal calls +// its MarshalText method. +// The nil pointer exception is not strictly necessary +// but mimics a similar, necessary exception in the behavior of +// UnmarshalJSON. +// +// Otherwise, Marshal uses the following type-dependent default encodings: +// +// Boolean values encode as JSON booleans. +// +// Floating point, integer, and Number values encode as JSON numbers. +// +// String values encode as JSON strings coerced to valid UTF-8, +// replacing invalid bytes with the Unicode replacement rune. +// The angle brackets "<" and ">" are escaped to "\u003c" and "\u003e" +// to keep some browsers from misinterpreting JSON output as HTML. +// Ampersand "&" is also escaped to "\u0026" for the same reason. +// This escaping can be disabled using an Encoder with DisableHTMLEscaping. +// +// Array and slice values encode as JSON arrays, except that +// []byte encodes as a base64-encoded string, and a nil slice +// encodes as the null JSON value. +// +// Struct values encode as JSON objects. Each exported struct field +// becomes a member of the object unless +// - the field's tag is "-", or +// - the field is empty and its tag specifies the "omitempty" option. +// The empty values are false, 0, any +// nil pointer or interface value, and any array, slice, map, or string of +// length zero. The object's default key string is the struct field name +// but can be specified in the struct field's tag value. The "json" key in +// the struct field's tag value is the key name, followed by an optional comma +// and options. Examples: +// +// // Field is ignored by this package. +// Field int `json:"-"` +// +// // Field appears in JSON as key "myName". +// Field int `json:"myName"` +// +// // Field appears in JSON as key "myName" and +// // the field is omitted from the object if its value is empty, +// // as defined above. +// Field int `json:"myName,omitempty"` +// +// // Field appears in JSON as key "Field" (the default), but +// // the field is skipped if empty. +// // Note the leading comma. +// Field int `json:",omitempty"` +// +// The "string" option signals that a field is stored as JSON inside a +// JSON-encoded string. It applies only to fields of string, floating point, +// integer, or boolean types. This extra level of encoding is sometimes used +// when communicating with JavaScript programs: +// +// Int64String int64 `json:",string"` +// +// The key name will be used if it's a non-empty string consisting of +// only Unicode letters, digits, dollar signs, percent signs, hyphens, +// underscores and slashes. +// +// Anonymous struct fields are usually marshaled as if their inner exported fields +// were fields in the outer struct, subject to the usual Go visibility rules amended +// as described in the next paragraph. +// An anonymous struct field with a name given in its JSON tag is treated as +// having that name, rather than being anonymous. +// An anonymous struct field of interface type is treated the same as having +// that type as its name, rather than being anonymous. +// +// The Go visibility rules for struct fields are amended for JSON when +// deciding which field to marshal or unmarshal. If there are +// multiple fields at the same level, and that level is the least +// nested (and would therefore be the nesting level selected by the +// usual Go rules), the following extra rules apply: +// +// 1) Of those fields, if any are JSON-tagged, only tagged fields are considered, +// even if there are multiple untagged fields that would otherwise conflict. +// 2) If there is exactly one field (tagged or not according to the first rule), that is selected. +// 3) Otherwise there are multiple fields, and all are ignored; no error occurs. +// +// Handling of anonymous struct fields is new in Go 1.1. +// Prior to Go 1.1, anonymous struct fields were ignored. To force ignoring of +// an anonymous struct field in both current and earlier versions, give the field +// a JSON tag of "-". +// +// Map values encode as JSON objects. The map's key type must either be a string +// or implement encoding.TextMarshaler. The map keys are used as JSON object +// keys, subject to the UTF-8 coercion described for string values above. +// +// Pointer values encode as the value pointed to. +// A nil pointer encodes as the null JSON value. +// +// Interface values encode as the value contained in the interface. +// A nil interface value encodes as the null JSON value. +// +// Channel, complex, and function values cannot be encoded in JSON. +// Attempting to encode such a value causes Marshal to return +// an UnsupportedTypeError. +// +// JSON cannot represent cyclic data structures and Marshal does not +// handle them. Passing cyclic structures to Marshal will result in +// an infinite recursion. +// +func Marshal(v interface{}) ([]byte, error) { + e := &encodeState{} + err := e.marshal(v, encOpts{escapeHTML: true}) + if err != nil { + return nil, err + } + return e.Bytes(), nil +} + +// MarshalIndent is like Marshal but applies Indent to format the output. +func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) { + b, err := Marshal(v) + if err != nil { + return nil, err + } + var buf bytes.Buffer + err = Indent(&buf, b, prefix, indent) + if err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +// HTMLEscape appends to dst the JSON-encoded src with <, >, &, U+2028 and U+2029 +// characters inside string literals changed to \u003c, \u003e, \u0026, \u2028, \u2029 +// so that the JSON will be safe to embed inside HTML + + +` +) diff --git a/go/vendor/github.com/go-openapi/runtime/middleware/request.go b/go/vendor/github.com/go-openapi/runtime/middleware/request.go new file mode 100644 index 0000000..ee725f5 --- /dev/null +++ b/go/vendor/github.com/go-openapi/runtime/middleware/request.go @@ -0,0 +1,104 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 middleware + +import ( + "net/http" + "reflect" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/spec" + "github.com/go-openapi/strfmt" +) + +// RequestBinder binds and validates the data from a http request +type untypedRequestBinder struct { + Spec *spec.Swagger + Parameters map[string]spec.Parameter + Formats strfmt.Registry + paramBinders map[string]*untypedParamBinder +} + +// NewRequestBinder creates a new binder for reading a request. +func newUntypedRequestBinder(parameters map[string]spec.Parameter, spec *spec.Swagger, formats strfmt.Registry) *untypedRequestBinder { + binders := make(map[string]*untypedParamBinder) + for fieldName, param := range parameters { + binders[fieldName] = newUntypedParamBinder(param, spec, formats) + } + return &untypedRequestBinder{ + Parameters: parameters, + paramBinders: binders, + Spec: spec, + Formats: formats, + } +} + +// Bind perform the databinding and validation +func (o *untypedRequestBinder) Bind(request *http.Request, routeParams RouteParams, consumer runtime.Consumer, data interface{}) error { + val := reflect.Indirect(reflect.ValueOf(data)) + isMap := val.Kind() == reflect.Map + var result []error + debugLog("binding %d parameters for %s %s", len(o.Parameters), request.Method, request.URL.EscapedPath()) + for fieldName, param := range o.Parameters { + binder := o.paramBinders[fieldName] + debugLog("binding parameter %s for %s %s", fieldName, request.Method, request.URL.EscapedPath()) + var target reflect.Value + if !isMap { + binder.Name = fieldName + target = val.FieldByName(fieldName) + } + + if isMap { + tpe := binder.Type() + if tpe == nil { + if param.Schema.Type.Contains("array") { + tpe = reflect.TypeOf([]interface{}{}) + } else { + tpe = reflect.TypeOf(map[string]interface{}{}) + } + } + target = reflect.Indirect(reflect.New(tpe)) + + } + + if !target.IsValid() { + result = append(result, errors.New(500, "parameter name %q is an unknown field", binder.Name)) + continue + } + + if err := binder.Bind(request, routeParams, consumer, target); err != nil { + result = append(result, err) + continue + } + + if binder.validator != nil { + rr := binder.validator.Validate(target.Interface()) + if rr != nil && rr.HasErrors() { + result = append(result, rr.AsError()) + } + } + + if isMap { + val.SetMapIndex(reflect.ValueOf(param.Name), target) + } + } + + if len(result) > 0 { + return errors.CompositeValidationError(result...) + } + + return nil +} diff --git a/go/vendor/github.com/go-openapi/runtime/middleware/router.go b/go/vendor/github.com/go-openapi/runtime/middleware/router.go new file mode 100644 index 0000000..73c8eeb --- /dev/null +++ b/go/vendor/github.com/go-openapi/runtime/middleware/router.go @@ -0,0 +1,478 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 middleware + +import ( + "fmt" + "net/http" + fpath "path" + "regexp" + "strings" + + "github.com/go-openapi/runtime/security" + + "github.com/go-openapi/analysis" + "github.com/go-openapi/errors" + "github.com/go-openapi/loads" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware/denco" + "github.com/go-openapi/spec" + "github.com/go-openapi/strfmt" +) + +// RouteParam is a object to capture route params in a framework agnostic way. +// implementations of the muxer should use these route params to communicate with the +// swagger framework +type RouteParam struct { + Name string + Value string +} + +// RouteParams the collection of route params +type RouteParams []RouteParam + +// Get gets the value for the route param for the specified key +func (r RouteParams) Get(name string) string { + vv, _, _ := r.GetOK(name) + if len(vv) > 0 { + return vv[len(vv)-1] + } + return "" +} + +// GetOK gets the value but also returns booleans to indicate if a key or value +// is present. This aids in validation and satisfies an interface in use there +// +// The returned values are: data, has key, has value +func (r RouteParams) GetOK(name string) ([]string, bool, bool) { + for _, p := range r { + if p.Name == name { + return []string{p.Value}, true, p.Value != "" + } + } + return nil, false, false +} + +// NewRouter creates a new context aware router middleware +func NewRouter(ctx *Context, next http.Handler) http.Handler { + if ctx.router == nil { + ctx.router = DefaultRouter(ctx.spec, ctx.api) + } + + return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { + if _, rCtx, ok := ctx.RouteInfo(r); ok { + next.ServeHTTP(rw, rCtx) + return + } + + // Not found, check if it exists in the other methods first + if others := ctx.AllowedMethods(r); len(others) > 0 { + ctx.Respond(rw, r, ctx.analyzer.RequiredProduces(), nil, errors.MethodNotAllowed(r.Method, others)) + return + } + + ctx.Respond(rw, r, ctx.analyzer.RequiredProduces(), nil, errors.NotFound("path %s was not found", r.URL.EscapedPath())) + }) +} + +// RoutableAPI represents an interface for things that can serve +// as a provider of implementations for the swagger router +type RoutableAPI interface { + HandlerFor(string, string) (http.Handler, bool) + ServeErrorFor(string) func(http.ResponseWriter, *http.Request, error) + ConsumersFor([]string) map[string]runtime.Consumer + ProducersFor([]string) map[string]runtime.Producer + AuthenticatorsFor(map[string]spec.SecurityScheme) map[string]runtime.Authenticator + Authorizer() runtime.Authorizer + Formats() strfmt.Registry + DefaultProduces() string + DefaultConsumes() string +} + +// Router represents a swagger aware router +type Router interface { + Lookup(method, path string) (*MatchedRoute, bool) + OtherMethods(method, path string) []string +} + +type defaultRouteBuilder struct { + spec *loads.Document + analyzer *analysis.Spec + api RoutableAPI + records map[string][]denco.Record +} + +type defaultRouter struct { + spec *loads.Document + routers map[string]*denco.Router +} + +func newDefaultRouteBuilder(spec *loads.Document, api RoutableAPI) *defaultRouteBuilder { + return &defaultRouteBuilder{ + spec: spec, + analyzer: analysis.New(spec.Spec()), + api: api, + records: make(map[string][]denco.Record), + } +} + +// DefaultRouter creates a default implemenation of the router +func DefaultRouter(spec *loads.Document, api RoutableAPI) Router { + builder := newDefaultRouteBuilder(spec, api) + if spec != nil { + for method, paths := range builder.analyzer.Operations() { + for path, operation := range paths { + fp := fpath.Join(spec.BasePath(), path) + debugLog("adding route %s %s %q", method, fp, operation.ID) + builder.AddRoute(method, fp, operation) + } + } + } + return builder.Build() +} + +// RouteAuthenticator is an authenticator that can compose several authenticators together. +// It also knows when it contains an authenticator that allows for anonymous pass through. +// Contains a group of 1 or more authenticators that have a logical AND relationship +type RouteAuthenticator struct { + Authenticator map[string]runtime.Authenticator + Schemes []string + Scopes map[string][]string + allScopes []string + commonScopes []string + allowAnonymous bool +} + +func (ra *RouteAuthenticator) AllowsAnonymous() bool { + return ra.allowAnonymous +} + +// AllScopes returns a list of unique scopes that is the combination +// of all the scopes in the requirements +func (ra *RouteAuthenticator) AllScopes() []string { + return ra.allScopes +} + +// CommonScopes returns a list of unique scopes that are common in all the +// scopes in the requirements +func (ra *RouteAuthenticator) CommonScopes() []string { + return ra.commonScopes +} + +// Authenticate Authenticator interface implementation +func (ra *RouteAuthenticator) Authenticate(req *http.Request, route *MatchedRoute) (bool, interface{}, error) { + if ra.allowAnonymous { + route.Authenticator = ra + return true, nil, nil + } + // iterate in proper order + var lastResult interface{} + for _, scheme := range ra.Schemes { + if authenticator, ok := ra.Authenticator[scheme]; ok { + applies, princ, err := authenticator.Authenticate(&security.ScopedAuthRequest{ + Request: req, + RequiredScopes: ra.Scopes[scheme], + }) + if !applies { + return false, nil, nil + } + + if err != nil { + route.Authenticator = ra + return true, nil, err + } + lastResult = princ + } + } + route.Authenticator = ra + return true, lastResult, nil +} + +func stringSliceUnion(slices ...[]string) []string { + unique := make(map[string]struct{}) + var result []string + for _, slice := range slices { + for _, entry := range slice { + if _, ok := unique[entry]; ok { + continue + } + unique[entry] = struct{}{} + result = append(result, entry) + } + } + return result +} + +func stringSliceIntersection(slices ...[]string) []string { + unique := make(map[string]int) + var intersection []string + + total := len(slices) + var emptyCnt int + for _, slice := range slices { + if len(slice) == 0 { + emptyCnt++ + continue + } + + for _, entry := range slice { + unique[entry]++ + if unique[entry] == total-emptyCnt { // this entry appeared in all the non-empty slices + intersection = append(intersection, entry) + } + } + } + + return intersection +} + +// RouteAuthenticators represents a group of authenticators that represent a logical OR +type RouteAuthenticators []RouteAuthenticator + +// AllowsAnonymous returns true when there is an authenticator that means optional auth +func (ras RouteAuthenticators) AllowsAnonymous() bool { + for _, ra := range ras { + if ra.AllowsAnonymous() { + return true + } + } + return false +} + +// Authenticate method implemention so this collection can be used as authenticator +func (ras RouteAuthenticators) Authenticate(req *http.Request, route *MatchedRoute) (bool, interface{}, error) { + var lastError error + var allowsAnon bool + var anonAuth RouteAuthenticator + + for _, ra := range ras { + if ra.AllowsAnonymous() { + anonAuth = ra + allowsAnon = true + continue + } + applies, usr, err := ra.Authenticate(req, route) + if !applies || err != nil || usr == nil { + if err != nil { + lastError = err + } + continue + } + return applies, usr, nil + } + + if allowsAnon && lastError == nil { + route.Authenticator = &anonAuth + return true, nil, lastError + } + return lastError != nil, nil, lastError +} + +type routeEntry struct { + PathPattern string + BasePath string + Operation *spec.Operation + Consumes []string + Consumers map[string]runtime.Consumer + Produces []string + Producers map[string]runtime.Producer + Parameters map[string]spec.Parameter + Handler http.Handler + Formats strfmt.Registry + Binder *untypedRequestBinder + Authenticators RouteAuthenticators + Authorizer runtime.Authorizer +} + +// MatchedRoute represents the route that was matched in this request +type MatchedRoute struct { + routeEntry + Params RouteParams + Consumer runtime.Consumer + Producer runtime.Producer + Authenticator *RouteAuthenticator +} + +// HasAuth returns true when the route has a security requirement defined +func (m *MatchedRoute) HasAuth() bool { + return len(m.Authenticators) > 0 +} + +// NeedsAuth returns true when the request still +// needs to perform authentication +func (m *MatchedRoute) NeedsAuth() bool { + return m.HasAuth() && m.Authenticator == nil +} + +func (d *defaultRouter) Lookup(method, path string) (*MatchedRoute, bool) { + mth := strings.ToUpper(method) + debugLog("looking up route for %s %s", method, path) + if Debug { + if len(d.routers) == 0 { + debugLog("there are no known routers") + } + for meth := range d.routers { + debugLog("got a router for %s", meth) + } + } + if router, ok := d.routers[mth]; ok { + if m, rp, ok := router.Lookup(fpath.Clean(path)); ok && m != nil { + if entry, ok := m.(*routeEntry); ok { + debugLog("found a route for %s %s with %d parameters", method, path, len(entry.Parameters)) + var params RouteParams + for _, p := range rp { + v, err := pathUnescape(p.Value) + if err != nil { + debugLog("failed to escape %q: %v", p.Value, err) + v = p.Value + } + // a workaround to handle fragment/composing parameters until they are supported in denco router + // check if this parameter is a fragment within a path segment + if xpos := strings.Index(entry.PathPattern, fmt.Sprintf("{%s}", p.Name)) + len(p.Name) + 2; xpos < len(entry.PathPattern) && entry.PathPattern[xpos] != '/' { + // extract fragment parameters + ep := strings.Split(entry.PathPattern[xpos:], "/")[0] + pnames, pvalues := decodeCompositParams(p.Name, v, ep, nil, nil) + for i, pname := range pnames { + params = append(params, RouteParam{Name: pname, Value: pvalues[i]}) + } + } else { + // use the parameter directly + params = append(params, RouteParam{Name: p.Name, Value: v}) + } + } + return &MatchedRoute{routeEntry: *entry, Params: params}, true + } + } else { + debugLog("couldn't find a route by path for %s %s", method, path) + } + } else { + debugLog("couldn't find a route by method for %s %s", method, path) + } + return nil, false +} + +func (d *defaultRouter) OtherMethods(method, path string) []string { + mn := strings.ToUpper(method) + var methods []string + for k, v := range d.routers { + if k != mn { + if _, _, ok := v.Lookup(fpath.Clean(path)); ok { + methods = append(methods, k) + continue + } + } + } + return methods +} + +// convert swagger parameters per path segment into a denco parameter as multiple parameters per segment are not supported in denco +var pathConverter = regexp.MustCompile(`{(.+?)}([^/]*)`) + +func decodeCompositParams(name string, value string, pattern string, names []string, values []string) ([]string, []string) { + pleft := strings.Index(pattern, "{") + names = append(names, name) + if pleft < 0 { + if strings.HasSuffix(value, pattern) { + values = append(values, value[:len(value)-len(pattern)]) + } else { + values = append(values, "") + } + } else { + toskip := pattern[:pleft] + pright := strings.Index(pattern, "}") + vright := strings.Index(value, toskip) + if vright >= 0 { + values = append(values, value[:vright]) + } else { + values = append(values, "") + value = "" + } + return decodeCompositParams(pattern[pleft+1:pright], value[vright+len(toskip):], pattern[pright+1:], names, values) + } + return names, values +} + +func (d *defaultRouteBuilder) AddRoute(method, path string, operation *spec.Operation) { + mn := strings.ToUpper(method) + + bp := fpath.Clean(d.spec.BasePath()) + if len(bp) > 0 && bp[len(bp)-1] == '/' { + bp = bp[:len(bp)-1] + } + + debugLog("operation: %#v", *operation) + if handler, ok := d.api.HandlerFor(method, strings.TrimPrefix(path, bp)); ok { + consumes := d.analyzer.ConsumesFor(operation) + produces := d.analyzer.ProducesFor(operation) + parameters := d.analyzer.ParamsFor(method, strings.TrimPrefix(path, bp)) + + record := denco.NewRecord(pathConverter.ReplaceAllString(path, ":$1"), &routeEntry{ + BasePath: bp, + PathPattern: path, + Operation: operation, + Handler: handler, + Consumes: consumes, + Produces: produces, + Consumers: d.api.ConsumersFor(normalizeOffers(consumes)), + Producers: d.api.ProducersFor(normalizeOffers(produces)), + Parameters: parameters, + Formats: d.api.Formats(), + Binder: newUntypedRequestBinder(parameters, d.spec.Spec(), d.api.Formats()), + Authenticators: d.buildAuthenticators(operation), + Authorizer: d.api.Authorizer(), + }) + d.records[mn] = append(d.records[mn], record) + } +} + +func (d *defaultRouteBuilder) buildAuthenticators(operation *spec.Operation) RouteAuthenticators { + requirements := d.analyzer.SecurityRequirementsFor(operation) + var auths []RouteAuthenticator + for _, reqs := range requirements { + var schemes []string + scopes := make(map[string][]string, len(reqs)) + var scopeSlices [][]string + for _, req := range reqs { + schemes = append(schemes, req.Name) + scopes[req.Name] = req.Scopes + scopeSlices = append(scopeSlices, req.Scopes) + } + + definitions := d.analyzer.SecurityDefinitionsForRequirements(reqs) + authenticators := d.api.AuthenticatorsFor(definitions) + auths = append(auths, RouteAuthenticator{ + Authenticator: authenticators, + Schemes: schemes, + Scopes: scopes, + allScopes: stringSliceUnion(scopeSlices...), + commonScopes: stringSliceIntersection(scopeSlices...), + allowAnonymous: len(reqs) == 1 && reqs[0].Name == "", + }) + } + return auths +} + +func (d *defaultRouteBuilder) Build() *defaultRouter { + routers := make(map[string]*denco.Router) + for method, records := range d.records { + router := denco.New() + _ = router.Build(records) + routers[method] = router + } + return &defaultRouter{ + spec: d.spec, + routers: routers, + } +} diff --git a/go/vendor/github.com/go-openapi/runtime/middleware/security.go b/go/vendor/github.com/go-openapi/runtime/middleware/security.go new file mode 100644 index 0000000..2b061ca --- /dev/null +++ b/go/vendor/github.com/go-openapi/runtime/middleware/security.go @@ -0,0 +1,39 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 middleware + +import "net/http" + +func newSecureAPI(ctx *Context, next http.Handler) http.Handler { + return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := ctx.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + if route != nil && !route.NeedsAuth() { + next.ServeHTTP(rw, r) + return + } + + _, rCtx, err := ctx.Authorize(r, route) + if err != nil { + ctx.Respond(rw, r, route.Produces, route, err) + return + } + r = rCtx + + next.ServeHTTP(rw, r) + }) +} diff --git a/go/vendor/github.com/go-openapi/runtime/middleware/spec.go b/go/vendor/github.com/go-openapi/runtime/middleware/spec.go new file mode 100644 index 0000000..6e02b83 --- /dev/null +++ b/go/vendor/github.com/go-openapi/runtime/middleware/spec.go @@ -0,0 +1,48 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 middleware + +import ( + "net/http" + "path" +) + +// Spec creates a middleware to serve a swagger spec. +// This allows for altering the spec before starting the http listener. +// This can be useful if you want to serve the swagger spec from another path than /swagger.json +// +func Spec(basePath string, b []byte, next http.Handler) http.Handler { + if basePath == "" { + basePath = "/" + } + pth := path.Join(basePath, "swagger.json") + + return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { + if r.URL.Path == pth { + rw.Header().Set("Content-Type", "application/json") + rw.WriteHeader(http.StatusOK) + //#nosec + rw.Write(b) + return + } + + if next == nil { + rw.Header().Set("Content-Type", "application/json") + rw.WriteHeader(http.StatusNotFound) + return + } + next.ServeHTTP(rw, r) + }) +} diff --git a/go/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go b/go/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go new file mode 100644 index 0000000..3b0cd4e --- /dev/null +++ b/go/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go @@ -0,0 +1,286 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 untyped + +import ( + "fmt" + "net/http" + "sort" + "strings" + + "github.com/go-openapi/analysis" + "github.com/go-openapi/errors" + "github.com/go-openapi/loads" + "github.com/go-openapi/runtime" + "github.com/go-openapi/spec" + "github.com/go-openapi/strfmt" +) + +// NewAPI creates the default untyped API +func NewAPI(spec *loads.Document) *API { + var an *analysis.Spec + if spec != nil && spec.Spec() != nil { + an = analysis.New(spec.Spec()) + } + api := &API{ + spec: spec, + analyzer: an, + consumers: make(map[string]runtime.Consumer, 10), + producers: make(map[string]runtime.Producer, 10), + authenticators: make(map[string]runtime.Authenticator), + operations: make(map[string]map[string]runtime.OperationHandler), + ServeError: errors.ServeError, + Models: make(map[string]func() interface{}), + formats: strfmt.NewFormats(), + } + return api.WithJSONDefaults() +} + +// API represents an untyped mux for a swagger spec +type API struct { + spec *loads.Document + analyzer *analysis.Spec + DefaultProduces string + DefaultConsumes string + consumers map[string]runtime.Consumer + producers map[string]runtime.Producer + authenticators map[string]runtime.Authenticator + authorizer runtime.Authorizer + operations map[string]map[string]runtime.OperationHandler + ServeError func(http.ResponseWriter, *http.Request, error) + Models map[string]func() interface{} + formats strfmt.Registry +} + +// WithJSONDefaults loads the json defaults for this api +func (d *API) WithJSONDefaults() *API { + d.DefaultConsumes = runtime.JSONMime + d.DefaultProduces = runtime.JSONMime + d.consumers[runtime.JSONMime] = runtime.JSONConsumer() + d.producers[runtime.JSONMime] = runtime.JSONProducer() + return d +} + +// WithoutJSONDefaults clears the json defaults for this api +func (d *API) WithoutJSONDefaults() *API { + d.DefaultConsumes = "" + d.DefaultProduces = "" + delete(d.consumers, runtime.JSONMime) + delete(d.producers, runtime.JSONMime) + return d +} + +// Formats returns the registered string formats +func (d *API) Formats() strfmt.Registry { + if d.formats == nil { + d.formats = strfmt.NewFormats() + } + return d.formats +} + +// RegisterFormat registers a custom format validator +func (d *API) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { + if d.formats == nil { + d.formats = strfmt.NewFormats() + } + d.formats.Add(name, format, validator) +} + +// RegisterAuth registers an auth handler in this api +func (d *API) RegisterAuth(scheme string, handler runtime.Authenticator) { + if d.authenticators == nil { + d.authenticators = make(map[string]runtime.Authenticator) + } + d.authenticators[scheme] = handler +} + +// RegisterAuthorizer registers an authorizer handler in this api +func (d *API) RegisterAuthorizer(handler runtime.Authorizer) { + d.authorizer = handler +} + +// RegisterConsumer registers a consumer for a media type. +func (d *API) RegisterConsumer(mediaType string, handler runtime.Consumer) { + if d.consumers == nil { + d.consumers = make(map[string]runtime.Consumer, 10) + } + d.consumers[strings.ToLower(mediaType)] = handler +} + +// RegisterProducer registers a producer for a media type +func (d *API) RegisterProducer(mediaType string, handler runtime.Producer) { + if d.producers == nil { + d.producers = make(map[string]runtime.Producer, 10) + } + d.producers[strings.ToLower(mediaType)] = handler +} + +// RegisterOperation registers an operation handler for an operation name +func (d *API) RegisterOperation(method, path string, handler runtime.OperationHandler) { + if d.operations == nil { + d.operations = make(map[string]map[string]runtime.OperationHandler, 30) + } + um := strings.ToUpper(method) + if b, ok := d.operations[um]; !ok || b == nil { + d.operations[um] = make(map[string]runtime.OperationHandler) + } + d.operations[um][path] = handler +} + +// OperationHandlerFor returns the operation handler for the specified id if it can be found +func (d *API) OperationHandlerFor(method, path string) (runtime.OperationHandler, bool) { + if d.operations == nil { + return nil, false + } + if pi, ok := d.operations[strings.ToUpper(method)]; ok { + h, ok := pi[path] + return h, ok + } + return nil, false +} + +// ConsumersFor gets the consumers for the specified media types +func (d *API) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { + result := make(map[string]runtime.Consumer) + for _, mt := range mediaTypes { + if consumer, ok := d.consumers[mt]; ok { + result[mt] = consumer + } + } + return result +} + +// ProducersFor gets the producers for the specified media types +func (d *API) ProducersFor(mediaTypes []string) map[string]runtime.Producer { + result := make(map[string]runtime.Producer) + for _, mt := range mediaTypes { + if producer, ok := d.producers[mt]; ok { + result[mt] = producer + } + } + return result +} + +// AuthenticatorsFor gets the authenticators for the specified security schemes +func (d *API) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { + result := make(map[string]runtime.Authenticator) + for k := range schemes { + if a, ok := d.authenticators[k]; ok { + result[k] = a + } + } + return result +} + +// AuthorizersFor returns the registered authorizer +func (d *API) Authorizer() runtime.Authorizer { + return d.authorizer +} + +// Validate validates this API for any missing items +func (d *API) Validate() error { + return d.validate() +} + +// validateWith validates the registrations in this API against the provided spec analyzer +func (d *API) validate() error { + var consumes []string + for k := range d.consumers { + consumes = append(consumes, k) + } + + var produces []string + for k := range d.producers { + produces = append(produces, k) + } + + var authenticators []string + for k := range d.authenticators { + authenticators = append(authenticators, k) + } + + var operations []string + for m, v := range d.operations { + for p := range v { + operations = append(operations, fmt.Sprintf("%s %s", strings.ToUpper(m), p)) + } + } + + var definedAuths []string + for k := range d.spec.Spec().SecurityDefinitions { + definedAuths = append(definedAuths, k) + } + + if err := d.verify("consumes", consumes, d.analyzer.RequiredConsumes()); err != nil { + return err + } + if err := d.verify("produces", produces, d.analyzer.RequiredProduces()); err != nil { + return err + } + if err := d.verify("operation", operations, d.analyzer.OperationMethodPaths()); err != nil { + return err + } + + requiredAuths := d.analyzer.RequiredSecuritySchemes() + if err := d.verify("auth scheme", authenticators, requiredAuths); err != nil { + return err + } + if err := d.verify("security definitions", definedAuths, requiredAuths); err != nil { + return err + } + return nil +} + +func (d *API) verify(name string, registrations []string, expectations []string) error { + + sort.Sort(sort.StringSlice(registrations)) + sort.Sort(sort.StringSlice(expectations)) + + expected := map[string]struct{}{} + seen := map[string]struct{}{} + + for _, v := range expectations { + expected[v] = struct{}{} + } + + var unspecified []string + for _, v := range registrations { + seen[v] = struct{}{} + if _, ok := expected[v]; !ok { + unspecified = append(unspecified, v) + } + } + + for k := range seen { + delete(expected, k) + } + + var unregistered []string + for k := range expected { + unregistered = append(unregistered, k) + } + sort.Sort(sort.StringSlice(unspecified)) + sort.Sort(sort.StringSlice(unregistered)) + + if len(unregistered) > 0 || len(unspecified) > 0 { + return &errors.APIVerificationFailed{ + Section: name, + MissingSpecification: unspecified, + MissingRegistration: unregistered, + } + } + + return nil +} diff --git a/go/vendor/github.com/go-openapi/runtime/middleware/validation.go b/go/vendor/github.com/go-openapi/runtime/middleware/validation.go new file mode 100644 index 0000000..bb8df3c --- /dev/null +++ b/go/vendor/github.com/go-openapi/runtime/middleware/validation.go @@ -0,0 +1,122 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 middleware + +import ( + "mime" + "net/http" + "strings" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" +) + +type validation struct { + context *Context + result []error + request *http.Request + route *MatchedRoute + bound map[string]interface{} +} + +// ContentType validates the content type of a request +func validateContentType(allowed []string, actual string) error { + debugLog("validating content type for %q against [%s]", actual, strings.Join(allowed, ", ")) + if len(allowed) == 0 { + return nil + } + mt, _, err := mime.ParseMediaType(actual) + if err != nil { + return errors.InvalidContentType(actual, allowed) + } + if swag.ContainsStringsCI(allowed, mt) { + return nil + } + if swag.ContainsStringsCI(allowed, "*/*") { + return nil + } + parts := strings.Split(actual, "/") + if len(parts) == 2 && swag.ContainsStringsCI(allowed, parts[0]+"/*") { + return nil + } + return errors.InvalidContentType(actual, allowed) +} + +func validateRequest(ctx *Context, request *http.Request, route *MatchedRoute) *validation { + debugLog("validating request %s %s", request.Method, request.URL.EscapedPath()) + validate := &validation{ + context: ctx, + request: request, + route: route, + bound: make(map[string]interface{}), + } + + validate.contentType() + if len(validate.result) == 0 { + validate.responseFormat() + } + if len(validate.result) == 0 { + validate.parameters() + } + + return validate +} + +func (v *validation) parameters() { + debugLog("validating request parameters for %s %s", v.request.Method, v.request.URL.EscapedPath()) + if result := v.route.Binder.Bind(v.request, v.route.Params, v.route.Consumer, v.bound); result != nil { + if result.Error() == "validation failure list" { + for _, e := range result.(*errors.Validation).Value.([]interface{}) { + v.result = append(v.result, e.(error)) + } + return + } + v.result = append(v.result, result) + } +} + +func (v *validation) contentType() { + if len(v.result) == 0 && runtime.HasBody(v.request) { + debugLog("validating body content type for %s %s", v.request.Method, v.request.URL.EscapedPath()) + ct, _, req, err := v.context.ContentType(v.request) + if err != nil { + v.result = append(v.result, err) + } else { + v.request = req + } + + if len(v.result) == 0 { + if err := validateContentType(v.route.Consumes, ct); err != nil { + v.result = append(v.result, err) + } + } + if ct != "" && v.route.Consumer == nil { + cons, ok := v.route.Consumers[ct] + if !ok { + v.result = append(v.result, errors.New(500, "no consumer registered for %s", ct)) + } else { + v.route.Consumer = cons + } + } + } +} + +func (v *validation) responseFormat() { + if str, rCtx := v.context.ResponseFormat(v.request, v.route.Produces); str == "" && runtime.HasBody(v.request) { + v.request = rCtx + v.result = append(v.result, errors.InvalidResponseFormat(v.request.Header.Get(runtime.HeaderAccept), v.route.Produces)) + } +} diff --git a/go/vendor/github.com/go-openapi/runtime/request.go b/go/vendor/github.com/go-openapi/runtime/request.go new file mode 100644 index 0000000..87b73da --- /dev/null +++ b/go/vendor/github.com/go-openapi/runtime/request.go @@ -0,0 +1,77 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 runtime + +import ( + "io" + "net/http" + "strings" + + "github.com/go-openapi/swag" +) + +// CanHaveBody returns true if this method can have a body +func CanHaveBody(method string) bool { + mn := strings.ToUpper(method) + return mn == "POST" || mn == "PUT" || mn == "PATCH" || mn == "DELETE" +} + +// IsSafe returns true if this is a request with a safe method +func IsSafe(r *http.Request) bool { + mn := strings.ToUpper(r.Method) + return mn == "GET" || mn == "HEAD" +} + +// AllowsBody returns true if the request allows for a body +func AllowsBody(r *http.Request) bool { + mn := strings.ToUpper(r.Method) + return mn != "HEAD" +} + +// HasBody returns true if this method needs a content-type +func HasBody(r *http.Request) bool { + return len(r.TransferEncoding) > 0 || r.ContentLength > 0 +} + +// JSONRequest creates a new http request with json headers set +func JSONRequest(method, urlStr string, body io.Reader) (*http.Request, error) { + req, err := http.NewRequest(method, urlStr, body) + if err != nil { + return nil, err + } + req.Header.Add(HeaderContentType, JSONMime) + req.Header.Add(HeaderAccept, JSONMime) + return req, nil +} + +// Gettable for things with a method GetOK(string) (data string, hasKey bool, hasValue bool) +type Gettable interface { + GetOK(string) ([]string, bool, bool) +} + +// ReadSingleValue reads a single value from the source +func ReadSingleValue(values Gettable, name string) string { + vv, _, hv := values.GetOK(name) + if hv { + return vv[len(vv)-1] + } + return "" +} + +// ReadCollectionValue reads a collection value from a string data source +func ReadCollectionValue(values Gettable, name, collectionFormat string) []string { + v := ReadSingleValue(values, name) + return swag.SplitByFormat(v, collectionFormat) +} diff --git a/go/vendor/github.com/go-openapi/runtime/security/authenticator.go b/go/vendor/github.com/go-openapi/runtime/security/authenticator.go new file mode 100644 index 0000000..3c624d7 --- /dev/null +++ b/go/vendor/github.com/go-openapi/runtime/security/authenticator.go @@ -0,0 +1,215 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 security + +import ( + "context" + "net/http" + "strings" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" +) + +const ( + query = "query" + header = "header" +) + +// HttpAuthenticator is a function that authenticates a HTTP request +func HttpAuthenticator(handler func(*http.Request) (bool, interface{}, error)) runtime.Authenticator { + return runtime.AuthenticatorFunc(func(params interface{}) (bool, interface{}, error) { + if request, ok := params.(*http.Request); ok { + return handler(request) + } + if scoped, ok := params.(*ScopedAuthRequest); ok { + return handler(scoped.Request) + } + return false, nil, nil + }) +} + +// ScopedAuthenticator is a function that authenticates a HTTP request against a list of valid scopes +func ScopedAuthenticator(handler func(*ScopedAuthRequest) (bool, interface{}, error)) runtime.Authenticator { + return runtime.AuthenticatorFunc(func(params interface{}) (bool, interface{}, error) { + if request, ok := params.(*ScopedAuthRequest); ok { + return handler(request) + } + return false, nil, nil + }) +} + +// UserPassAuthentication authentication function +type UserPassAuthentication func(string, string) (interface{}, error) + +// UserPassAuthenticationCtx authentication function with context.Context +type UserPassAuthenticationCtx func(context.Context, string, string) (context.Context, interface{}, error) + +// TokenAuthentication authentication function +type TokenAuthentication func(string) (interface{}, error) + +// TokenAuthenticationCtx authentication function with context.Context +type TokenAuthenticationCtx func(context.Context, string) (context.Context, interface{}, error) + +// ScopedTokenAuthentication authentication function +type ScopedTokenAuthentication func(string, []string) (interface{}, error) + +// ScopedTokenAuthenticationCtx authentication function with context.Context +type ScopedTokenAuthenticationCtx func(context.Context, string, []string) (context.Context, interface{}, error) + +// BasicAuth creates a basic auth authenticator with the provided authentication function +func BasicAuth(authenticate UserPassAuthentication) runtime.Authenticator { + return HttpAuthenticator(func(r *http.Request) (bool, interface{}, error) { + if usr, pass, ok := r.BasicAuth(); ok { + p, err := authenticate(usr, pass) + return true, p, err + } + + return false, nil, nil + }) +} + +// BasicAuthCtx creates a basic auth authenticator with the provided authentication function with support for context.Context +func BasicAuthCtx(authenticate UserPassAuthenticationCtx) runtime.Authenticator { + return HttpAuthenticator(func(r *http.Request) (bool, interface{}, error) { + if usr, pass, ok := r.BasicAuth(); ok { + ctx, p, err := authenticate(r.Context(), usr, pass) + *r = *r.WithContext(ctx) + return true, p, err + } + + return false, nil, nil + }) +} + +// APIKeyAuth creates an authenticator that uses a token for authorization. +// This token can be obtained from either a header or a query string +func APIKeyAuth(name, in string, authenticate TokenAuthentication) runtime.Authenticator { + inl := strings.ToLower(in) + if inl != query && inl != header { + // panic because this is most likely a typo + panic(errors.New(500, "api key auth: in value needs to be either \"query\" or \"header\".")) + } + + var getToken func(*http.Request) string + switch inl { + case header: + getToken = func(r *http.Request) string { return r.Header.Get(name) } + case query: + getToken = func(r *http.Request) string { return r.URL.Query().Get(name) } + } + + return HttpAuthenticator(func(r *http.Request) (bool, interface{}, error) { + token := getToken(r) + if token == "" { + return false, nil, nil + } + + p, err := authenticate(token) + return true, p, err + }) +} + +// APIKeyAuthCtx creates an authenticator that uses a token for authorization with support for context.Context. +// This token can be obtained from either a header or a query string +func APIKeyAuthCtx(name, in string, authenticate TokenAuthenticationCtx) runtime.Authenticator { + inl := strings.ToLower(in) + if inl != query && inl != header { + // panic because this is most likely a typo + panic(errors.New(500, "api key auth: in value needs to be either \"query\" or \"header\".")) + } + + var getToken func(*http.Request) string + switch inl { + case header: + getToken = func(r *http.Request) string { return r.Header.Get(name) } + case query: + getToken = func(r *http.Request) string { return r.URL.Query().Get(name) } + } + + return HttpAuthenticator(func(r *http.Request) (bool, interface{}, error) { + token := getToken(r) + if token == "" { + return false, nil, nil + } + + ctx, p, err := authenticate(r.Context(), token) + *r = *r.WithContext(ctx) + return true, p, err + }) +} + +// ScopedAuthRequest contains both a http request and the required scopes for a particular operation +type ScopedAuthRequest struct { + Request *http.Request + RequiredScopes []string +} + +// BearerAuth for use with oauth2 flows +func BearerAuth(name string, authenticate ScopedTokenAuthentication) runtime.Authenticator { + const prefix = "Bearer " + return ScopedAuthenticator(func(r *ScopedAuthRequest) (bool, interface{}, error) { + var token string + hdr := r.Request.Header.Get("Authorization") + if strings.HasPrefix(hdr, prefix) { + token = strings.TrimPrefix(hdr, prefix) + } + if token == "" { + qs := r.Request.URL.Query() + token = qs.Get("access_token") + } + //#nosec + ct, _, _ := runtime.ContentType(r.Request.Header) + if token == "" && (ct == "application/x-www-form-urlencoded" || ct == "multipart/form-data") { + token = r.Request.FormValue("access_token") + } + + if token == "" { + return false, nil, nil + } + + p, err := authenticate(token, r.RequiredScopes) + return true, p, err + }) +} + +// BearerAuthCtx for use with oauth2 flows with support for context.Context. +func BearerAuthCtx(name string, authenticate ScopedTokenAuthenticationCtx) runtime.Authenticator { + const prefix = "Bearer " + return ScopedAuthenticator(func(r *ScopedAuthRequest) (bool, interface{}, error) { + var token string + hdr := r.Request.Header.Get("Authorization") + if strings.HasPrefix(hdr, prefix) { + token = strings.TrimPrefix(hdr, prefix) + } + if token == "" { + qs := r.Request.URL.Query() + token = qs.Get("access_token") + } + //#nosec + ct, _, _ := runtime.ContentType(r.Request.Header) + if token == "" && (ct == "application/x-www-form-urlencoded" || ct == "multipart/form-data") { + token = r.Request.FormValue("access_token") + } + + if token == "" { + return false, nil, nil + } + + ctx, p, err := authenticate(r.Request.Context(), token, r.RequiredScopes) + *r.Request = *r.Request.WithContext(ctx) + return true, p, err + }) +} diff --git a/go/vendor/github.com/go-openapi/runtime/security/authorizer.go b/go/vendor/github.com/go-openapi/runtime/security/authorizer.go new file mode 100644 index 0000000..00c1a4d --- /dev/null +++ b/go/vendor/github.com/go-openapi/runtime/security/authorizer.go @@ -0,0 +1,27 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 security + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// Authorized provides a default implementation of the Authorizer interface where all +// requests are authorized (successful) +func Authorized() runtime.Authorizer { + return runtime.AuthorizerFunc(func(_ *http.Request, _ interface{}) error { return nil }) +} diff --git a/go/vendor/github.com/go-openapi/runtime/statuses.go b/go/vendor/github.com/go-openapi/runtime/statuses.go new file mode 100644 index 0000000..3b011a0 --- /dev/null +++ b/go/vendor/github.com/go-openapi/runtime/statuses.go @@ -0,0 +1,90 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 runtime + +// Statuses lists the most common HTTP status codes to default message +// taken from https://httpstatuses.com/ +var Statuses = map[int]string{ + 100: "Continue", + 101: "Switching Protocols", + 102: "Processing", + 103: "Checkpoint", + 122: "URI too long", + 200: "OK", + 201: "Created", + 202: "Accepted", + 203: "Request Processed", + 204: "No Content", + 205: "Reset Content", + 206: "Partial Content", + 207: "Multi-Status", + 208: "Already Reported", + 226: "IM Used", + 300: "Multiple Choices", + 301: "Moved Permanently", + 302: "Found", + 303: "See Other", + 304: "Not Modified", + 305: "Use Proxy", + 306: "Switch Proxy", + 307: "Temporary Redirect", + 308: "Permanent Redirect", + 400: "Bad Request", + 401: "Unauthorized", + 402: "Payment Required", + 403: "Forbidden", + 404: "Not Found", + 405: "Method Not Allowed", + 406: "Not Acceptable", + 407: "Proxy Authentication Required", + 408: "Request Timeout", + 409: "Conflict", + 410: "Gone", + 411: "Length Required", + 412: "Precondition Failed", + 413: "Request Entity Too Large", + 414: "Request-URI Too Long", + 415: "Unsupported Media Type", + 416: "Request Range Not Satisfiable", + 417: "Expectation Failed", + 418: "I'm a teapot", + 420: "Enhance Your Calm", + 422: "Unprocessable Entity", + 423: "Locked", + 424: "Failed Dependency", + 426: "Upgrade Required", + 428: "Precondition Required", + 429: "Too Many Requests", + 431: "Request Header Fields Too Large", + 444: "No Response", + 449: "Retry With", + 450: "Blocked by Windows Parental Controls", + 451: "Wrong Exchange Server", + 499: "Client Closed Request", + 500: "Internal Server Error", + 501: "Not Implemented", + 502: "Bad Gateway", + 503: "Service Unavailable", + 504: "Gateway Timeout", + 505: "HTTP Version Not Supported", + 506: "Variant Also Negotiates", + 507: "Insufficient Storage", + 508: "Loop Detected", + 509: "Bandwidth Limit Exceeded", + 510: "Not Extended", + 511: "Network Authentication Required", + 598: "Network read timeout error", + 599: "Network connect timeout error", +} diff --git a/go/vendor/github.com/go-openapi/runtime/text.go b/go/vendor/github.com/go-openapi/runtime/text.go new file mode 100644 index 0000000..77099fe --- /dev/null +++ b/go/vendor/github.com/go-openapi/runtime/text.go @@ -0,0 +1,111 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 runtime + +import ( + "bytes" + "encoding" + "errors" + "fmt" + "io" + "reflect" + + "github.com/go-openapi/swag" +) + +// TextConsumer creates a new text consumer +func TextConsumer() Consumer { + return ConsumerFunc(func(reader io.Reader, data interface{}) error { + if reader == nil { + return errors.New("TextConsumer requires a reader") // early exit + } + + buf := new(bytes.Buffer) + _, err := buf.ReadFrom(reader) + if err != nil { + return err + } + b := buf.Bytes() + + if tu, ok := data.(encoding.TextUnmarshaler); ok { + err := tu.UnmarshalText(b) + if err != nil { + return fmt.Errorf("text consumer: %v", err) + } + + return nil + } + + t := reflect.TypeOf(data) + if data != nil && t.Kind() == reflect.Ptr { + v := reflect.Indirect(reflect.ValueOf(data)) + if t.Elem().Kind() == reflect.String { + v.SetString(string(b)) + return nil + } + } + + return fmt.Errorf("%v (%T) is not supported by the TextConsumer, %s", + data, data, "can be resolved by supporting TextUnmarshaler interface") + }) +} + +// TextProducer creates a new text producer +func TextProducer() Producer { + return ProducerFunc(func(writer io.Writer, data interface{}) error { + if writer == nil { + return errors.New("TextProducer requires a writer") // early exit + } + + if data == nil { + return errors.New("no data given to produce text from") + } + + if tm, ok := data.(encoding.TextMarshaler); ok { + txt, err := tm.MarshalText() + if err != nil { + return fmt.Errorf("text producer: %v", err) + } + _, err = writer.Write(txt) + return err + } + + if str, ok := data.(error); ok { + _, err := writer.Write([]byte(str.Error())) + return err + } + + if str, ok := data.(fmt.Stringer); ok { + _, err := writer.Write([]byte(str.String())) + return err + } + + v := reflect.Indirect(reflect.ValueOf(data)) + if t := v.Type(); t.Kind() == reflect.Struct || t.Kind() == reflect.Slice { + b, err := swag.WriteJSON(data) + if err != nil { + return err + } + _, err = writer.Write(b) + return err + } + if v.Kind() != reflect.String { + return fmt.Errorf("%T is not a supported type by the TextProducer", data) + } + + _, err := writer.Write([]byte(v.String())) + return err + }) +} diff --git a/go/vendor/github.com/go-openapi/runtime/values.go b/go/vendor/github.com/go-openapi/runtime/values.go new file mode 100644 index 0000000..11f5732 --- /dev/null +++ b/go/vendor/github.com/go-openapi/runtime/values.go @@ -0,0 +1,19 @@ +package runtime + +// Values typically represent parameters on a http request. +type Values map[string][]string + +// GetOK returns the values collection for the given key. +// When the key is present in the map it will return true for hasKey. +// When the value is not empty it will return true for hasValue. +func (v Values) GetOK(key string) (value []string, hasKey bool, hasValue bool) { + value, hasKey = v[key] + if !hasKey { + return + } + if len(value) == 0 { + return + } + hasValue = true + return +} diff --git a/go/vendor/github.com/go-openapi/runtime/xml.go b/go/vendor/github.com/go-openapi/runtime/xml.go new file mode 100644 index 0000000..821c739 --- /dev/null +++ b/go/vendor/github.com/go-openapi/runtime/xml.go @@ -0,0 +1,36 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 runtime + +import ( + "encoding/xml" + "io" +) + +// XMLConsumer creates a new XML consumer +func XMLConsumer() Consumer { + return ConsumerFunc(func(reader io.Reader, data interface{}) error { + dec := xml.NewDecoder(reader) + return dec.Decode(data) + }) +} + +// XMLProducer creates a new XML producer +func XMLProducer() Producer { + return ProducerFunc(func(writer io.Writer, data interface{}) error { + enc := xml.NewEncoder(writer) + return enc.Encode(data) + }) +} diff --git a/go/vendor/github.com/go-openapi/spec/.editorconfig b/go/vendor/github.com/go-openapi/spec/.editorconfig new file mode 100644 index 0000000..3152da6 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/.editorconfig @@ -0,0 +1,26 @@ +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true + +# Set default charset +[*.{js,py,go,scala,rb,java,html,css,less,sass,md}] +charset = utf-8 + +# Tab indentation (no size specified) +[*.go] +indent_style = tab + +[*.md] +trim_trailing_whitespace = false + +# Matches the exact files either package.json or .travis.yml +[{package.json,.travis.yml}] +indent_style = space +indent_size = 2 diff --git a/go/vendor/github.com/go-openapi/spec/.gitignore b/go/vendor/github.com/go-openapi/spec/.gitignore new file mode 100644 index 0000000..dd91ed6 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/.gitignore @@ -0,0 +1,2 @@ +secrets.yml +coverage.out diff --git a/go/vendor/github.com/go-openapi/spec/.golangci.yml b/go/vendor/github.com/go-openapi/spec/.golangci.yml new file mode 100644 index 0000000..ed53e5c --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/.golangci.yml @@ -0,0 +1,21 @@ +linters-settings: + govet: + check-shadowing: true + golint: + min-confidence: 0 + gocyclo: + min-complexity: 25 + maligned: + suggest-new: true + dupl: + threshold: 100 + goconst: + min-len: 2 + min-occurrences: 2 + +linters: + enable-all: true + disable: + - maligned + - unparam + - lll diff --git a/go/vendor/github.com/go-openapi/spec/.travis.yml b/go/vendor/github.com/go-openapi/spec/.travis.yml new file mode 100644 index 0000000..a4f0348 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/.travis.yml @@ -0,0 +1,18 @@ +after_success: +- bash <(curl -s https://codecov.io/bash) +go: +- '1.9' +- 1.10.x +- 1.11.x +install: +- go get -u github.com/stretchr/testify +- go get -u github.com/go-openapi/swag +- go get -u gopkg.in/yaml.v2 +- go get -u github.com/go-openapi/jsonpointer +- go get -u github.com/go-openapi/jsonreference +language: go +notifications: + slack: + secure: QUWvCkBBK09GF7YtEvHHVt70JOkdlNBG0nIKu/5qc4/nW5HP8I2w0SEf/XR2je0eED1Qe3L/AfMCWwrEj+IUZc3l4v+ju8X8R3Lomhme0Eb0jd1MTMCuPcBT47YCj0M7RON7vXtbFfm1hFJ/jLe5+9FXz0hpXsR24PJc5ZIi/ogNwkaPqG4BmndzecpSh0vc2FJPZUD9LT0I09REY/vXR0oQAalLkW0asGD5taHZTUZq/kBpsNxaAFrLM23i4mUcf33M5fjLpvx5LRICrX/57XpBrDh2TooBU6Qj3CgoY0uPRYUmSNxbVx1czNzl2JtEpb5yjoxfVPQeg0BvQM00G8LJINISR+ohrjhkZmAqchDupAX+yFrxTtORa78CtnIL6z/aTNlgwwVD8kvL/1pFA/JWYmKDmz93mV/+6wubGzNSQCstzjkFA4/iZEKewKUoRIAi/fxyscP6L/rCpmY/4llZZvrnyTqVbt6URWpopUpH4rwYqreXAtJxJsfBJIeSmUIiDIOMGkCTvyTEW3fWGmGoqWtSHLoaWDyAIGb7azb+KvfpWtEcoPFWfSWU+LGee0A/YsUhBl7ADB9A0CJEuR8q4BPpKpfLwPKSiKSAXL7zDkyjExyhtgqbSl2jS+rKIHOZNL8JkCcTP2MKMVd563C5rC5FMKqu3S9m2b6380E= +script: +- go test -v -race -cover -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/go/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md b/go/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..9322b06 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at ivan+abuse@flanders.co.nz. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/go/vendor/github.com/go-openapi/spec/LICENSE b/go/vendor/github.com/go-openapi/spec/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/go/vendor/github.com/go-openapi/spec/README.md b/go/vendor/github.com/go-openapi/spec/README.md new file mode 100644 index 0000000..6354742 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/README.md @@ -0,0 +1,10 @@ +# OAI object model [![Build Status](https://travis-ci.org/go-openapi/spec.svg?branch=master)](https://travis-ci.org/go-openapi/spec) [![codecov](https://codecov.io/gh/go-openapi/spec/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/spec) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) + +[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/spec/master/LICENSE) +[![GoDoc](https://godoc.org/github.com/go-openapi/spec?status.svg)](http://godoc.org/github.com/go-openapi/spec) +[![GolangCI](https://golangci.com/badges/github.com/go-openapi/spec.svg)](https://golangci.com) +[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/spec)](https://goreportcard.com/report/github.com/go-openapi/spec) + +The object model for OpenAPI specification documents. + +Currently supports Swagger 2.0. diff --git a/go/vendor/github.com/go-openapi/spec/bindata.go b/go/vendor/github.com/go-openapi/spec/bindata.go new file mode 100644 index 0000000..1717ea1 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/bindata.go @@ -0,0 +1,260 @@ +// Code generated by go-bindata. +// sources: +// schemas/jsonschema-draft-04.json +// schemas/v2/schema.json +// DO NOT EDIT! + +package spec + +import ( + "bytes" + "compress/gzip" + "fmt" + "io" + "io/ioutil" + "os" + "path/filepath" + "strings" + "time" +) + +func bindataRead(data []byte, name string) ([]byte, error) { + gz, err := gzip.NewReader(bytes.NewBuffer(data)) + if err != nil { + return nil, fmt.Errorf("Read %q: %v", name, err) + } + + var buf bytes.Buffer + _, err = io.Copy(&buf, gz) + clErr := gz.Close() + + if err != nil { + return nil, fmt.Errorf("Read %q: %v", name, err) + } + if clErr != nil { + return nil, err + } + + return buf.Bytes(), nil +} + +type asset struct { + bytes []byte + info os.FileInfo +} + +type bindataFileInfo struct { + name string + size int64 + mode os.FileMode + modTime time.Time +} + +func (fi bindataFileInfo) Name() string { + return fi.name +} +func (fi bindataFileInfo) Size() int64 { + return fi.size +} +func (fi bindataFileInfo) Mode() os.FileMode { + return fi.mode +} +func (fi bindataFileInfo) ModTime() time.Time { + return fi.modTime +} +func (fi bindataFileInfo) IsDir() bool { + return false +} +func (fi bindataFileInfo) Sys() interface{} { + return nil +} + +var _jsonschemaDraft04JSON = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x57\x3d\x6f\xdb\x3c\x10\xde\xf3\x2b\x08\x26\x63\xf2\x2a\x2f\xd0\xc9\x5b\xd1\x2e\x01\x5a\x34\x43\x37\x23\x03\x6d\x9d\x6c\x06\x14\xa9\x50\x54\x60\xc3\xd0\x7f\x2f\x28\x4a\x14\x29\x91\x92\x2d\xa7\x8d\x97\x28\xbc\xaf\xe7\x8e\xf7\xc5\xd3\x0d\x42\x08\x61\x9a\xe2\x15\xc2\x7b\xa5\x8a\x55\x92\xbc\x96\x82\x3f\x94\xdb\x3d\xe4\xe4\x3f\x21\x77\x49\x2a\x49\xa6\x1e\x1e\xbf\x24\xe6\xec\x16\xdf\x1b\xa1\x3b\xf3\xff\x02\xc9\x14\xca\xad\xa4\x85\xa2\x82\x6b\xe9\x6f\x42\x02\x32\x2c\x28\x07\x45\x5a\x15\x3d\x77\x46\x39\xd5\xcc\x25\x5e\x21\x83\xb8\x21\x18\xb6\xaf\x52\x92\xa3\x47\x68\x88\xea\x58\x80\x56\x4e\x1a\xf2\xbd\x4f\xcc\x29\x7f\x52\x90\x6b\x7d\xff\x0f\x48\xb4\x3d\x3f\x21\x7c\x27\x21\xd3\x2a\x6e\x31\xaa\x2d\x53\xdd\xf3\xe3\x42\x94\x54\xd1\x77\x78\xe2\x0a\x76\x20\xe3\x20\x68\xcb\x30\x86\x41\xf3\x2a\xc7\x2b\xf4\x78\x8e\xfe\xef\x90\x91\x8a\xa9\xc7\xb1\x1d\xc2\xd8\x2f\x0d\x75\xed\xc1\x4e\x9c\xc8\x25\x43\xac\xa8\xbe\xd7\xcc\xa9\xd1\xa9\x21\xa0\x1a\xbd\x04\x61\x94\x34\x2f\x18\xfc\x3e\x16\x50\x8e\x4d\x03\x6f\x1c\x58\xdb\x48\x23\xbc\x11\x82\x01\xe1\xfa\xd3\x3a\x8e\x30\xaf\x18\x33\x7f\xf3\x8d\x39\x11\x9b\x57\xd8\x2a\xfd\x55\x2a\x49\xf9\x0e\xc7\xec\x37\xd4\x25\xf7\xec\x5c\x66\xc7\xd7\x99\xaa\xcf\x4f\x89\x8a\xd3\xb7\x0a\x3a\xaa\x92\x15\xf4\x30\x6f\x1c\xb0\xd6\x46\xe7\x98\x39\x2d\xa4\x28\x40\x2a\x3a\x88\x9e\x29\xba\x88\x37\x2d\xca\x60\x38\xfa\xba\x5b\x20\xac\xa8\x62\xb0\x4c\xd4\xaf\xda\x45\x0a\xba\x5c\x3b\xb9\xc7\x79\xc5\x14\x2d\x18\x34\x19\x1c\x51\xdb\x25\x4d\xb4\x7e\x06\x14\x38\x6c\x59\x55\xd2\x77\xf8\x69\x59\xfc\x7b\x73\xed\x93\x43\xcb\x32\x6d\x3c\x28\xdc\x1b\x9a\xd3\x62\xab\xc2\x27\xf7\x41\xc9\x08\x2b\x23\x08\xad\x13\x57\x21\x9c\xd3\x72\x0d\x42\x72\xf8\x01\x7c\xa7\xf6\x83\xce\x39\xd7\x82\x3c\x1f\x2f\xd6\x60\x1b\xa2\xdf\x35\x89\x52\x20\xe7\x73\x74\xe0\x66\x26\x64\x4e\xb4\x97\x58\xc2\x0e\x0e\xe1\x60\x92\x34\x6d\xa0\x10\xd6\xb5\x83\x61\x27\xe6\x47\xd3\x89\xbd\x63\xfd\x3b\x8d\x03\x3d\x6c\x42\x2d\x5b\x70\xee\xe8\xdf\x4b\xf4\x66\x4e\xe1\x01\x45\x17\x80\x74\xad\x4f\xc3\xf3\xae\xc6\x1d\xc6\xd7\xc2\xce\xc9\xe1\x29\x30\x86\x2f\x4a\xa6\x4b\x15\x84\x73\xc9\x6f\xfd\x7f\xa5\x6e\x9e\xbd\xf1\xb0\xd4\xdd\x45\x5a\xc2\x3e\x4b\x78\xab\xa8\x84\x74\x4a\x91\x3b\x92\x23\x05\xf2\x1c\x1e\x7b\xf3\x09\xf8\xcf\xab\x24\xb6\x60\xa2\xe8\x4c\x9f\x75\x77\xaa\x8c\xe6\x01\x45\x36\x86\xcf\xc3\x63\x3a\xea\xd4\x8d\x7e\x06\xac\x14\x0a\xe0\x29\xf0\xed\x07\x22\x1a\x65\xda\x44\xae\xa2\x73\x1a\xe6\x90\x69\xa2\x8c\x46\xb2\x2f\xde\x49\x38\x08\xed\xfe\xfd\x41\xaf\x9f\xa9\x55\xd7\xdd\x22\x8d\xfa\x45\x63\xc5\x0f\x80\xf3\xb4\x08\xd6\x79\x30\x9e\x93\xee\x59\xa6\xd0\x4b\xee\x22\xe3\x33\xc1\x3a\x27\x68\x36\x78\x7e\x87\x0a\x06\xd5\x2e\x20\xd3\xaf\x15\xfb\xd8\x3b\x73\x14\xbb\x92\xed\x05\x5d\x2e\x29\x38\x2c\x94\xe4\x42\x45\x5e\xd3\xb5\x7d\xdf\x47\xca\x38\xb4\x5c\xaf\xfb\x7d\xdd\x6d\xf4\xa1\x2d\x77\xdd\x2f\xce\x6d\xc4\x7b\x8b\x4e\x67\xa9\x6f\xfe\x04\x00\x00\xff\xff\xb1\xd1\x27\x78\x05\x11\x00\x00") + +func jsonschemaDraft04JSONBytes() ([]byte, error) { + return bindataRead( + _jsonschemaDraft04JSON, + "jsonschema-draft-04.json", + ) +} + +func jsonschemaDraft04JSON() (*asset, error) { + bytes, err := jsonschemaDraft04JSONBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "jsonschema-draft-04.json", size: 4357, mode: os.FileMode(420), modTime: time.Unix(1523760398, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _v2SchemaJSON = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5d\x4f\x93\xdb\x36\xb2\xbf\xfb\x53\xa0\x14\x57\xd9\xae\xd8\x92\xe3\xf7\x2e\xcf\x97\xd4\xbc\xd8\x49\x66\x37\x5e\x4f\x79\x26\xbb\x87\x78\x5c\x05\x91\x2d\x09\x09\x09\x30\x00\x38\x33\x5a\xef\x7c\xf7\x2d\xf0\x9f\x08\x02\x20\x41\x8a\xd2\xc8\x0e\x0f\xa9\x78\x28\xa0\xd1\xdd\x68\x34\x7e\xdd\xf8\xf7\xf9\x11\x42\x33\x49\x64\x04\xb3\xd7\x68\x76\x86\xfe\x76\xf9\xfe\x1f\xe8\x32\xd8\x40\x8c\xd1\x8a\x71\x74\x79\x8b\xd7\x6b\xe0\xe8\xd5\xfc\x25\x3a\xbb\x38\x9f\xcf\x9e\xab\x0a\x24\x54\xa5\x37\x52\x26\xaf\x17\x0b\x91\x17\x99\x13\xb6\xb8\x79\xb5\x10\x59\xdd\xf9\xef\x82\xd1\x6f\xf2\xc2\x8f\xf3\x4f\xb5\x1a\xea\xc7\x17\x45\x41\xc6\xd7\x8b\x90\xe3\x95\x7c\xf1\xf2\x7f\x8b\xca\x45\x3d\xb9\x4d\x32\xa6\xd8\xf2\x77\x08\x64\xfe\x8d\xc3\x9f\x29\xe1\xa0\x9a\xff\xed\x11\x42\x08\xcd\x8a\xd6\xb3\x9f\x15\x67\x74\xc5\xca\x7f\x27\x58\x6e\xc4\xec\x11\x42\xd7\x59\x5d\x1c\x86\x44\x12\x46\x71\x74\xc1\x59\x02\x5c\x12\x10\xb3\xd7\x68\x85\x23\x01\x59\x81\x04\x4b\x09\x9c\x6a\xbf\x7e\xce\x49\x7d\xba\x7b\x51\xfd\xa1\x44\xe2\xb0\x52\xac\x7d\xb3\x08\x61\x45\x68\x46\x56\x2c\x6e\x80\x86\x8c\xbf\xbd\x93\x40\x05\x61\x74\x96\x95\xbe\x7f\x84\xd0\x7d\x4e\xde\x42\xb7\xe4\xbe\x46\xbb\x14\x5b\x48\x4e\xe8\xba\x90\x05\xa1\x19\xd0\x34\xae\xc4\xce\xbe\xbc\x9a\xbf\x9c\x15\x7f\x5d\x57\xc5\x42\x10\x01\x27\x89\xe2\x48\x51\xb9\xda\x40\xd5\x87\x37\xc0\x15\x5f\x88\xad\x90\xdc\x10\x81\x42\x16\xa4\x31\x50\x39\x2f\x38\xad\xab\xb0\x53\xd8\xac\x94\x56\x6f\xc3\x84\xf4\x11\xa4\x50\xb3\xfa\xe9\xd3\x6f\x9f\x3e\xdf\x2f\xd0\xeb\x8f\x1f\x3f\x7e\xbc\xfe\xf6\xe9\xf7\xaf\x5f\x7f\xfc\x18\x7e\xfb\xec\xfb\xc7\xb3\x36\x79\x54\x43\xe8\x29\xc5\x31\x20\xc6\x11\x49\x9e\xe5\x12\x41\x66\xa0\xe8\xed\x1d\x8e\x93\x08\x5e\xa3\x27\x3b\xc3\x7c\xa2\x73\xba\xc4\x02\x2e\xb0\xdc\xf4\xe5\x76\xd1\xca\x96\xa2\x8a\x94\xcd\x21\xc9\x6c\xec\x2c\x70\x42\x9e\x34\x74\x9d\x19\x7c\xcd\x20\x9c\xea\x2e\x0a\xfe\x42\x84\xd4\x29\x04\x8c\x8a\xb4\x41\xa2\xc1\xdc\x19\x8a\x88\x90\x4a\x49\xef\xce\xdf\xbd\x45\x4a\x52\x81\x70\x10\x40\x22\x21\x44\xcb\x6d\xc5\xec\x4e\x3c\x1c\x45\xef\x57\x9a\xb5\x7d\xae\xfe\xe5\xe4\x31\x86\x90\xe0\xab\x6d\x02\x3b\x2e\xcb\x11\x90\xd9\xa8\xc6\x77\xc2\x59\x98\x06\xfd\xf9\x2e\x78\x45\x01\xa6\xa8\xa0\x71\x5c\xbe\x33\xa7\xd2\xd9\x5f\x95\xef\xd9\xd5\xac\xfd\xdc\x5d\xbf\x5e\xb8\xd1\x3e\xc7\x31\x48\xe0\x5e\x4c\x14\x65\xdf\xb8\xa8\x71\x10\x09\xa3\xc2\xc7\x02\xcb\xa2\x4e\x5a\x02\x82\x94\x13\xb9\xf5\x30\xe6\xb2\xa4\xb5\xfe\x9b\x3e\x7a\xb2\x55\xd2\xa8\x4a\xbc\x16\xb6\x71\x8e\x39\xc7\xdb\x9d\xe1\x10\x09\x71\xbd\x9c\xb3\x41\x89\xd7\xa5\x89\xdc\x57\xb5\x53\x4a\xfe\x4c\xe1\xbc\xa0\x21\x79\x0a\x1a\x0f\x70\xa7\x5c\x08\x8e\xde\xb0\xc0\x43\x24\xad\x74\x63\x0e\xb1\xd9\x90\xe1\xb0\x2d\x13\xa7\x6d\x78\xfd\x04\x14\x38\x8e\x90\xaa\xce\x63\xac\x3e\x23\xbc\x64\xa9\xb4\xf8\x03\x63\xde\xcd\xbe\x16\x13\x4a\x55\xac\x82\x12\xc6\xac\xd4\x35\xf7\x22\xd4\x3a\xff\x22\x73\x0e\x6e\x51\xa0\x75\x1e\xae\x8f\xe8\x5d\xc7\x59\xe6\xe4\x9a\x18\x8d\xd6\x1c\x53\x84\x4d\xb7\x67\x28\x37\x09\x84\x69\x88\x12\x0e\x01\x11\x80\x32\xa2\xf5\xb9\xaa\xc6\xd9\x73\x53\xab\xfb\xb4\x2e\x20\xc6\x54\x92\xa0\x9a\xf3\x69\x1a\x2f\x81\x77\x37\xae\x53\x1a\xce\x40\xc4\xa8\x82\x1c\xb5\xef\xda\x24\x7d\xb9\x61\x69\x14\xa2\x25\xa0\x90\xac\x56\xc0\x81\x4a\xb4\xe2\x2c\xce\x4a\x64\x7a\x9a\x23\xf4\x13\x91\x3f\xa7\x4b\xf4\x63\x84\x6f\x18\x87\x10\xbd\xc3\xfc\x8f\x90\xdd\x52\x44\x04\xc2\x51\xc4\x6e\x21\x74\x48\x21\x81\xc7\xe2\xfd\xea\x12\xf8\x0d\x09\xf6\xe9\x47\x35\xaf\x67\xc4\x14\xf7\x22\x27\x97\xe1\xe2\x76\x2d\x06\x8c\x4a\x1c\x48\x3f\x73\x2d\x0b\x5b\x29\x45\x24\x00\x2a\x0c\x11\xec\x94\xca\xc2\xa6\xc1\x37\x21\x43\x83\x3b\x5f\x97\xf1\x43\x5e\x53\x73\x19\xa5\x36\xd8\x2d\x05\x2e\x34\x0b\xeb\x39\xfc\x1d\x63\x51\x01\xbd\x3d\xbb\x90\x84\x40\x25\x59\x6d\x09\x5d\xa3\x1c\x37\xe6\x5c\x16\x9a\x40\x09\x70\xc1\xe8\x82\xf1\x35\xa6\xe4\xdf\x99\x5c\x8e\x9e\x4d\x79\xb4\x27\x2f\xbf\x7e\xf8\x05\x25\x8c\x50\xa9\x98\x29\x90\x62\x60\xea\x75\xae\x13\xca\xbf\x2b\x1a\x29\x27\x76\xd6\x20\xc6\x64\x5f\xe6\x32\x1a\x08\x87\x21\x07\x21\xbc\xb4\xe4\xe0\x32\x67\xa6\xcd\xf3\x1e\xcd\xd9\x6b\xb6\x6f\x8e\x27\xa7\xed\xdb\xe7\xbc\xcc\x1a\x07\xce\x6f\x87\x33\xf0\xba\x51\x17\x22\x66\x78\x79\x8e\xce\xe5\x13\x81\x80\x06\x2c\xe5\x78\x0d\xa1\xb2\xb8\x54\xa8\x79\x09\xbd\xbf\x3c\x47\x01\x8b\x13\x2c\xc9\x32\xaa\xaa\x1d\xd5\xee\xab\x36\xbd\x6c\xfd\x54\x6c\xc8\x08\x01\x3c\xbd\xe7\x07\x88\xb0\x24\x37\x79\x90\x28\x4a\x1d\x10\x1a\x92\x1b\x12\xa6\x38\x42\x40\xc3\x4c\x43\x62\x8e\xae\x36\xb0\x45\x71\x2a\xa4\x9a\x23\x79\x59\xb1\xa8\xf2\xa4\x0c\x60\x9f\xcc\x8d\x40\xf5\x80\xca\xa8\x99\xc3\xa7\x85\x1f\x31\x25\xa9\x82\xc5\x6d\xbd\xd8\x36\x76\x7c\x02\x28\x97\xf6\x1d\x74\x3b\x11\x7e\x91\xae\x32\xf8\x6c\xf4\xe6\x7b\x9a\xa5\x1f\x62\xc6\x21\xcf\x9a\xe5\xed\x8b\x02\xf3\x2c\x33\x33\xdf\x00\xca\xc9\x09\xb4\x04\xf5\xa5\x08\xd7\xc3\x02\x18\x66\xf1\xab\x1e\x83\x37\x4c\xcd\x12\xc1\x1d\x50\xf6\xaa\xbd\xfe\xe2\x73\x48\x38\x08\xa0\x32\x9b\x18\x44\x86\x0b\x6a\xc1\xaa\x26\x96\x2d\x96\x3c\xa0\x54\x65\x73\x87\x15\xca\x15\xe5\xf5\x94\x46\x9f\x33\x1a\x0c\x9a\xb1\x5a\xd9\x6a\x95\xcd\xcb\x7e\xec\x9a\xc5\x94\x3b\x37\x26\x31\xd7\xfc\xe4\x1f\x13\x8c\x31\x75\x9c\xba\xf7\x87\x3c\xa1\xb7\x4f\x17\x1b\x09\x82\x98\xc4\x70\x95\xd3\xe8\x4c\x48\x5a\xa6\xd6\x2a\x3d\x56\x42\x80\x9f\xaf\xae\x2e\x50\x0c\x42\xe0\x35\x34\x3c\x8a\x62\x03\x37\xba\xb2\x27\x04\xda\x25\x8d\x06\xe2\xa0\x13\x8a\xf3\xf5\xec\x10\x72\x67\x88\x90\x3d\x4b\x64\xeb\xaa\xda\x8f\xf7\x5a\x75\x47\x9a\xa8\x51\x70\x26\xd2\x38\xc6\x7c\xbb\x57\xfc\xbd\xe4\x04\x56\xa8\xa0\x54\x9a\x45\xd5\xf7\x0f\x16\xfc\x57\x1c\x3c\xdf\x23\xba\x77\x38\xda\x16\x4b\x31\x53\x6a\x4d\x9a\x15\x63\xe7\xe1\x18\x69\x9f\x22\xe0\x24\xbb\x94\x4b\x97\xee\x2d\xf9\x70\x87\x72\x7b\xe6\xc4\x33\x2a\x66\x5e\x1c\x35\x72\xe3\x2d\xda\x73\xe4\xc7\x51\x6d\xa4\xa1\x2a\x4f\xde\x94\xcb\xb2\x3e\x31\x48\xae\x82\xce\xc9\xc8\x65\xcd\xc3\xb7\x34\xb6\x2b\xdf\x58\x65\x78\x6e\x73\xac\x5e\x24\x0d\x3f\xdc\x70\x23\xc6\xda\x52\x0b\x2d\x63\x7d\xa9\x49\x2d\x54\x48\x28\xc0\x12\x9c\xe3\x63\xc9\x58\x04\x98\x36\x07\xc8\x0a\xa7\x91\xd4\xf0\xbc\xc1\xa8\xb9\x70\xd0\xc6\xa9\xb6\x78\x80\x5a\xa3\xb4\x2c\xf4\x18\x0b\x8a\x9d\xd0\xb4\x55\x10\xee\x0d\xc5\xd6\xe0\x99\x93\xdc\xa1\x04\xbb\xf1\xa7\x23\xd1\xd1\x97\x8c\x87\x13\x0a\x21\x02\xe9\x99\x25\xed\x20\xc5\x92\x66\x3c\x32\x9c\xd6\x06\xb0\x31\x5c\x86\x29\x0a\xcb\x60\x33\x12\xa5\x91\xfc\x96\x75\xd0\x59\xd7\x13\xbd\xd3\x23\x79\xdd\x2a\x90\xa6\x38\x06\x91\x39\x7f\x20\x72\x03\x1c\x2d\x01\x61\xba\x45\x37\x38\x22\x61\x8e\x71\x85\xc4\x32\x15\x28\x60\x61\x16\xb8\x3d\x29\xdc\x4d\x3d\x2f\x12\x13\x7d\xc8\x7e\x37\xee\xa8\x7f\xfa\xdb\xcb\x17\xff\x77\xfd\xf9\x7f\xee\x9f\x3d\xfe\xcf\xa7\xa7\x45\xfb\xcf\x1e\xf7\xf3\xe0\xff\xc4\x51\x0a\x8e\x4c\xcb\x01\xdc\x0a\x65\xb2\x01\x83\xed\x3d\xe4\xa9\xa3\x4e\x2d\x59\xc5\xe8\x2f\x48\x7d\x5a\x6e\x37\xbf\x5c\x9f\x35\x13\x64\x14\xfa\xef\x0b\x68\xa6\x0d\xb4\x8e\xf1\xa8\xff\xbb\x60\xf4\x03\x64\xab\x5b\x81\x65\x51\xe6\xda\xca\xfa\xf0\xb0\xac\x3e\x9c\xca\x26\x0e\x1d\xdb\x57\x5b\xbb\xb4\x9a\xa6\xb6\x9b\x1a\x6b\xd1\x9a\x9e\x7e\x33\x9a\xec\x41\x69\x45\x22\xb8\xb4\x51\xeb\x04\x77\xca\x6f\x7b\x7b\xc8\xb2\xb0\x95\x92\x25\x5b\xd0\x42\xaa\x2a\xdd\x32\x78\x4f\x0c\xab\x68\x46\x6c\xea\x6d\xf4\x5c\x5e\xde\xc4\xac\xa5\xf9\xd1\x00\x9f\x7d\x98\x65\x24\xbd\xc7\x97\xd4\xb3\x3a\xa8\x2b\xa0\x34\x76\xf9\x65\x5f\x2d\x25\x95\x1b\xcf\xd6\xf4\x9b\x5f\x09\x95\xb0\x36\x3f\xdb\xd0\x39\x2a\x93\x1c\x9d\x03\xa2\x4a\xca\xf5\xf6\x10\xb6\x94\x89\x0b\x6a\x70\x12\x13\x49\x6e\x40\xe4\x29\x12\x2b\xbd\x80\x45\x11\x04\xaa\xc2\x8f\x56\x9e\x5c\x6b\xec\x8d\x5a\x0e\x14\x59\x06\x2b\x1e\x24\xcb\xc2\x56\x4a\x31\xbe\x23\x71\x1a\xfb\x51\x2a\x0b\x3b\x1c\x48\x10\xa5\x82\xdc\xc0\xbb\x3e\x24\x8d\x5a\x76\x2e\x09\xed\xc1\x65\x51\xb8\x83\xcb\x3e\x24\x8d\x5a\x2e\x5d\xfe\x02\x74\x2d\x3d\xf1\xef\xae\xb8\x4b\xe6\x5e\xd4\xaa\xe2\x2e\x5c\x5e\xec\x0e\xf5\x5b\x0c\xcb\x0a\xbb\xa4\x3c\xf7\x1f\x2a\x55\x69\x97\x8c\x7d\x68\x95\xa5\xad\xb4\xf4\x9c\xa5\x07\xb9\x7a\x05\xbb\xad\x50\x6f\xfb\xa0\x4e\x9b\x48\x23\x49\x92\x28\x87\x19\x3e\x32\xee\xca\x3b\x46\x7e\x7f\x18\x64\xcc\xcc\x0f\x34\xe9\x36\x8b\xb7\x6c\xa8\xa5\x5b\x54\x4c\x54\x5b\x15\x3a\xf1\x6c\x2d\xfe\x96\xc8\x0d\xba\x7b\x81\x88\xc8\x23\xab\xee\x7d\x3b\x92\xa7\x60\x29\xe3\xdc\xff\xb8\x64\xe1\xf6\xa2\x5a\x59\xdc\x6f\xeb\x45\x7d\x6a\xd1\x76\x1e\xea\xb8\xf1\xfa\x14\xd3\x36\x63\xe5\xd7\xf3\xe4\xbe\x25\xbd\x5e\x05\xeb\x73\x74\xb5\x21\x2a\x2e\x4e\xa3\x30\xdf\xbf\x43\x28\x2a\xd1\xa5\x2a\x9d\x8a\xfd\x76\xd8\x8d\xbc\x67\x65\xc7\xb8\x03\x45\xec\xa3\xb0\x37\x8a\x70\x4c\x68\x91\x51\x8e\x58\x80\xed\x4a\xf3\x81\x62\xca\x96\xbb\xf1\x52\xcd\x80\xfb\xe4\x4a\x5d\x6c\xdf\x6e\x20\x4b\x80\x30\x8e\x28\x93\xf9\xe9\x8d\x8a\x6d\xd5\x59\x65\x7b\xaa\x44\x9e\xc0\xc2\xd1\x7c\x40\x26\xd6\x1a\xce\xf9\xc5\x69\x7b\x6c\xec\xc8\x71\x7b\xe5\x21\x2e\xd3\xe5\x65\x93\x91\x53\x0b\x7b\x3a\xc7\xfa\x17\x6a\x01\xa7\x33\xd0\xf4\x40\x0f\x39\x87\xda\xe4\x54\x87\x3a\xd5\xe3\xc7\xa6\x8e\x20\xd4\x11\xb2\x4e\xb1\xe9\x14\x9b\x4e\xb1\xe9\x14\x9b\xfe\x15\x63\xd3\x47\xf5\xff\x97\x38\xe9\xcf\x14\xf8\x76\x82\x49\x13\x4c\xaa\x7d\xcd\x6c\x62\x42\x49\x87\x43\x49\x19\x33\x6f\xe3\x44\x6e\x9b\xab\x8a\x3e\x86\xaa\x99\x52\x1b\x5b\x59\x33\x02\x09\xa0\x21\xa1\x6b\x84\x6b\x66\xbb\xdc\x16\x0c\xd3\x68\xab\xec\x36\x4b\xd8\x60\x8a\x40\x31\x85\x6e\x14\x57\x13\xc2\xfb\x92\x10\xde\xbf\x88\xdc\xbc\x53\x5e\x7f\x82\x7a\x13\xd4\x9b\xa0\xde\x04\xf5\x90\x01\xf5\x94\xcb\x7b\x83\x25\x9e\xd0\xde\x84\xf6\x6a\x5f\x4b\xb3\x98\x00\xdf\x04\xf8\x6c\xbc\x7f\x19\x80\xaf\xf1\x71\x45\x22\x98\x40\xe0\x04\x02\x27\x10\xd8\x29\xf5\x04\x02\xff\x4a\x20\x30\xc1\x72\xf3\x65\x02\x40\xd7\xc1\xd1\xe2\x6b\xf1\xa9\x7b\xfb\xe4\x20\xc0\x68\x9d\xd4\xb4\xd3\x96\xb5\xa6\xd1\x41\x20\xe6\x89\xc3\x48\x65\x58\x13\x84\x9c\x56\x56\x3b\x0c\xe0\x6b\x83\x5c\x13\xd2\x9a\x90\xd6\x84\xb4\x26\xa4\x85\x0c\xa4\x45\x19\xfd\xff\x63\x6c\x52\xb5\x1f\x1e\x19\x74\x3a\xcd\xb9\x69\xce\xa6\x3a\x0f\x7a\x2d\x19\xc7\x81\x14\x5d\xcb\xd5\x03\xc9\x39\xd0\xb0\xd1\xb3\xcd\xfb\x7a\x2d\x5d\x3a\x48\xe1\xfa\x2e\xe6\x81\x42\x18\x86\xd6\xc1\xbe\xb1\x23\xd3\xf7\x34\xed\x19\x0a\x0b\xc4\x48\x44\xfd\x22\x50\xb6\x42\x58\xbb\xe5\x3d\xa7\x73\xd4\x8b\xc4\x8c\x70\x61\xec\x73\xee\xc3\x81\x8b\xf5\xe2\xd7\x52\x3e\xcf\xeb\xeb\x17\x3b\x71\x16\xda\x7d\xb8\xde\xf0\x7a\x8f\x06\x2d\xa7\x40\x7b\xc1\x9d\x41\x4d\xb6\x61\xa2\x4e\x9f\x3d\xa0\xc5\xae\xe3\x1c\x1d\x40\x6c\x48\x8b\x63\xa0\xb5\x01\xed\x8e\x02\xe9\x86\xc8\x3b\x06\xee\xdb\x4b\xde\xbd\xc0\xa1\x6f\xcb\xda\xfc\xc2\x44\x16\x87\x9c\x17\x31\xd3\x30\x20\x39\x42\xcb\x6f\xf2\xf1\xf4\x72\x10\xf8\x1c\xa0\xf3\xbd\x10\xea\x21\x35\x7d\xe8\x86\xdb\x15\xed\x81\x81\x07\x28\xbb\x13\x28\xc7\xf8\xce\x7d\x8d\xc2\x31\xb4\x7e\x94\xd6\xdb\x55\xef\x4a\xfb\xed\xc3\x40\x3e\xeb\x9f\xe9\x99\x0f\xdf\x08\x65\x88\x27\x73\x86\x31\x9d\x47\xdf\x55\x19\xba\x3d\xee\x15\x0a\xcd\x8c\xaa\x5e\xb9\xf6\x57\x33\x73\x5a\xa1\x89\x7b\x3b\xa0\xb2\xa4\xc2\xf6\xc1\x53\xb5\x00\xca\x23\xe5\xf4\x60\x6a\xb4\x2d\x74\xea\x4e\xed\x3b\xe3\x47\xfb\xed\x82\x3d\x19\xd4\x3b\x6b\xaf\xae\x2b\x2f\x57\xb3\x82\x68\xcb\xed\x88\x2e\xe1\x5c\xd7\x26\xfa\x0a\x65\xe7\xce\x11\x33\xb4\xdd\x66\xe3\x37\xf6\xfa\x70\xd6\x4f\xa1\x21\x51\xd8\x3c\x26\x14\x4b\xc6\x87\x44\x27\x1c\x70\xf8\x9e\x46\xce\xab\x21\x07\x5f\xc1\x76\x17\x1b\x77\xb4\xda\x75\xa0\x0a\x3a\x30\xe1\xf8\x97\x32\x16\x2b\x00\x75\x85\xee\x62\x46\xef\xd3\x85\xb5\x6b\x60\xbe\xf2\x30\x7a\x8c\x0b\x4b\xa6\xd0\xf9\x64\x42\xe7\x07\x41\x41\xe3\x2c\x5d\xf9\x6d\xe9\x39\x98\x3b\x3b\x5d\x67\xd4\x5c\xed\xf2\xf0\x48\x7b\xbd\x2d\x31\xdd\x3f\x34\xad\x44\x76\x51\x9a\x56\x22\xa7\x95\xc8\x69\x25\xf2\xe1\x56\x22\x1f\x00\x32\x6a\x73\x92\xed\xe1\xc6\x7d\x9f\x49\x2c\x69\x7e\xc8\x31\x4c\x0c\xb4\xf2\x54\x3b\x79\x3b\x9e\x4d\xb4\xd1\x18\x3e\x5f\x9a\x93\xa2\x11\xc3\xda\x27\x0b\xaf\x37\x2e\x5c\x37\xfb\xeb\x9a\xd6\xc3\xac\xc3\xcc\xf8\x1e\x5b\x9d\xac\x22\x64\xb7\xed\x26\xb8\xf3\xb9\x3c\xbb\x1f\xe2\xb0\x22\x77\x43\x6a\x62\x29\x39\x59\xa6\xe6\xe5\xcd\x7b\x83\xc0\x5b\x8e\x93\x64\xac\xeb\xca\x4f\x65\xac\x4a\xbc\x1e\xcd\x82\xfa\x3c\x70\x36\xb6\xb5\xed\x79\xef\xec\x68\x00\xff\x54\xfa\xb5\xe3\xf1\xdb\xe1\xbe\xce\x76\x17\xaf\x57\xb6\x6b\x89\x05\x09\xce\x52\xb9\x01\x2a\x49\xbe\xd9\xf4\xd2\xb8\x7a\xbf\x91\x02\xf3\x22\x8c\x13\xf2\x77\xd8\x8e\x43\x8b\xe1\x54\x6e\x5e\x9d\xc7\x49\x44\x02\x22\xc7\xa4\x79\x81\x85\xb8\x65\x3c\x1c\x93\xe6\x59\xa2\xf8\x1c\x51\x95\x05\xd9\x20\x00\x21\x7e\x60\x21\x58\xa9\x56\xff\xbe\xb6\x5a\x5e\x5b\x3f\x1f\xd6\xd3\x3c\xc4\x4d\xba\x99\xb4\x63\x6e\x7d\x3e\x3d\x57\xd2\x18\x5f\x47\xe8\xc3\x06\x8a\x68\x6c\x7f\x3b\x72\x0f\xe7\xe2\x77\x77\xf1\xd0\x99\xab\xdf\x2e\xfe\xd6\xbb\xcd\x1a\xb9\x90\xd1\xaf\xf2\x38\x3d\xdb\x74\xf8\xeb\xe3\xda\xe8\x2a\x62\xb7\xda\x1b\x07\xa9\xdc\x30\x5e\xbc\x68\xfb\x6b\x9f\x97\xf1\xc6\xb1\xd8\x5c\x29\x1e\x49\x30\xc5\xf7\xde\xad\x91\x42\xf9\xdd\xed\x89\x80\x25\xbe\x37\xd7\xe7\x32\x5c\xe6\x35\xac\xd4\x0c\x2d\xf7\x90\xc4\xe3\xf5\xe3\x2f\x7f\x54\x18\x88\xe3\x61\x47\x85\x64\x7f\xc0\xd7\x3f\x1a\x92\x42\xe9\xc7\x1e\x0d\x95\x76\xa7\x51\xa0\x8f\x02\x1b\x46\x9e\x06\x42\xd1\xf2\x01\x07\x02\xde\xe9\x7d\x1a\x0b\xa7\x32\x16\xcc\xc0\xee\xc4\x90\xd2\x5f\x6f\x98\x54\x5d\xf2\x95\xe1\xa7\x69\x10\x3a\x06\xe1\x65\xb3\x17\x47\x58\x78\xd0\x45\xd6\x5b\xd5\x5f\x25\x1d\x71\x49\xa6\x7a\x64\xda\xd0\x6f\xc7\x3a\x4c\xe3\x09\xc0\x6e\x96\x2c\xa7\xa7\x77\x34\x10\x05\x08\x21\x44\x92\x65\x77\xdf\x20\x5c\xbc\xe7\x97\x3f\xf4\x1a\x45\xd6\xe7\x27\x4a\xde\x74\x27\x66\x11\x7d\x70\xba\xd3\x78\xf9\x1e\x0d\xca\xc8\x39\xde\x7c\xb3\xa6\xe1\xbc\xd7\xc1\x6a\x6f\xb3\x0e\x52\xbe\xe4\x98\x8a\x15\x70\x94\x70\x26\x59\xc0\xa2\xf2\x1c\xfb\xd9\xc5\xf9\xbc\xd5\x92\x9c\xa3\xdf\xe6\x1e\xb3\x0d\x49\xba\x87\x50\x5f\x84\xfe\xe9\xd6\xf8\xbb\xe6\xf0\x7a\xeb\xa6\x65\x3b\x86\x8b\x79\x93\xf5\x59\x20\x6e\xb4\xa7\x44\xf4\x3f\xa5\xfe\x67\x42\x12\xdb\xd3\xe7\xbb\xa5\xa3\x8c\x5c\x2b\x97\xbb\xbb\x7f\x8e\xc5\x6e\xed\x43\x5c\xbf\x74\xc8\x8f\xff\xe6\xd6\xbe\x91\xb6\xf5\x95\xe4\xed\x93\xc4\xa8\x5b\xf9\x76\x4d\x35\xb7\xd8\x8c\xb6\x7d\xaf\x72\xe0\xb6\xbd\x01\x63\x9e\x76\xab\x1a\x32\x76\xe4\x8c\x76\xc2\xad\x6c\xa2\x65\xf7\xcf\xf8\xa7\xda\x2a\xb9\x8c\x3d\x3c\xa3\x9d\x64\x33\xe5\x1a\xb5\x2d\xfb\x86\xa2\x5a\x7f\x19\x5b\x7f\xc6\x3f\xd1\x53\xd3\xe2\x41\x5b\xd3\x4f\xf0\xec\xb0\x42\x73\x43\xd2\x68\x27\xd3\x6a\x6a\x34\xf6\x4e\x1e\x52\x8b\x87\x6c\xcc\xae\x44\xfb\x9e\xa7\x51\x4f\x9d\x55\x03\x81\x8e\x67\xfc\xb4\x69\xf0\x3a\x18\xf2\x40\xd0\xf6\xa8\x34\xe3\xc9\x98\xaf\xf6\xda\x24\xd3\xeb\x60\xb9\x0e\xd3\x1f\xa9\xff\xee\x1f\xfd\x37\x00\x00\xff\xff\x69\x5d\x0a\x6a\x39\x9d\x00\x00") + +func v2SchemaJSONBytes() ([]byte, error) { + return bindataRead( + _v2SchemaJSON, + "v2/schema.json", + ) +} + +func v2SchemaJSON() (*asset, error) { + bytes, err := v2SchemaJSONBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "v2/schema.json", size: 40249, mode: os.FileMode(420), modTime: time.Unix(1523760397, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +// Asset loads and returns the asset for the given name. +// It returns an error if the asset could not be found or +// could not be loaded. +func Asset(name string) ([]byte, error) { + cannonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[cannonicalName]; ok { + a, err := f() + if err != nil { + return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) + } + return a.bytes, nil + } + return nil, fmt.Errorf("Asset %s not found", name) +} + +// MustAsset is like Asset but panics when Asset would return an error. +// It simplifies safe initialization of global variables. +func MustAsset(name string) []byte { + a, err := Asset(name) + if err != nil { + panic("asset: Asset(" + name + "): " + err.Error()) + } + + return a +} + +// AssetInfo loads and returns the asset info for the given name. +// It returns an error if the asset could not be found or +// could not be loaded. +func AssetInfo(name string) (os.FileInfo, error) { + cannonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[cannonicalName]; ok { + a, err := f() + if err != nil { + return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) + } + return a.info, nil + } + return nil, fmt.Errorf("AssetInfo %s not found", name) +} + +// AssetNames returns the names of the assets. +func AssetNames() []string { + names := make([]string, 0, len(_bindata)) + for name := range _bindata { + names = append(names, name) + } + return names +} + +// _bindata is a table, holding each asset generator, mapped to its name. +var _bindata = map[string]func() (*asset, error){ + "jsonschema-draft-04.json": jsonschemaDraft04JSON, + "v2/schema.json": v2SchemaJSON, +} + +// AssetDir returns the file names below a certain +// directory embedded in the file by go-bindata. +// For example if you run go-bindata on data/... and data contains the +// following hierarchy: +// data/ +// foo.txt +// img/ +// a.png +// b.png +// then AssetDir("data") would return []string{"foo.txt", "img"} +// AssetDir("data/img") would return []string{"a.png", "b.png"} +// AssetDir("foo.txt") and AssetDir("notexist") would return an error +// AssetDir("") will return []string{"data"}. +func AssetDir(name string) ([]string, error) { + node := _bintree + if len(name) != 0 { + cannonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(cannonicalName, "/") + for _, p := range pathList { + node = node.Children[p] + if node == nil { + return nil, fmt.Errorf("Asset %s not found", name) + } + } + } + if node.Func != nil { + return nil, fmt.Errorf("Asset %s not found", name) + } + rv := make([]string, 0, len(node.Children)) + for childName := range node.Children { + rv = append(rv, childName) + } + return rv, nil +} + +type bintree struct { + Func func() (*asset, error) + Children map[string]*bintree +} + +var _bintree = &bintree{nil, map[string]*bintree{ + "jsonschema-draft-04.json": &bintree{jsonschemaDraft04JSON, map[string]*bintree{}}, + "v2": &bintree{nil, map[string]*bintree{ + "schema.json": &bintree{v2SchemaJSON, map[string]*bintree{}}, + }}, +}} + +// RestoreAsset restores an asset under the given directory +func RestoreAsset(dir, name string) error { + data, err := Asset(name) + if err != nil { + return err + } + info, err := AssetInfo(name) + if err != nil { + return err + } + err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) + if err != nil { + return err + } + err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) + if err != nil { + return err + } + err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) + if err != nil { + return err + } + return nil +} + +// RestoreAssets restores an asset under the given directory recursively +func RestoreAssets(dir, name string) error { + children, err := AssetDir(name) + // File + if err != nil { + return RestoreAsset(dir, name) + } + // Dir + for _, child := range children { + err = RestoreAssets(dir, filepath.Join(name, child)) + if err != nil { + return err + } + } + return nil +} + +func _filePath(dir, name string) string { + cannonicalName := strings.Replace(name, "\\", "/", -1) + return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) +} diff --git a/go/vendor/github.com/go-openapi/spec/contact_info.go b/go/vendor/github.com/go-openapi/spec/contact_info.go new file mode 100644 index 0000000..f285970 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/contact_info.go @@ -0,0 +1,24 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +// ContactInfo contact information for the exposed API. +// +// For more information: http://goo.gl/8us55a#contactObject +type ContactInfo struct { + Name string `json:"name,omitempty"` + URL string `json:"url,omitempty"` + Email string `json:"email,omitempty"` +} diff --git a/go/vendor/github.com/go-openapi/spec/debug.go b/go/vendor/github.com/go-openapi/spec/debug.go new file mode 100644 index 0000000..7edb95a --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/debug.go @@ -0,0 +1,47 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import ( + "fmt" + "log" + "os" + "path/filepath" + "runtime" +) + +var ( + // Debug is true when the SWAGGER_DEBUG env var is not empty. + // It enables a more verbose logging of validators. + Debug = os.Getenv("SWAGGER_DEBUG") != "" + // validateLogger is a debug logger for this package + specLogger *log.Logger +) + +func init() { + debugOptions() +} + +func debugOptions() { + specLogger = log.New(os.Stdout, "spec:", log.LstdFlags) +} + +func debugLog(msg string, args ...interface{}) { + // A private, trivial trace logger, based on go-openapi/spec/expander.go:debugLog() + if Debug { + _, file1, pos1, _ := runtime.Caller(1) + specLogger.Printf("%s:%d: %s", filepath.Base(file1), pos1, fmt.Sprintf(msg, args...)) + } +} diff --git a/go/vendor/github.com/go-openapi/spec/expander.go b/go/vendor/github.com/go-openapi/spec/expander.go new file mode 100644 index 0000000..456a9dd --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/expander.go @@ -0,0 +1,1227 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import ( + "encoding/json" + "fmt" + "log" + "net/url" + "os" + "path" + "path/filepath" + "reflect" + "strings" + "sync" + + "github.com/go-openapi/jsonpointer" + "github.com/go-openapi/swag" +) + +// ExpandOptions provides options for expand. +type ExpandOptions struct { + RelativeBase string + SkipSchemas bool + ContinueOnError bool + AbsoluteCircularRef bool +} + +// ResolutionCache a cache for resolving urls +type ResolutionCache interface { + Get(string) (interface{}, bool) + Set(string, interface{}) +} + +type simpleCache struct { + lock sync.RWMutex + store map[string]interface{} +} + +var resCache ResolutionCache + +func init() { + resCache = initResolutionCache() +} + +// initResolutionCache initializes the URI resolution cache +func initResolutionCache() ResolutionCache { + return &simpleCache{store: map[string]interface{}{ + "http://swagger.io/v2/schema.json": MustLoadSwagger20Schema(), + "http://json-schema.org/draft-04/schema": MustLoadJSONSchemaDraft04(), + }} +} + +// resolverContext allows to share a context during spec processing. +// At the moment, it just holds the index of circular references found. +type resolverContext struct { + // circulars holds all visited circular references, which allows shortcuts. + // NOTE: this is not just a performance improvement: it is required to figure out + // circular references which participate several cycles. + // This structure is privately instantiated and needs not be locked against + // concurrent access, unless we chose to implement a parallel spec walking. + circulars map[string]bool + basePath string +} + +func newResolverContext(originalBasePath string) *resolverContext { + return &resolverContext{ + circulars: make(map[string]bool), + basePath: originalBasePath, // keep the root base path in context + } +} + +// Get retrieves a cached URI +func (s *simpleCache) Get(uri string) (interface{}, bool) { + debugLog("getting %q from resolution cache", uri) + s.lock.RLock() + v, ok := s.store[uri] + debugLog("got %q from resolution cache: %t", uri, ok) + + s.lock.RUnlock() + return v, ok +} + +// Set caches a URI +func (s *simpleCache) Set(uri string, data interface{}) { + s.lock.Lock() + s.store[uri] = data + s.lock.Unlock() +} + +// ResolveRefWithBase resolves a reference against a context root with preservation of base path +func ResolveRefWithBase(root interface{}, ref *Ref, opts *ExpandOptions) (*Schema, error) { + resolver, err := defaultSchemaLoader(root, opts, nil, nil) + if err != nil { + return nil, err + } + specBasePath := "" + if opts != nil && opts.RelativeBase != "" { + specBasePath, _ = absPath(opts.RelativeBase) + } + + result := new(Schema) + if err := resolver.Resolve(ref, result, specBasePath); err != nil { + return nil, err + } + return result, nil +} + +// ResolveRef resolves a reference against a context root +// ref is guaranteed to be in root (no need to go to external files) +// ResolveRef is ONLY called from the code generation module +func ResolveRef(root interface{}, ref *Ref) (*Schema, error) { + res, _, err := ref.GetPointer().Get(root) + if err != nil { + panic(err) + } + switch sch := res.(type) { + case Schema: + return &sch, nil + case *Schema: + return sch, nil + case map[string]interface{}: + b, _ := json.Marshal(sch) + newSch := new(Schema) + _ = json.Unmarshal(b, newSch) + return newSch, nil + default: + return nil, fmt.Errorf("unknown type for the resolved reference") + } +} + +// ResolveParameter resolves a parameter reference against a context root +func ResolveParameter(root interface{}, ref Ref) (*Parameter, error) { + return ResolveParameterWithBase(root, ref, nil) +} + +// ResolveParameterWithBase resolves a parameter reference against a context root and base path +func ResolveParameterWithBase(root interface{}, ref Ref, opts *ExpandOptions) (*Parameter, error) { + resolver, err := defaultSchemaLoader(root, opts, nil, nil) + if err != nil { + return nil, err + } + + result := new(Parameter) + if err := resolver.Resolve(&ref, result, ""); err != nil { + return nil, err + } + return result, nil +} + +// ResolveResponse resolves response a reference against a context root +func ResolveResponse(root interface{}, ref Ref) (*Response, error) { + return ResolveResponseWithBase(root, ref, nil) +} + +// ResolveResponseWithBase resolves response a reference against a context root and base path +func ResolveResponseWithBase(root interface{}, ref Ref, opts *ExpandOptions) (*Response, error) { + resolver, err := defaultSchemaLoader(root, opts, nil, nil) + if err != nil { + return nil, err + } + + result := new(Response) + if err := resolver.Resolve(&ref, result, ""); err != nil { + return nil, err + } + return result, nil +} + +// ResolveItems resolves header and parameter items reference against a context root and base path +func ResolveItems(root interface{}, ref Ref, opts *ExpandOptions) (*Items, error) { + resolver, err := defaultSchemaLoader(root, opts, nil, nil) + if err != nil { + return nil, err + } + basePath := "" + if opts.RelativeBase != "" { + basePath = opts.RelativeBase + } + result := new(Items) + if err := resolver.Resolve(&ref, result, basePath); err != nil { + return nil, err + } + return result, nil +} + +// ResolvePathItem resolves response a path item against a context root and base path +func ResolvePathItem(root interface{}, ref Ref, opts *ExpandOptions) (*PathItem, error) { + resolver, err := defaultSchemaLoader(root, opts, nil, nil) + if err != nil { + return nil, err + } + basePath := "" + if opts.RelativeBase != "" { + basePath = opts.RelativeBase + } + result := new(PathItem) + if err := resolver.Resolve(&ref, result, basePath); err != nil { + return nil, err + } + return result, nil +} + +type schemaLoader struct { + root interface{} + options *ExpandOptions + cache ResolutionCache + context *resolverContext + loadDoc func(string) (json.RawMessage, error) +} + +var idPtr, _ = jsonpointer.New("/id") +var refPtr, _ = jsonpointer.New("/$ref") + +// PathLoader function to use when loading remote refs +var PathLoader func(string) (json.RawMessage, error) + +func init() { + PathLoader = func(path string) (json.RawMessage, error) { + data, err := swag.LoadFromFileOrHTTP(path) + if err != nil { + return nil, err + } + return json.RawMessage(data), nil + } +} + +func defaultSchemaLoader( + root interface{}, + expandOptions *ExpandOptions, + cache ResolutionCache, + context *resolverContext) (*schemaLoader, error) { + + if cache == nil { + cache = resCache + } + if expandOptions == nil { + expandOptions = &ExpandOptions{} + } + absBase, _ := absPath(expandOptions.RelativeBase) + if context == nil { + context = newResolverContext(absBase) + } + return &schemaLoader{ + root: root, + options: expandOptions, + cache: cache, + context: context, + loadDoc: func(path string) (json.RawMessage, error) { + debugLog("fetching document at %q", path) + return PathLoader(path) + }, + }, nil +} + +func idFromNode(node interface{}) (*Ref, error) { + if idValue, _, err := idPtr.Get(node); err == nil { + if refStr, ok := idValue.(string); ok && refStr != "" { + idRef, err := NewRef(refStr) + if err != nil { + return nil, err + } + return &idRef, nil + } + } + return nil, nil +} + +func nextRef(startingNode interface{}, startingRef *Ref, ptr *jsonpointer.Pointer) *Ref { + if startingRef == nil { + return nil + } + + if ptr == nil { + return startingRef + } + + ret := startingRef + var idRef *Ref + node := startingNode + + for _, tok := range ptr.DecodedTokens() { + node, _, _ = jsonpointer.GetForToken(node, tok) + if node == nil { + break + } + + idRef, _ = idFromNode(node) + if idRef != nil { + nw, err := ret.Inherits(*idRef) + if err != nil { + break + } + ret = nw + } + + refRef, _, _ := refPtr.Get(node) + if refRef != nil { + var rf Ref + switch value := refRef.(type) { + case string: + rf, _ = NewRef(value) + } + nw, err := ret.Inherits(rf) + if err != nil { + break + } + nwURL := nw.GetURL() + if nwURL.Scheme == "file" || (nwURL.Scheme == "" && nwURL.Host == "") { + nwpt := filepath.ToSlash(nwURL.Path) + if filepath.IsAbs(nwpt) { + _, err := os.Stat(nwpt) + if err != nil { + nwURL.Path = filepath.Join(".", nwpt) + } + } + } + + ret = nw + } + + } + + return ret +} + +// normalize absolute path for cache. +// on Windows, drive letters should be converted to lower as scheme in net/url.URL +func normalizeAbsPath(path string) string { + u, err := url.Parse(path) + if err != nil { + debugLog("normalize absolute path failed: %s", err) + return path + } + return u.String() +} + +// base or refPath could be a file path or a URL +// given a base absolute path and a ref path, return the absolute path of refPath +// 1) if refPath is absolute, return it +// 2) if refPath is relative, join it with basePath keeping the scheme, hosts, and ports if exists +// base could be a directory or a full file path +func normalizePaths(refPath, base string) string { + refURL, _ := url.Parse(refPath) + if path.IsAbs(refURL.Path) || filepath.IsAbs(refPath) { + // refPath is actually absolute + if refURL.Host != "" { + return refPath + } + parts := strings.Split(refPath, "#") + result := filepath.FromSlash(parts[0]) + if len(parts) == 2 { + result += "#" + parts[1] + } + return result + } + + // relative refPath + baseURL, _ := url.Parse(base) + if !strings.HasPrefix(refPath, "#") { + // combining paths + if baseURL.Host != "" { + baseURL.Path = path.Join(path.Dir(baseURL.Path), refURL.Path) + } else { // base is a file + newBase := fmt.Sprintf("%s#%s", filepath.Join(filepath.Dir(base), filepath.FromSlash(refURL.Path)), refURL.Fragment) + return newBase + } + + } + // copying fragment from ref to base + baseURL.Fragment = refURL.Fragment + return baseURL.String() +} + +// denormalizePaths returns to simplest notation on file $ref, +// i.e. strips the absolute path and sets a path relative to the base path. +// +// This is currently used when we rewrite ref after a circular ref has been detected +func denormalizeFileRef(ref *Ref, relativeBase, originalRelativeBase string) *Ref { + debugLog("denormalizeFileRef for: %s", ref.String()) + + if ref.String() == "" || ref.IsRoot() || ref.HasFragmentOnly { + return ref + } + // strip relativeBase from URI + relativeBaseURL, _ := url.Parse(relativeBase) + relativeBaseURL.Fragment = "" + + if relativeBaseURL.IsAbs() && strings.HasPrefix(ref.String(), relativeBase) { + // this should work for absolute URI (e.g. http://...): we have an exact match, just trim prefix + r, _ := NewRef(strings.TrimPrefix(ref.String(), relativeBase)) + return &r + } + + if relativeBaseURL.IsAbs() { + // other absolute URL get unchanged (i.e. with a non-empty scheme) + return ref + } + + // for relative file URIs: + originalRelativeBaseURL, _ := url.Parse(originalRelativeBase) + originalRelativeBaseURL.Fragment = "" + if strings.HasPrefix(ref.String(), originalRelativeBaseURL.String()) { + // the resulting ref is in the expanded spec: return a local ref + r, _ := NewRef(strings.TrimPrefix(ref.String(), originalRelativeBaseURL.String())) + return &r + } + + // check if we may set a relative path, considering the original base path for this spec. + // Example: + // spec is located at /mypath/spec.json + // my normalized ref points to: /mypath/item.json#/target + // expected result: item.json#/target + parts := strings.Split(ref.String(), "#") + relativePath, err := filepath.Rel(path.Dir(originalRelativeBaseURL.String()), parts[0]) + if err != nil { + // there is no common ancestor (e.g. different drives on windows) + // leaves the ref unchanged + return ref + } + if len(parts) == 2 { + relativePath += "#" + parts[1] + } + r, _ := NewRef(relativePath) + return &r +} + +// relativeBase could be an ABSOLUTE file path or an ABSOLUTE URL +func normalizeFileRef(ref *Ref, relativeBase string) *Ref { + // This is important for when the reference is pointing to the root schema + if ref.String() == "" { + r, _ := NewRef(relativeBase) + return &r + } + + debugLog("normalizing %s against %s", ref.String(), relativeBase) + + s := normalizePaths(ref.String(), relativeBase) + r, _ := NewRef(s) + return &r +} + +func (r *schemaLoader) resolveRef(ref *Ref, target interface{}, basePath string) error { + tgt := reflect.ValueOf(target) + if tgt.Kind() != reflect.Ptr { + return fmt.Errorf("resolve ref: target needs to be a pointer") + } + + refURL := ref.GetURL() + if refURL == nil { + return nil + } + + var res interface{} + var data interface{} + var err error + // Resolve against the root if it isn't nil, and if ref is pointing at the root, or has a fragment only which means + // it is pointing somewhere in the root. + root := r.root + if (ref.IsRoot() || ref.HasFragmentOnly) && root == nil && basePath != "" { + if baseRef, erb := NewRef(basePath); erb == nil { + root, _, _, _ = r.load(baseRef.GetURL()) + } + } + if (ref.IsRoot() || ref.HasFragmentOnly) && root != nil { + data = root + } else { + baseRef := normalizeFileRef(ref, basePath) + debugLog("current ref is: %s", ref.String()) + debugLog("current ref normalized file: %s", baseRef.String()) + data, _, _, err = r.load(baseRef.GetURL()) + if err != nil { + return err + } + } + + res = data + if ref.String() != "" { + res, _, err = ref.GetPointer().Get(data) + if err != nil { + return err + } + } + if err := swag.DynamicJSONToStruct(res, target); err != nil { + return err + } + + return nil +} + +func (r *schemaLoader) load(refURL *url.URL) (interface{}, url.URL, bool, error) { + debugLog("loading schema from url: %s", refURL) + toFetch := *refURL + toFetch.Fragment = "" + + normalized := normalizeAbsPath(toFetch.String()) + + data, fromCache := r.cache.Get(normalized) + if !fromCache { + b, err := r.loadDoc(normalized) + if err != nil { + return nil, url.URL{}, false, err + } + + if err := json.Unmarshal(b, &data); err != nil { + return nil, url.URL{}, false, err + } + r.cache.Set(normalized, data) + } + + return data, toFetch, fromCache, nil +} + +// Resolve resolves a reference against basePath and stores the result in target +// Resolve is not in charge of following references, it only resolves ref by following its URL +// if the schema that ref is referring to has more refs in it. Resolve doesn't resolve them +// if basePath is an empty string, ref is resolved against the root schema stored in the schemaLoader struct +func (r *schemaLoader) Resolve(ref *Ref, target interface{}, basePath string) error { + return r.resolveRef(ref, target, basePath) +} + +// absPath returns the absolute path of a file +func absPath(fname string) (string, error) { + if strings.HasPrefix(fname, "http") { + return fname, nil + } + if filepath.IsAbs(fname) { + return fname, nil + } + wd, err := os.Getwd() + return filepath.Join(wd, fname), err +} + +// ExpandSpec expands the references in a swagger spec +func ExpandSpec(spec *Swagger, options *ExpandOptions) error { + resolver, err := defaultSchemaLoader(spec, options, nil, nil) + // Just in case this ever returns an error. + if shouldStopOnError(err, resolver.options) { + return err + } + + // getting the base path of the spec to adjust all subsequent reference resolutions + specBasePath := "" + if options != nil && options.RelativeBase != "" { + specBasePath, _ = absPath(options.RelativeBase) + } + + if options == nil || !options.SkipSchemas { + for key, definition := range spec.Definitions { + var def *Schema + var err error + if def, err = expandSchema(definition, []string{fmt.Sprintf("#/definitions/%s", key)}, resolver, specBasePath); shouldStopOnError(err, resolver.options) { + return err + } + if def != nil { + spec.Definitions[key] = *def + } + } + } + + for key, parameter := range spec.Parameters { + if err := expandParameter(¶meter, resolver, specBasePath); shouldStopOnError(err, resolver.options) { + return err + } + spec.Parameters[key] = parameter + } + + for key, response := range spec.Responses { + if err := expandResponse(&response, resolver, specBasePath); shouldStopOnError(err, resolver.options) { + return err + } + spec.Responses[key] = response + } + + if spec.Paths != nil { + for key, path := range spec.Paths.Paths { + if err := expandPathItem(&path, resolver, specBasePath); shouldStopOnError(err, resolver.options) { + return err + } + spec.Paths.Paths[key] = path + } + } + + return nil +} + +func shouldStopOnError(err error, opts *ExpandOptions) bool { + if err != nil && !opts.ContinueOnError { + return true + } + + if err != nil { + log.Println(err) + } + + return false +} + +// baseForRoot loads in the cache the root document and produces a fake "root" base path entry +// for further $ref resolution +func baseForRoot(root interface{}, cache ResolutionCache) string { + // cache the root document to resolve $ref's + const rootBase = "root" + if root != nil { + base, _ := absPath(rootBase) + normalizedBase := normalizeAbsPath(base) + debugLog("setting root doc in cache at: %s", normalizedBase) + if cache == nil { + cache = resCache + } + cache.Set(normalizedBase, root) + return rootBase + } + return "" +} + +// ExpandSchema expands the refs in the schema object with reference to the root object +// go-openapi/validate uses this function +// notice that it is impossible to reference a json schema in a different file other than root +func ExpandSchema(schema *Schema, root interface{}, cache ResolutionCache) error { + opts := &ExpandOptions{ + // when a root is specified, cache the root as an in-memory document for $ref retrieval + RelativeBase: baseForRoot(root, cache), + SkipSchemas: false, + ContinueOnError: false, + // when no base path is specified, remaining $ref (circular) are rendered with an absolute path + AbsoluteCircularRef: true, + } + return ExpandSchemaWithBasePath(schema, cache, opts) +} + +// ExpandSchemaWithBasePath expands the refs in the schema object, base path configured through expand options +func ExpandSchemaWithBasePath(schema *Schema, cache ResolutionCache, opts *ExpandOptions) error { + if schema == nil { + return nil + } + + var basePath string + if opts.RelativeBase != "" { + basePath, _ = absPath(opts.RelativeBase) + } + + resolver, err := defaultSchemaLoader(nil, opts, cache, nil) + if err != nil { + return err + } + + refs := []string{""} + var s *Schema + if s, err = expandSchema(*schema, refs, resolver, basePath); err != nil { + return err + } + *schema = *s + return nil +} + +func expandItems(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { + if target.Items != nil { + if target.Items.Schema != nil { + t, err := expandSchema(*target.Items.Schema, parentRefs, resolver, basePath) + if err != nil { + return nil, err + } + *target.Items.Schema = *t + } + for i := range target.Items.Schemas { + t, err := expandSchema(target.Items.Schemas[i], parentRefs, resolver, basePath) + if err != nil { + return nil, err + } + target.Items.Schemas[i] = *t + } + } + return &target, nil +} + +// basePathFromSchemaID returns a new basePath based on an existing basePath and a schema ID +func basePathFromSchemaID(oldBasePath, id string) string { + u, err := url.Parse(oldBasePath) + if err != nil { + panic(err) + } + uid, err := url.Parse(id) + if err != nil { + panic(err) + } + + if path.IsAbs(uid.Path) { + return id + } + u.Path = path.Join(path.Dir(u.Path), uid.Path) + return u.String() +} + +// isCircular detects cycles in sequences of $ref. +// It relies on a private context (which needs not be locked). +func (r *schemaLoader) isCircular(ref *Ref, basePath string, parentRefs ...string) (foundCycle bool) { + normalizedRef := normalizePaths(ref.String(), basePath) + if _, ok := r.context.circulars[normalizedRef]; ok { + // circular $ref has been already detected in another explored cycle + foundCycle = true + return + } + foundCycle = swag.ContainsStringsCI(parentRefs, normalizedRef) + if foundCycle { + r.context.circulars[normalizedRef] = true + } + return +} + +func updateBasePath(transitive *schemaLoader, resolver *schemaLoader, basePath string) string { + if transitive != resolver { + debugLog("got a new resolver") + if transitive.options != nil && transitive.options.RelativeBase != "" { + basePath, _ = absPath(transitive.options.RelativeBase) + debugLog("new basePath = %s", basePath) + } + } + + return basePath +} + +func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { + if target.Ref.String() == "" && target.Ref.IsRoot() { + // normalizing is important + newRef := normalizeFileRef(&target.Ref, basePath) + target.Ref = *newRef + return &target, nil + + } + + /* change the base path of resolution when an ID is encountered + otherwise the basePath should inherit the parent's */ + // important: ID can be relative path + if target.ID != "" { + debugLog("schema has ID: %s", target.ID) + // handling the case when id is a folder + // remember that basePath has to be a file + refPath := target.ID + if strings.HasSuffix(target.ID, "/") { + // path.Clean here would not work correctly if basepath is http + refPath = fmt.Sprintf("%s%s", refPath, "placeholder.json") + } + basePath = normalizePaths(refPath, basePath) + } + + /* Explain here what this function does */ + var t *Schema + /* if Ref is found, everything else doesn't matter */ + /* Ref also changes the resolution scope of children expandSchema */ + if target.Ref.String() != "" { + /* Here the resolution scope is changed because a $ref was encountered */ + normalizedRef := normalizeFileRef(&target.Ref, basePath) + normalizedBasePath := normalizedRef.RemoteURI() + + if resolver.isCircular(normalizedRef, basePath, parentRefs...) { + // this means there is a cycle in the recursion tree: return the Ref + // - circular refs cannot be expanded. We leave them as ref. + // - denormalization means that a new local file ref is set relative to the original basePath + debugLog("shortcut circular ref: basePath: %s, normalizedPath: %s, normalized ref: %s", + basePath, normalizedBasePath, normalizedRef.String()) + if !resolver.options.AbsoluteCircularRef { + target.Ref = *denormalizeFileRef(normalizedRef, normalizedBasePath, resolver.context.basePath) + } else { + target.Ref = *normalizedRef + } + return &target, nil + } + + debugLog("basePath: %s", basePath) + if Debug { + b, _ := json.Marshal(target) + debugLog("calling Resolve with target: %s", string(b)) + } + if err := resolver.Resolve(&target.Ref, &t, basePath); shouldStopOnError(err, resolver.options) { + return nil, err + } + + if t != nil { + parentRefs = append(parentRefs, normalizedRef.String()) + var err error + transitiveResolver, err := transitiveResolver(basePath, target.Ref, resolver) + if shouldStopOnError(err, resolver.options) { + return nil, err + } + + basePath = updateBasePath(transitiveResolver, resolver, normalizedBasePath) + + return expandSchema(*t, parentRefs, transitiveResolver, basePath) + } + } + + t, err := expandItems(target, parentRefs, resolver, basePath) + if shouldStopOnError(err, resolver.options) { + return &target, err + } + if t != nil { + target = *t + } + + for i := range target.AllOf { + t, err := expandSchema(target.AllOf[i], parentRefs, resolver, basePath) + if shouldStopOnError(err, resolver.options) { + return &target, err + } + target.AllOf[i] = *t + } + for i := range target.AnyOf { + t, err := expandSchema(target.AnyOf[i], parentRefs, resolver, basePath) + if shouldStopOnError(err, resolver.options) { + return &target, err + } + target.AnyOf[i] = *t + } + for i := range target.OneOf { + t, err := expandSchema(target.OneOf[i], parentRefs, resolver, basePath) + if shouldStopOnError(err, resolver.options) { + return &target, err + } + if t != nil { + target.OneOf[i] = *t + } + } + if target.Not != nil { + t, err := expandSchema(*target.Not, parentRefs, resolver, basePath) + if shouldStopOnError(err, resolver.options) { + return &target, err + } + if t != nil { + *target.Not = *t + } + } + for k := range target.Properties { + t, err := expandSchema(target.Properties[k], parentRefs, resolver, basePath) + if shouldStopOnError(err, resolver.options) { + return &target, err + } + if t != nil { + target.Properties[k] = *t + } + } + if target.AdditionalProperties != nil && target.AdditionalProperties.Schema != nil { + t, err := expandSchema(*target.AdditionalProperties.Schema, parentRefs, resolver, basePath) + if shouldStopOnError(err, resolver.options) { + return &target, err + } + if t != nil { + *target.AdditionalProperties.Schema = *t + } + } + for k := range target.PatternProperties { + t, err := expandSchema(target.PatternProperties[k], parentRefs, resolver, basePath) + if shouldStopOnError(err, resolver.options) { + return &target, err + } + if t != nil { + target.PatternProperties[k] = *t + } + } + for k := range target.Dependencies { + if target.Dependencies[k].Schema != nil { + t, err := expandSchema(*target.Dependencies[k].Schema, parentRefs, resolver, basePath) + if shouldStopOnError(err, resolver.options) { + return &target, err + } + if t != nil { + *target.Dependencies[k].Schema = *t + } + } + } + if target.AdditionalItems != nil && target.AdditionalItems.Schema != nil { + t, err := expandSchema(*target.AdditionalItems.Schema, parentRefs, resolver, basePath) + if shouldStopOnError(err, resolver.options) { + return &target, err + } + if t != nil { + *target.AdditionalItems.Schema = *t + } + } + for k := range target.Definitions { + t, err := expandSchema(target.Definitions[k], parentRefs, resolver, basePath) + if shouldStopOnError(err, resolver.options) { + return &target, err + } + if t != nil { + target.Definitions[k] = *t + } + } + return &target, nil +} + +func derefPathItem(pathItem *PathItem, parentRefs []string, resolver *schemaLoader, basePath string) error { + curRef := pathItem.Ref.String() + if curRef != "" { + normalizedRef := normalizeFileRef(&pathItem.Ref, basePath) + normalizedBasePath := normalizedRef.RemoteURI() + + if resolver.isCircular(normalizedRef, basePath, parentRefs...) { + return nil + } + + if err := resolver.Resolve(&pathItem.Ref, pathItem, basePath); shouldStopOnError(err, resolver.options) { + return err + } + + if pathItem.Ref.String() != "" && pathItem.Ref.String() != curRef && basePath != normalizedBasePath { + parentRefs = append(parentRefs, normalizedRef.String()) + return derefPathItem(pathItem, parentRefs, resolver, normalizedBasePath) + } + } + + return nil +} + +func expandPathItem(pathItem *PathItem, resolver *schemaLoader, basePath string) error { + if pathItem == nil { + return nil + } + + parentRefs := []string{} + if err := derefPathItem(pathItem, parentRefs, resolver, basePath); shouldStopOnError(err, resolver.options) { + return err + } + if pathItem.Ref.String() != "" { + var err error + resolver, err = transitiveResolver(basePath, pathItem.Ref, resolver) + if shouldStopOnError(err, resolver.options) { + return err + } + } + pathItem.Ref = Ref{} + + // Currently unused: + //parentRefs = parentRefs[0:] + + for idx := range pathItem.Parameters { + if err := expandParameter(&(pathItem.Parameters[idx]), resolver, basePath); shouldStopOnError(err, resolver.options) { + return err + } + } + if err := expandOperation(pathItem.Get, resolver, basePath); shouldStopOnError(err, resolver.options) { + return err + } + if err := expandOperation(pathItem.Head, resolver, basePath); shouldStopOnError(err, resolver.options) { + return err + } + if err := expandOperation(pathItem.Options, resolver, basePath); shouldStopOnError(err, resolver.options) { + return err + } + if err := expandOperation(pathItem.Put, resolver, basePath); shouldStopOnError(err, resolver.options) { + return err + } + if err := expandOperation(pathItem.Post, resolver, basePath); shouldStopOnError(err, resolver.options) { + return err + } + if err := expandOperation(pathItem.Patch, resolver, basePath); shouldStopOnError(err, resolver.options) { + return err + } + if err := expandOperation(pathItem.Delete, resolver, basePath); shouldStopOnError(err, resolver.options) { + return err + } + return nil +} + +func expandOperation(op *Operation, resolver *schemaLoader, basePath string) error { + if op == nil { + return nil + } + + for i, param := range op.Parameters { + if err := expandParameter(¶m, resolver, basePath); shouldStopOnError(err, resolver.options) { + return err + } + op.Parameters[i] = param + } + + if op.Responses != nil { + responses := op.Responses + if err := expandResponse(responses.Default, resolver, basePath); shouldStopOnError(err, resolver.options) { + return err + } + for code, response := range responses.StatusCodeResponses { + if err := expandResponse(&response, resolver, basePath); shouldStopOnError(err, resolver.options) { + return err + } + responses.StatusCodeResponses[code] = response + } + } + return nil +} + +func transitiveResolver(basePath string, ref Ref, resolver *schemaLoader) (*schemaLoader, error) { + if ref.IsRoot() || ref.HasFragmentOnly { + return resolver, nil + } + + baseRef, _ := NewRef(basePath) + currentRef := normalizeFileRef(&ref, basePath) + // Set a new root to resolve against + if !strings.HasPrefix(currentRef.String(), baseRef.String()) { + rootURL := currentRef.GetURL() + rootURL.Fragment = "" + root, _ := resolver.cache.Get(rootURL.String()) + var err error + + // shallow copy of resolver options to set a new RelativeBase when + // traversing multiple documents + newOptions := resolver.options + newOptions.RelativeBase = rootURL.String() + debugLog("setting new root: %s", newOptions.RelativeBase) + resolver, err = defaultSchemaLoader(root, newOptions, resolver.cache, resolver.context) + if err != nil { + return nil, err + } + } + + return resolver, nil +} + +// ExpandResponseWithRoot expands a response based on a root document, not a fetchable document +func ExpandResponseWithRoot(response *Response, root interface{}, cache ResolutionCache) error { + opts := &ExpandOptions{ + RelativeBase: baseForRoot(root, cache), + SkipSchemas: false, + ContinueOnError: false, + // when no base path is specified, remaining $ref (circular) are rendered with an absolute path + AbsoluteCircularRef: true, + } + resolver, err := defaultSchemaLoader(root, opts, nil, nil) + if err != nil { + return err + } + + return expandResponse(response, resolver, opts.RelativeBase) +} + +// ExpandResponse expands a response based on a basepath +// This is the exported version of expandResponse +// all refs inside response will be resolved relative to basePath +func ExpandResponse(response *Response, basePath string) error { + var specBasePath string + if basePath != "" { + specBasePath, _ = absPath(basePath) + } + opts := &ExpandOptions{ + RelativeBase: specBasePath, + } + resolver, err := defaultSchemaLoader(nil, opts, nil, nil) + if err != nil { + return err + } + + return expandResponse(response, resolver, opts.RelativeBase) +} + +func derefResponse(response *Response, parentRefs []string, resolver *schemaLoader, basePath string) error { + curRef := response.Ref.String() + if curRef != "" { + /* Here the resolution scope is changed because a $ref was encountered */ + normalizedRef := normalizeFileRef(&response.Ref, basePath) + normalizedBasePath := normalizedRef.RemoteURI() + + if resolver.isCircular(normalizedRef, basePath, parentRefs...) { + return nil + } + + if err := resolver.Resolve(&response.Ref, response, basePath); shouldStopOnError(err, resolver.options) { + return err + } + + if response.Ref.String() != "" && response.Ref.String() != curRef && basePath != normalizedBasePath { + parentRefs = append(parentRefs, normalizedRef.String()) + return derefResponse(response, parentRefs, resolver, normalizedBasePath) + } + } + + return nil +} + +func expandResponse(response *Response, resolver *schemaLoader, basePath string) error { + if response == nil { + return nil + } + parentRefs := []string{} + if err := derefResponse(response, parentRefs, resolver, basePath); shouldStopOnError(err, resolver.options) { + return err + } + if response.Ref.String() != "" { + transitiveResolver, err := transitiveResolver(basePath, response.Ref, resolver) + if shouldStopOnError(err, transitiveResolver.options) { + return err + } + basePath = updateBasePath(transitiveResolver, resolver, basePath) + resolver = transitiveResolver + } + if response.Schema != nil && response.Schema.Ref.String() != "" { + // schema expanded to a $ref in another root + var ern error + response.Schema.Ref, ern = NewRef(normalizePaths(response.Schema.Ref.String(), response.Ref.RemoteURI())) + if ern != nil { + return ern + } + } + response.Ref = Ref{} + + parentRefs = parentRefs[0:] + if !resolver.options.SkipSchemas && response.Schema != nil { + // parentRefs = append(parentRefs, response.Schema.Ref.String()) + s, err := expandSchema(*response.Schema, parentRefs, resolver, basePath) + if shouldStopOnError(err, resolver.options) { + return err + } + *response.Schema = *s + } + + return nil +} + +// ExpandParameterWithRoot expands a parameter based on a root document, not a fetchable document +func ExpandParameterWithRoot(parameter *Parameter, root interface{}, cache ResolutionCache) error { + opts := &ExpandOptions{ + RelativeBase: baseForRoot(root, cache), + SkipSchemas: false, + ContinueOnError: false, + // when no base path is specified, remaining $ref (circular) are rendered with an absolute path + AbsoluteCircularRef: true, + } + resolver, err := defaultSchemaLoader(root, opts, nil, nil) + if err != nil { + return err + } + + return expandParameter(parameter, resolver, opts.RelativeBase) +} + +// ExpandParameter expands a parameter based on a basepath +// This is the exported version of expandParameter +// all refs inside parameter will be resolved relative to basePath +func ExpandParameter(parameter *Parameter, basePath string) error { + var specBasePath string + if basePath != "" { + specBasePath, _ = absPath(basePath) + } + opts := &ExpandOptions{ + RelativeBase: specBasePath, + } + resolver, err := defaultSchemaLoader(nil, opts, nil, nil) + if err != nil { + return err + } + + return expandParameter(parameter, resolver, opts.RelativeBase) +} + +func derefParameter(parameter *Parameter, parentRefs []string, resolver *schemaLoader, basePath string) error { + curRef := parameter.Ref.String() + if curRef != "" { + normalizedRef := normalizeFileRef(¶meter.Ref, basePath) + normalizedBasePath := normalizedRef.RemoteURI() + + if resolver.isCircular(normalizedRef, basePath, parentRefs...) { + return nil + } + + if err := resolver.Resolve(¶meter.Ref, parameter, basePath); shouldStopOnError(err, resolver.options) { + return err + } + + if parameter.Ref.String() != "" && parameter.Ref.String() != curRef && basePath != normalizedBasePath { + parentRefs = append(parentRefs, normalizedRef.String()) + return derefParameter(parameter, parentRefs, resolver, normalizedBasePath) + } + } + + return nil +} + +func expandParameter(parameter *Parameter, resolver *schemaLoader, basePath string) error { + if parameter == nil { + return nil + } + + parentRefs := []string{} + if err := derefParameter(parameter, parentRefs, resolver, basePath); shouldStopOnError(err, resolver.options) { + return err + } + if parameter.Ref.String() != "" { + transitiveResolver, err := transitiveResolver(basePath, parameter.Ref, resolver) + if shouldStopOnError(err, transitiveResolver.options) { + return err + } + basePath = updateBasePath(transitiveResolver, resolver, basePath) + resolver = transitiveResolver + } + + if parameter.Schema != nil && parameter.Schema.Ref.String() != "" { + // schema expanded to a $ref in another root + var ern error + parameter.Schema.Ref, ern = NewRef(normalizePaths(parameter.Schema.Ref.String(), parameter.Ref.RemoteURI())) + if ern != nil { + return ern + } + } + parameter.Ref = Ref{} + + parentRefs = parentRefs[0:] + if !resolver.options.SkipSchemas && parameter.Schema != nil { + s, err := expandSchema(*parameter.Schema, parentRefs, resolver, basePath) + if shouldStopOnError(err, resolver.options) { + return err + } + *parameter.Schema = *s + } + return nil +} diff --git a/go/vendor/github.com/go-openapi/spec/external_docs.go b/go/vendor/github.com/go-openapi/spec/external_docs.go new file mode 100644 index 0000000..88add91 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/external_docs.go @@ -0,0 +1,24 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +// ExternalDocumentation allows referencing an external resource for +// extended documentation. +// +// For more information: http://goo.gl/8us55a#externalDocumentationObject +type ExternalDocumentation struct { + Description string `json:"description,omitempty"` + URL string `json:"url,omitempty"` +} diff --git a/go/vendor/github.com/go-openapi/spec/go.mod b/go/vendor/github.com/go-openapi/spec/go.mod new file mode 100644 index 0000000..5af64c1 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/go.mod @@ -0,0 +1,16 @@ +module github.com/go-openapi/spec + +require ( + github.com/PuerkitoBio/purell v1.1.0 // indirect + github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/go-openapi/jsonpointer v0.17.0 + github.com/go-openapi/jsonreference v0.17.0 + github.com/go-openapi/swag v0.17.0 + github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/stretchr/testify v1.2.2 + golang.org/x/net v0.0.0-20181005035420-146acd28ed58 // indirect + golang.org/x/text v0.3.0 // indirect + gopkg.in/yaml.v2 v2.2.1 +) diff --git a/go/vendor/github.com/go-openapi/spec/go.sum b/go/vendor/github.com/go-openapi/spec/go.sum new file mode 100644 index 0000000..ab6bfb6 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/go.sum @@ -0,0 +1,22 @@ +github.com/PuerkitoBio/purell v1.1.0 h1:rmGxhojJlM0tuKtfdvliR84CFHljx9ag64t2xmVkjK4= +github.com/PuerkitoBio/purell v1.1.0/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.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.17.0 h1:Bpl2DtZ6k7wKqfFs7e+4P08+M9I3FQgn09a1UsRUQbk= +github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= +github.com/go-openapi/jsonreference v0.17.0 h1:d/o7/fsLWWQZACbihvZxcyLQ59jfUVs7WOJv/ak7T7A= +github.com/go-openapi/jsonreference v0.17.0/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= +github.com/go-openapi/swag v0.17.0 h1:7wu+dZ5k83kvUWeAb+WUkFiUhDzwGqzTR/NhWzeo1JU= +github.com/go-openapi/swag v0.17.0/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58 h1:otZG8yDCO4LVps5+9bxOeNiCvgmOyt96J3roHTYs7oE= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/go/vendor/github.com/go-openapi/spec/header.go b/go/vendor/github.com/go-openapi/spec/header.go new file mode 100644 index 0000000..82f77f7 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/header.go @@ -0,0 +1,193 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import ( + "encoding/json" + "strings" + + "github.com/go-openapi/jsonpointer" + "github.com/go-openapi/swag" +) + +// HeaderProps describes a response header +type HeaderProps struct { + Description string `json:"description,omitempty"` +} + +// Header describes a header for a response of the API +// +// For more information: http://goo.gl/8us55a#headerObject +type Header struct { + CommonValidations + SimpleSchema + VendorExtensible + HeaderProps +} + +// ResponseHeader creates a new header instance for use in a response +func ResponseHeader() *Header { + return new(Header) +} + +// WithDescription sets the description on this response, allows for chaining +func (h *Header) WithDescription(description string) *Header { + h.Description = description + return h +} + +// Typed a fluent builder method for the type of parameter +func (h *Header) Typed(tpe, format string) *Header { + h.Type = tpe + h.Format = format + return h +} + +// CollectionOf a fluent builder method for an array item +func (h *Header) CollectionOf(items *Items, format string) *Header { + h.Type = "array" + h.Items = items + h.CollectionFormat = format + return h +} + +// WithDefault sets the default value on this item +func (h *Header) WithDefault(defaultValue interface{}) *Header { + h.Default = defaultValue + return h +} + +// WithMaxLength sets a max length value +func (h *Header) WithMaxLength(max int64) *Header { + h.MaxLength = &max + return h +} + +// WithMinLength sets a min length value +func (h *Header) WithMinLength(min int64) *Header { + h.MinLength = &min + return h +} + +// WithPattern sets a pattern value +func (h *Header) WithPattern(pattern string) *Header { + h.Pattern = pattern + return h +} + +// WithMultipleOf sets a multiple of value +func (h *Header) WithMultipleOf(number float64) *Header { + h.MultipleOf = &number + return h +} + +// WithMaximum sets a maximum number value +func (h *Header) WithMaximum(max float64, exclusive bool) *Header { + h.Maximum = &max + h.ExclusiveMaximum = exclusive + return h +} + +// WithMinimum sets a minimum number value +func (h *Header) WithMinimum(min float64, exclusive bool) *Header { + h.Minimum = &min + h.ExclusiveMinimum = exclusive + return h +} + +// WithEnum sets a the enum values (replace) +func (h *Header) WithEnum(values ...interface{}) *Header { + h.Enum = append([]interface{}{}, values...) + return h +} + +// WithMaxItems sets the max items +func (h *Header) WithMaxItems(size int64) *Header { + h.MaxItems = &size + return h +} + +// WithMinItems sets the min items +func (h *Header) WithMinItems(size int64) *Header { + h.MinItems = &size + return h +} + +// UniqueValues dictates that this array can only have unique items +func (h *Header) UniqueValues() *Header { + h.UniqueItems = true + return h +} + +// AllowDuplicates this array can have duplicates +func (h *Header) AllowDuplicates() *Header { + h.UniqueItems = false + return h +} + +// MarshalJSON marshal this to JSON +func (h Header) MarshalJSON() ([]byte, error) { + b1, err := json.Marshal(h.CommonValidations) + if err != nil { + return nil, err + } + b2, err := json.Marshal(h.SimpleSchema) + if err != nil { + return nil, err + } + b3, err := json.Marshal(h.HeaderProps) + if err != nil { + return nil, err + } + return swag.ConcatJSON(b1, b2, b3), nil +} + +// UnmarshalJSON unmarshals this header from JSON +func (h *Header) UnmarshalJSON(data []byte) error { + if err := json.Unmarshal(data, &h.CommonValidations); err != nil { + return err + } + if err := json.Unmarshal(data, &h.SimpleSchema); err != nil { + return err + } + if err := json.Unmarshal(data, &h.VendorExtensible); err != nil { + return err + } + return json.Unmarshal(data, &h.HeaderProps) +} + +// JSONLookup look up a value by the json property name +func (h Header) JSONLookup(token string) (interface{}, error) { + if ex, ok := h.Extensions[token]; ok { + return &ex, nil + } + + r, _, err := jsonpointer.GetForToken(h.CommonValidations, token) + if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { + return nil, err + } + if r != nil { + return r, nil + } + r, _, err = jsonpointer.GetForToken(h.SimpleSchema, token) + if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { + return nil, err + } + if r != nil { + return r, nil + } + r, _, err = jsonpointer.GetForToken(h.HeaderProps, token) + return r, err +} diff --git a/go/vendor/github.com/go-openapi/spec/info.go b/go/vendor/github.com/go-openapi/spec/info.go new file mode 100644 index 0000000..cfb37ec --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/info.go @@ -0,0 +1,168 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import ( + "encoding/json" + "strings" + + "github.com/go-openapi/jsonpointer" + "github.com/go-openapi/swag" +) + +// Extensions vendor specific extensions +type Extensions map[string]interface{} + +// Add adds a value to these extensions +func (e Extensions) Add(key string, value interface{}) { + realKey := strings.ToLower(key) + e[realKey] = value +} + +// GetString gets a string value from the extensions +func (e Extensions) GetString(key string) (string, bool) { + if v, ok := e[strings.ToLower(key)]; ok { + str, ok := v.(string) + return str, ok + } + return "", false +} + +// GetBool gets a string value from the extensions +func (e Extensions) GetBool(key string) (bool, bool) { + if v, ok := e[strings.ToLower(key)]; ok { + str, ok := v.(bool) + return str, ok + } + return false, false +} + +// GetStringSlice gets a string value from the extensions +func (e Extensions) GetStringSlice(key string) ([]string, bool) { + if v, ok := e[strings.ToLower(key)]; ok { + arr, isSlice := v.([]interface{}) + if !isSlice { + return nil, false + } + var strs []string + for _, iface := range arr { + str, isString := iface.(string) + if !isString { + return nil, false + } + strs = append(strs, str) + } + return strs, ok + } + return nil, false +} + +// VendorExtensible composition block. +type VendorExtensible struct { + Extensions Extensions +} + +// AddExtension adds an extension to this extensible object +func (v *VendorExtensible) AddExtension(key string, value interface{}) { + if value == nil { + return + } + if v.Extensions == nil { + v.Extensions = make(map[string]interface{}) + } + v.Extensions.Add(key, value) +} + +// MarshalJSON marshals the extensions to json +func (v VendorExtensible) MarshalJSON() ([]byte, error) { + toser := make(map[string]interface{}) + for k, v := range v.Extensions { + lk := strings.ToLower(k) + if strings.HasPrefix(lk, "x-") { + toser[k] = v + } + } + return json.Marshal(toser) +} + +// UnmarshalJSON for this extensible object +func (v *VendorExtensible) UnmarshalJSON(data []byte) error { + var d map[string]interface{} + if err := json.Unmarshal(data, &d); err != nil { + return err + } + for k, vv := range d { + lk := strings.ToLower(k) + if strings.HasPrefix(lk, "x-") { + if v.Extensions == nil { + v.Extensions = map[string]interface{}{} + } + v.Extensions[k] = vv + } + } + return nil +} + +// InfoProps the properties for an info definition +type InfoProps struct { + Description string `json:"description,omitempty"` + Title string `json:"title,omitempty"` + TermsOfService string `json:"termsOfService,omitempty"` + Contact *ContactInfo `json:"contact,omitempty"` + License *License `json:"license,omitempty"` + Version string `json:"version,omitempty"` +} + +// Info object provides metadata about the API. +// The metadata can be used by the clients if needed, and can be presented in the Swagger-UI for convenience. +// +// For more information: http://goo.gl/8us55a#infoObject +type Info struct { + VendorExtensible + InfoProps +} + +// JSONLookup look up a value by the json property name +func (i Info) JSONLookup(token string) (interface{}, error) { + if ex, ok := i.Extensions[token]; ok { + return &ex, nil + } + r, _, err := jsonpointer.GetForToken(i.InfoProps, token) + return r, err +} + +// MarshalJSON marshal this to JSON +func (i Info) MarshalJSON() ([]byte, error) { + b1, err := json.Marshal(i.InfoProps) + if err != nil { + return nil, err + } + b2, err := json.Marshal(i.VendorExtensible) + if err != nil { + return nil, err + } + return swag.ConcatJSON(b1, b2), nil +} + +// UnmarshalJSON marshal this from JSON +func (i *Info) UnmarshalJSON(data []byte) error { + if err := json.Unmarshal(data, &i.InfoProps); err != nil { + return err + } + if err := json.Unmarshal(data, &i.VendorExtensible); err != nil { + return err + } + return nil +} diff --git a/go/vendor/github.com/go-openapi/spec/items.go b/go/vendor/github.com/go-openapi/spec/items.go new file mode 100644 index 0000000..cf42989 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/items.go @@ -0,0 +1,233 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import ( + "encoding/json" + "strings" + + "github.com/go-openapi/jsonpointer" + "github.com/go-openapi/swag" +) + +// SimpleSchema describe swagger simple schemas for parameters and headers +type SimpleSchema struct { + Type string `json:"type,omitempty"` + Format string `json:"format,omitempty"` + Items *Items `json:"items,omitempty"` + CollectionFormat string `json:"collectionFormat,omitempty"` + Default interface{} `json:"default,omitempty"` + Example interface{} `json:"example,omitempty"` +} + +// TypeName return the type (or format) of a simple schema +func (s *SimpleSchema) TypeName() string { + if s.Format != "" { + return s.Format + } + return s.Type +} + +// ItemsTypeName yields the type of items in a simple schema array +func (s *SimpleSchema) ItemsTypeName() string { + if s.Items == nil { + return "" + } + return s.Items.TypeName() +} + +// CommonValidations describe common JSON-schema validations +type CommonValidations struct { + Maximum *float64 `json:"maximum,omitempty"` + ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` + Minimum *float64 `json:"minimum,omitempty"` + ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` + MaxLength *int64 `json:"maxLength,omitempty"` + MinLength *int64 `json:"minLength,omitempty"` + Pattern string `json:"pattern,omitempty"` + MaxItems *int64 `json:"maxItems,omitempty"` + MinItems *int64 `json:"minItems,omitempty"` + UniqueItems bool `json:"uniqueItems,omitempty"` + MultipleOf *float64 `json:"multipleOf,omitempty"` + Enum []interface{} `json:"enum,omitempty"` +} + +// Items a limited subset of JSON-Schema's items object. +// It is used by parameter definitions that are not located in "body". +// +// For more information: http://goo.gl/8us55a#items-object +type Items struct { + Refable + CommonValidations + SimpleSchema + VendorExtensible +} + +// NewItems creates a new instance of items +func NewItems() *Items { + return &Items{} +} + +// Typed a fluent builder method for the type of item +func (i *Items) Typed(tpe, format string) *Items { + i.Type = tpe + i.Format = format + return i +} + +// CollectionOf a fluent builder method for an array item +func (i *Items) CollectionOf(items *Items, format string) *Items { + i.Type = "array" + i.Items = items + i.CollectionFormat = format + return i +} + +// WithDefault sets the default value on this item +func (i *Items) WithDefault(defaultValue interface{}) *Items { + i.Default = defaultValue + return i +} + +// WithMaxLength sets a max length value +func (i *Items) WithMaxLength(max int64) *Items { + i.MaxLength = &max + return i +} + +// WithMinLength sets a min length value +func (i *Items) WithMinLength(min int64) *Items { + i.MinLength = &min + return i +} + +// WithPattern sets a pattern value +func (i *Items) WithPattern(pattern string) *Items { + i.Pattern = pattern + return i +} + +// WithMultipleOf sets a multiple of value +func (i *Items) WithMultipleOf(number float64) *Items { + i.MultipleOf = &number + return i +} + +// WithMaximum sets a maximum number value +func (i *Items) WithMaximum(max float64, exclusive bool) *Items { + i.Maximum = &max + i.ExclusiveMaximum = exclusive + return i +} + +// WithMinimum sets a minimum number value +func (i *Items) WithMinimum(min float64, exclusive bool) *Items { + i.Minimum = &min + i.ExclusiveMinimum = exclusive + return i +} + +// WithEnum sets a the enum values (replace) +func (i *Items) WithEnum(values ...interface{}) *Items { + i.Enum = append([]interface{}{}, values...) + return i +} + +// WithMaxItems sets the max items +func (i *Items) WithMaxItems(size int64) *Items { + i.MaxItems = &size + return i +} + +// WithMinItems sets the min items +func (i *Items) WithMinItems(size int64) *Items { + i.MinItems = &size + return i +} + +// UniqueValues dictates that this array can only have unique items +func (i *Items) UniqueValues() *Items { + i.UniqueItems = true + return i +} + +// AllowDuplicates this array can have duplicates +func (i *Items) AllowDuplicates() *Items { + i.UniqueItems = false + return i +} + +// UnmarshalJSON hydrates this items instance with the data from JSON +func (i *Items) UnmarshalJSON(data []byte) error { + var validations CommonValidations + if err := json.Unmarshal(data, &validations); err != nil { + return err + } + var ref Refable + if err := json.Unmarshal(data, &ref); err != nil { + return err + } + var simpleSchema SimpleSchema + if err := json.Unmarshal(data, &simpleSchema); err != nil { + return err + } + var vendorExtensible VendorExtensible + if err := json.Unmarshal(data, &vendorExtensible); err != nil { + return err + } + i.Refable = ref + i.CommonValidations = validations + i.SimpleSchema = simpleSchema + i.VendorExtensible = vendorExtensible + return nil +} + +// MarshalJSON converts this items object to JSON +func (i Items) MarshalJSON() ([]byte, error) { + b1, err := json.Marshal(i.CommonValidations) + if err != nil { + return nil, err + } + b2, err := json.Marshal(i.SimpleSchema) + if err != nil { + return nil, err + } + b3, err := json.Marshal(i.Refable) + if err != nil { + return nil, err + } + b4, err := json.Marshal(i.VendorExtensible) + if err != nil { + return nil, err + } + return swag.ConcatJSON(b4, b3, b1, b2), nil +} + +// JSONLookup look up a value by the json property name +func (i Items) JSONLookup(token string) (interface{}, error) { + if token == "$ref" { + return &i.Ref, nil + } + + r, _, err := jsonpointer.GetForToken(i.CommonValidations, token) + if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { + return nil, err + } + if r != nil { + return r, nil + } + r, _, err = jsonpointer.GetForToken(i.SimpleSchema, token) + return r, err +} diff --git a/go/vendor/github.com/go-openapi/spec/license.go b/go/vendor/github.com/go-openapi/spec/license.go new file mode 100644 index 0000000..f20961b --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/license.go @@ -0,0 +1,23 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +// License information for the exposed API. +// +// For more information: http://goo.gl/8us55a#licenseObject +type License struct { + Name string `json:"name,omitempty"` + URL string `json:"url,omitempty"` +} diff --git a/go/vendor/github.com/go-openapi/spec/operation.go b/go/vendor/github.com/go-openapi/spec/operation.go new file mode 100644 index 0000000..32f7d8f --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/operation.go @@ -0,0 +1,259 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import ( + "encoding/json" + + "github.com/go-openapi/jsonpointer" + "github.com/go-openapi/swag" +) + +// OperationProps describes an operation +type OperationProps struct { + Description string `json:"description,omitempty"` + Consumes []string `json:"consumes,omitempty"` + Produces []string `json:"produces,omitempty"` + Schemes []string `json:"schemes,omitempty"` // the scheme, when present must be from [http, https, ws, wss] + Tags []string `json:"tags,omitempty"` + Summary string `json:"summary,omitempty"` + ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` + ID string `json:"operationId,omitempty"` + Deprecated bool `json:"deprecated,omitempty"` + Security []map[string][]string `json:"security,omitempty"` //Special case, see MarshalJSON function + Parameters []Parameter `json:"parameters,omitempty"` + Responses *Responses `json:"responses,omitempty"` +} + +// MarshalJSON takes care of serializing operation properties to JSON +// +// We use a custom marhaller here to handle a special cases related to +// the Security field. We need to preserve zero length slice +// while omitting the field when the value is nil/unset. +func (op OperationProps) MarshalJSON() ([]byte, error) { + type Alias OperationProps + if op.Security == nil { + return json.Marshal(&struct { + Security []map[string][]string `json:"security,omitempty"` + *Alias + }{ + Security: op.Security, + Alias: (*Alias)(&op), + }) + } + return json.Marshal(&struct { + Security []map[string][]string `json:"security"` + *Alias + }{ + Security: op.Security, + Alias: (*Alias)(&op), + }) +} + +// Operation describes a single API operation on a path. +// +// For more information: http://goo.gl/8us55a#operationObject +type Operation struct { + VendorExtensible + OperationProps +} + +// SuccessResponse gets a success response model +func (o *Operation) SuccessResponse() (*Response, int, bool) { + if o.Responses == nil { + return nil, 0, false + } + + for k, v := range o.Responses.StatusCodeResponses { + if k/100 == 2 { + return &v, k, true + } + } + + return o.Responses.Default, 0, false +} + +// JSONLookup look up a value by the json property name +func (o Operation) JSONLookup(token string) (interface{}, error) { + if ex, ok := o.Extensions[token]; ok { + return &ex, nil + } + r, _, err := jsonpointer.GetForToken(o.OperationProps, token) + return r, err +} + +// UnmarshalJSON hydrates this items instance with the data from JSON +func (o *Operation) UnmarshalJSON(data []byte) error { + if err := json.Unmarshal(data, &o.OperationProps); err != nil { + return err + } + if err := json.Unmarshal(data, &o.VendorExtensible); err != nil { + return err + } + return nil +} + +// MarshalJSON converts this items object to JSON +func (o Operation) MarshalJSON() ([]byte, error) { + b1, err := json.Marshal(o.OperationProps) + if err != nil { + return nil, err + } + b2, err := json.Marshal(o.VendorExtensible) + if err != nil { + return nil, err + } + concated := swag.ConcatJSON(b1, b2) + return concated, nil +} + +// NewOperation creates a new operation instance. +// It expects an ID as parameter but not passing an ID is also valid. +func NewOperation(id string) *Operation { + op := new(Operation) + op.ID = id + return op +} + +// WithID sets the ID property on this operation, allows for chaining. +func (o *Operation) WithID(id string) *Operation { + o.ID = id + return o +} + +// WithDescription sets the description on this operation, allows for chaining +func (o *Operation) WithDescription(description string) *Operation { + o.Description = description + return o +} + +// WithSummary sets the summary on this operation, allows for chaining +func (o *Operation) WithSummary(summary string) *Operation { + o.Summary = summary + return o +} + +// WithExternalDocs sets/removes the external docs for/from this operation. +// When you pass empty strings as params the external documents will be removed. +// When you pass non-empty string as one value then those values will be used on the external docs object. +// So when you pass a non-empty description, you should also pass the url and vice versa. +func (o *Operation) WithExternalDocs(description, url string) *Operation { + if description == "" && url == "" { + o.ExternalDocs = nil + return o + } + + if o.ExternalDocs == nil { + o.ExternalDocs = &ExternalDocumentation{} + } + o.ExternalDocs.Description = description + o.ExternalDocs.URL = url + return o +} + +// Deprecate marks the operation as deprecated +func (o *Operation) Deprecate() *Operation { + o.Deprecated = true + return o +} + +// Undeprecate marks the operation as not deprected +func (o *Operation) Undeprecate() *Operation { + o.Deprecated = false + return o +} + +// WithConsumes adds media types for incoming body values +func (o *Operation) WithConsumes(mediaTypes ...string) *Operation { + o.Consumes = append(o.Consumes, mediaTypes...) + return o +} + +// WithProduces adds media types for outgoing body values +func (o *Operation) WithProduces(mediaTypes ...string) *Operation { + o.Produces = append(o.Produces, mediaTypes...) + return o +} + +// WithTags adds tags for this operation +func (o *Operation) WithTags(tags ...string) *Operation { + o.Tags = append(o.Tags, tags...) + return o +} + +// AddParam adds a parameter to this operation, when a parameter for that location +// and with that name already exists it will be replaced +func (o *Operation) AddParam(param *Parameter) *Operation { + if param == nil { + return o + } + + for i, p := range o.Parameters { + if p.Name == param.Name && p.In == param.In { + params := append(o.Parameters[:i], *param) + params = append(params, o.Parameters[i+1:]...) + o.Parameters = params + return o + } + } + + o.Parameters = append(o.Parameters, *param) + return o +} + +// RemoveParam removes a parameter from the operation +func (o *Operation) RemoveParam(name, in string) *Operation { + for i, p := range o.Parameters { + if p.Name == name && p.In == name { + o.Parameters = append(o.Parameters[:i], o.Parameters[i+1:]...) + return o + } + } + return o +} + +// SecuredWith adds a security scope to this operation. +func (o *Operation) SecuredWith(name string, scopes ...string) *Operation { + o.Security = append(o.Security, map[string][]string{name: scopes}) + return o +} + +// WithDefaultResponse adds a default response to the operation. +// Passing a nil value will remove the response +func (o *Operation) WithDefaultResponse(response *Response) *Operation { + return o.RespondsWith(0, response) +} + +// RespondsWith adds a status code response to the operation. +// When the code is 0 the value of the response will be used as default response value. +// When the value of the response is nil it will be removed from the operation +func (o *Operation) RespondsWith(code int, response *Response) *Operation { + if o.Responses == nil { + o.Responses = new(Responses) + } + if code == 0 { + o.Responses.Default = response + return o + } + if response == nil { + delete(o.Responses.StatusCodeResponses, code) + return o + } + if o.Responses.StatusCodeResponses == nil { + o.Responses.StatusCodeResponses = make(map[int]Response) + } + o.Responses.StatusCodeResponses[code] = *response + return o +} diff --git a/go/vendor/github.com/go-openapi/spec/parameter.go b/go/vendor/github.com/go-openapi/spec/parameter.go new file mode 100644 index 0000000..cb1a88d --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/parameter.go @@ -0,0 +1,302 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import ( + "encoding/json" + "strings" + + "github.com/go-openapi/jsonpointer" + "github.com/go-openapi/swag" +) + +// QueryParam creates a query parameter +func QueryParam(name string) *Parameter { + return &Parameter{ParamProps: ParamProps{Name: name, In: "query"}} +} + +// HeaderParam creates a header parameter, this is always required by default +func HeaderParam(name string) *Parameter { + return &Parameter{ParamProps: ParamProps{Name: name, In: "header", Required: true}} +} + +// PathParam creates a path parameter, this is always required +func PathParam(name string) *Parameter { + return &Parameter{ParamProps: ParamProps{Name: name, In: "path", Required: true}} +} + +// BodyParam creates a body parameter +func BodyParam(name string, schema *Schema) *Parameter { + return &Parameter{ParamProps: ParamProps{Name: name, In: "body", Schema: schema}, SimpleSchema: SimpleSchema{Type: "object"}} +} + +// FormDataParam creates a body parameter +func FormDataParam(name string) *Parameter { + return &Parameter{ParamProps: ParamProps{Name: name, In: "formData"}} +} + +// FileParam creates a body parameter +func FileParam(name string) *Parameter { + return &Parameter{ParamProps: ParamProps{Name: name, In: "formData"}, SimpleSchema: SimpleSchema{Type: "file"}} +} + +// SimpleArrayParam creates a param for a simple array (string, int, date etc) +func SimpleArrayParam(name, tpe, fmt string) *Parameter { + return &Parameter{ParamProps: ParamProps{Name: name}, SimpleSchema: SimpleSchema{Type: "array", CollectionFormat: "csv", Items: &Items{SimpleSchema: SimpleSchema{Type: "string", Format: fmt}}}} +} + +// ParamRef creates a parameter that's a json reference +func ParamRef(uri string) *Parameter { + p := new(Parameter) + p.Ref = MustCreateRef(uri) + return p +} + +// ParamProps describes the specific attributes of an operation parameter +type ParamProps struct { + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` + In string `json:"in,omitempty"` + Required bool `json:"required,omitempty"` + Schema *Schema `json:"schema,omitempty"` // when in == "body" + AllowEmptyValue bool `json:"allowEmptyValue,omitempty"` // when in == "query" || "formData" +} + +// Parameter a unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). +// +// There are five possible parameter types. +// * Path - Used together with [Path Templating](#pathTemplating), where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, the path parameter is `itemId`. +// * Query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`. +// * Header - Custom headers that are expected as part of the request. +// * Body - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be *one* body parameter. The name of the body parameter has no effect on the parameter itself and is used for documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist together for the same operation. +// * Form - Used to describe the payload of an HTTP request when either `application/x-www-form-urlencoded` or `multipart/form-data` are used as the content type of the request (in Swagger's definition, the [`consumes`](#operationConsumes) property of an operation). This is the only parameter type that can be used to send files, thus supporting the `file` type. Since form parameters are sent in the payload, they cannot be declared together with a body parameter for the same operation. Form parameters have a different format based on the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4): +// * `application/x-www-form-urlencoded` - Similar to the format of Query parameters but as a payload. For example, `foo=1&bar=swagger` - both `foo` and `bar` are form parameters. This is normally used for simple parameters that are being transferred. +// * `multipart/form-data` - each parameter takes a section in the payload with an internal header. For example, for the header `Content-Disposition: form-data; name="submit-name"` the name of the parameter is `submit-name`. This type of form parameters is more commonly used for file transfers. +// +// For more information: http://goo.gl/8us55a#parameterObject +type Parameter struct { + Refable + CommonValidations + SimpleSchema + VendorExtensible + ParamProps +} + +// JSONLookup look up a value by the json property name +func (p Parameter) JSONLookup(token string) (interface{}, error) { + if ex, ok := p.Extensions[token]; ok { + return &ex, nil + } + if token == "$ref" { + return &p.Ref, nil + } + + r, _, err := jsonpointer.GetForToken(p.CommonValidations, token) + if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { + return nil, err + } + if r != nil { + return r, nil + } + r, _, err = jsonpointer.GetForToken(p.SimpleSchema, token) + if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { + return nil, err + } + if r != nil { + return r, nil + } + r, _, err = jsonpointer.GetForToken(p.ParamProps, token) + return r, err +} + +// WithDescription a fluent builder method for the description of the parameter +func (p *Parameter) WithDescription(description string) *Parameter { + p.Description = description + return p +} + +// Named a fluent builder method to override the name of the parameter +func (p *Parameter) Named(name string) *Parameter { + p.Name = name + return p +} + +// WithLocation a fluent builder method to override the location of the parameter +func (p *Parameter) WithLocation(in string) *Parameter { + p.In = in + return p +} + +// Typed a fluent builder method for the type of the parameter value +func (p *Parameter) Typed(tpe, format string) *Parameter { + p.Type = tpe + p.Format = format + return p +} + +// CollectionOf a fluent builder method for an array parameter +func (p *Parameter) CollectionOf(items *Items, format string) *Parameter { + p.Type = "array" + p.Items = items + p.CollectionFormat = format + return p +} + +// WithDefault sets the default value on this parameter +func (p *Parameter) WithDefault(defaultValue interface{}) *Parameter { + p.AsOptional() // with default implies optional + p.Default = defaultValue + return p +} + +// AllowsEmptyValues flags this parameter as being ok with empty values +func (p *Parameter) AllowsEmptyValues() *Parameter { + p.AllowEmptyValue = true + return p +} + +// NoEmptyValues flags this parameter as not liking empty values +func (p *Parameter) NoEmptyValues() *Parameter { + p.AllowEmptyValue = false + return p +} + +// AsOptional flags this parameter as optional +func (p *Parameter) AsOptional() *Parameter { + p.Required = false + return p +} + +// AsRequired flags this parameter as required +func (p *Parameter) AsRequired() *Parameter { + if p.Default != nil { // with a default required makes no sense + return p + } + p.Required = true + return p +} + +// WithMaxLength sets a max length value +func (p *Parameter) WithMaxLength(max int64) *Parameter { + p.MaxLength = &max + return p +} + +// WithMinLength sets a min length value +func (p *Parameter) WithMinLength(min int64) *Parameter { + p.MinLength = &min + return p +} + +// WithPattern sets a pattern value +func (p *Parameter) WithPattern(pattern string) *Parameter { + p.Pattern = pattern + return p +} + +// WithMultipleOf sets a multiple of value +func (p *Parameter) WithMultipleOf(number float64) *Parameter { + p.MultipleOf = &number + return p +} + +// WithMaximum sets a maximum number value +func (p *Parameter) WithMaximum(max float64, exclusive bool) *Parameter { + p.Maximum = &max + p.ExclusiveMaximum = exclusive + return p +} + +// WithMinimum sets a minimum number value +func (p *Parameter) WithMinimum(min float64, exclusive bool) *Parameter { + p.Minimum = &min + p.ExclusiveMinimum = exclusive + return p +} + +// WithEnum sets a the enum values (replace) +func (p *Parameter) WithEnum(values ...interface{}) *Parameter { + p.Enum = append([]interface{}{}, values...) + return p +} + +// WithMaxItems sets the max items +func (p *Parameter) WithMaxItems(size int64) *Parameter { + p.MaxItems = &size + return p +} + +// WithMinItems sets the min items +func (p *Parameter) WithMinItems(size int64) *Parameter { + p.MinItems = &size + return p +} + +// UniqueValues dictates that this array can only have unique items +func (p *Parameter) UniqueValues() *Parameter { + p.UniqueItems = true + return p +} + +// AllowDuplicates this array can have duplicates +func (p *Parameter) AllowDuplicates() *Parameter { + p.UniqueItems = false + return p +} + +// UnmarshalJSON hydrates this items instance with the data from JSON +func (p *Parameter) UnmarshalJSON(data []byte) error { + if err := json.Unmarshal(data, &p.CommonValidations); err != nil { + return err + } + if err := json.Unmarshal(data, &p.Refable); err != nil { + return err + } + if err := json.Unmarshal(data, &p.SimpleSchema); err != nil { + return err + } + if err := json.Unmarshal(data, &p.VendorExtensible); err != nil { + return err + } + if err := json.Unmarshal(data, &p.ParamProps); err != nil { + return err + } + return nil +} + +// MarshalJSON converts this items object to JSON +func (p Parameter) MarshalJSON() ([]byte, error) { + b1, err := json.Marshal(p.CommonValidations) + if err != nil { + return nil, err + } + b2, err := json.Marshal(p.SimpleSchema) + if err != nil { + return nil, err + } + b3, err := json.Marshal(p.Refable) + if err != nil { + return nil, err + } + b4, err := json.Marshal(p.VendorExtensible) + if err != nil { + return nil, err + } + b5, err := json.Marshal(p.ParamProps) + if err != nil { + return nil, err + } + return swag.ConcatJSON(b3, b1, b2, b4, b5), nil +} diff --git a/go/vendor/github.com/go-openapi/spec/path_item.go b/go/vendor/github.com/go-openapi/spec/path_item.go new file mode 100644 index 0000000..a8ae63e --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/path_item.go @@ -0,0 +1,90 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import ( + "encoding/json" + + "github.com/go-openapi/jsonpointer" + "github.com/go-openapi/swag" +) + +// PathItemProps the path item specific properties +type PathItemProps struct { + Get *Operation `json:"get,omitempty"` + Put *Operation `json:"put,omitempty"` + Post *Operation `json:"post,omitempty"` + Delete *Operation `json:"delete,omitempty"` + Options *Operation `json:"options,omitempty"` + Head *Operation `json:"head,omitempty"` + Patch *Operation `json:"patch,omitempty"` + Parameters []Parameter `json:"parameters,omitempty"` +} + +// PathItem describes the operations available on a single path. +// A Path Item may be empty, due to [ACL constraints](http://goo.gl/8us55a#securityFiltering). +// The path itself is still exposed to the documentation viewer but they will +// not know which operations and parameters are available. +// +// For more information: http://goo.gl/8us55a#pathItemObject +type PathItem struct { + Refable + VendorExtensible + PathItemProps +} + +// JSONLookup look up a value by the json property name +func (p PathItem) JSONLookup(token string) (interface{}, error) { + if ex, ok := p.Extensions[token]; ok { + return &ex, nil + } + if token == "$ref" { + return &p.Ref, nil + } + r, _, err := jsonpointer.GetForToken(p.PathItemProps, token) + return r, err +} + +// UnmarshalJSON hydrates this items instance with the data from JSON +func (p *PathItem) UnmarshalJSON(data []byte) error { + if err := json.Unmarshal(data, &p.Refable); err != nil { + return err + } + if err := json.Unmarshal(data, &p.VendorExtensible); err != nil { + return err + } + if err := json.Unmarshal(data, &p.PathItemProps); err != nil { + return err + } + return nil +} + +// MarshalJSON converts this items object to JSON +func (p PathItem) MarshalJSON() ([]byte, error) { + b3, err := json.Marshal(p.Refable) + if err != nil { + return nil, err + } + b4, err := json.Marshal(p.VendorExtensible) + if err != nil { + return nil, err + } + b5, err := json.Marshal(p.PathItemProps) + if err != nil { + return nil, err + } + concated := swag.ConcatJSON(b3, b4, b5) + return concated, nil +} diff --git a/go/vendor/github.com/go-openapi/spec/paths.go b/go/vendor/github.com/go-openapi/spec/paths.go new file mode 100644 index 0000000..9dc82a2 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/paths.go @@ -0,0 +1,97 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import ( + "encoding/json" + "fmt" + "strings" + + "github.com/go-openapi/swag" +) + +// Paths holds the relative paths to the individual endpoints. +// The path is appended to the [`basePath`](http://goo.gl/8us55a#swaggerBasePath) in order +// to construct the full URL. +// The Paths may be empty, due to [ACL constraints](http://goo.gl/8us55a#securityFiltering). +// +// For more information: http://goo.gl/8us55a#pathsObject +type Paths struct { + VendorExtensible + Paths map[string]PathItem `json:"-"` // custom serializer to flatten this, each entry must start with "/" +} + +// JSONLookup look up a value by the json property name +func (p Paths) JSONLookup(token string) (interface{}, error) { + if pi, ok := p.Paths[token]; ok { + return &pi, nil + } + if ex, ok := p.Extensions[token]; ok { + return &ex, nil + } + return nil, fmt.Errorf("object has no field %q", token) +} + +// UnmarshalJSON hydrates this items instance with the data from JSON +func (p *Paths) UnmarshalJSON(data []byte) error { + var res map[string]json.RawMessage + if err := json.Unmarshal(data, &res); err != nil { + return err + } + for k, v := range res { + if strings.HasPrefix(strings.ToLower(k), "x-") { + if p.Extensions == nil { + p.Extensions = make(map[string]interface{}) + } + var d interface{} + if err := json.Unmarshal(v, &d); err != nil { + return err + } + p.Extensions[k] = d + } + if strings.HasPrefix(k, "/") { + if p.Paths == nil { + p.Paths = make(map[string]PathItem) + } + var pi PathItem + if err := json.Unmarshal(v, &pi); err != nil { + return err + } + p.Paths[k] = pi + } + } + return nil +} + +// MarshalJSON converts this items object to JSON +func (p Paths) MarshalJSON() ([]byte, error) { + b1, err := json.Marshal(p.VendorExtensible) + if err != nil { + return nil, err + } + + pths := make(map[string]PathItem) + for k, v := range p.Paths { + if strings.HasPrefix(k, "/") { + pths[k] = v + } + } + b2, err := json.Marshal(pths) + if err != nil { + return nil, err + } + concated := swag.ConcatJSON(b1, b2) + return concated, nil +} diff --git a/go/vendor/github.com/go-openapi/spec/ref.go b/go/vendor/github.com/go-openapi/spec/ref.go new file mode 100644 index 0000000..1405bfd --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/ref.go @@ -0,0 +1,167 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import ( + "encoding/json" + "net/http" + "os" + "path/filepath" + + "github.com/go-openapi/jsonreference" +) + +// Refable is a struct for things that accept a $ref property +type Refable struct { + Ref Ref +} + +// MarshalJSON marshals the ref to json +func (r Refable) MarshalJSON() ([]byte, error) { + return r.Ref.MarshalJSON() +} + +// UnmarshalJSON unmarshalss the ref from json +func (r *Refable) UnmarshalJSON(d []byte) error { + return json.Unmarshal(d, &r.Ref) +} + +// Ref represents a json reference that is potentially resolved +type Ref struct { + jsonreference.Ref +} + +// RemoteURI gets the remote uri part of the ref +func (r *Ref) RemoteURI() string { + if r.String() == "" { + return r.String() + } + + u := *r.GetURL() + u.Fragment = "" + return u.String() +} + +// IsValidURI returns true when the url the ref points to can be found +func (r *Ref) IsValidURI(basepaths ...string) bool { + if r.String() == "" { + return true + } + + v := r.RemoteURI() + if v == "" { + return true + } + + if r.HasFullURL { + rr, err := http.Get(v) + if err != nil { + return false + } + + return rr.StatusCode/100 == 2 + } + + if !(r.HasFileScheme || r.HasFullFilePath || r.HasURLPathOnly) { + return false + } + + // check for local file + pth := v + if r.HasURLPathOnly { + base := "." + if len(basepaths) > 0 { + base = filepath.Dir(filepath.Join(basepaths...)) + } + p, e := filepath.Abs(filepath.ToSlash(filepath.Join(base, pth))) + if e != nil { + return false + } + pth = p + } + + fi, err := os.Stat(filepath.ToSlash(pth)) + if err != nil { + return false + } + + return !fi.IsDir() +} + +// Inherits creates a new reference from a parent and a child +// If the child cannot inherit from the parent, an error is returned +func (r *Ref) Inherits(child Ref) (*Ref, error) { + ref, err := r.Ref.Inherits(child.Ref) + if err != nil { + return nil, err + } + return &Ref{Ref: *ref}, nil +} + +// NewRef creates a new instance of a ref object +// returns an error when the reference uri is an invalid uri +func NewRef(refURI string) (Ref, error) { + ref, err := jsonreference.New(refURI) + if err != nil { + return Ref{}, err + } + return Ref{Ref: ref}, nil +} + +// MustCreateRef creates a ref object but panics when refURI is invalid. +// Use the NewRef method for a version that returns an error. +func MustCreateRef(refURI string) Ref { + return Ref{Ref: jsonreference.MustCreateRef(refURI)} +} + +// MarshalJSON marshals this ref into a JSON object +func (r Ref) MarshalJSON() ([]byte, error) { + str := r.String() + if str == "" { + if r.IsRoot() { + return []byte(`{"$ref":""}`), nil + } + return []byte("{}"), nil + } + v := map[string]interface{}{"$ref": str} + return json.Marshal(v) +} + +// UnmarshalJSON unmarshals this ref from a JSON object +func (r *Ref) UnmarshalJSON(d []byte) error { + var v map[string]interface{} + if err := json.Unmarshal(d, &v); err != nil { + return err + } + return r.fromMap(v) +} + +func (r *Ref) fromMap(v map[string]interface{}) error { + if v == nil { + return nil + } + + if vv, ok := v["$ref"]; ok { + if str, ok := vv.(string); ok { + ref, err := jsonreference.New(str) + if err != nil { + return err + } + *r = Ref{Ref: ref} + } + } + + return nil +} diff --git a/go/vendor/github.com/go-openapi/spec/response.go b/go/vendor/github.com/go-openapi/spec/response.go new file mode 100644 index 0000000..586db0d --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/response.go @@ -0,0 +1,134 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import ( + "encoding/json" + + "github.com/go-openapi/jsonpointer" + "github.com/go-openapi/swag" +) + +// ResponseProps properties specific to a response +type ResponseProps struct { + Description string `json:"description,omitempty"` + Schema *Schema `json:"schema,omitempty"` + Headers map[string]Header `json:"headers,omitempty"` + Examples map[string]interface{} `json:"examples,omitempty"` +} + +// Response describes a single response from an API Operation. +// +// For more information: http://goo.gl/8us55a#responseObject +type Response struct { + Refable + ResponseProps + VendorExtensible +} + +// JSONLookup look up a value by the json property name +func (r Response) JSONLookup(token string) (interface{}, error) { + if ex, ok := r.Extensions[token]; ok { + return &ex, nil + } + if token == "$ref" { + return &r.Ref, nil + } + ptr, _, err := jsonpointer.GetForToken(r.ResponseProps, token) + return ptr, err +} + +// UnmarshalJSON hydrates this items instance with the data from JSON +func (r *Response) UnmarshalJSON(data []byte) error { + if err := json.Unmarshal(data, &r.ResponseProps); err != nil { + return err + } + if err := json.Unmarshal(data, &r.Refable); err != nil { + return err + } + if err := json.Unmarshal(data, &r.VendorExtensible); err != nil { + return err + } + return nil +} + +// MarshalJSON converts this items object to JSON +func (r Response) MarshalJSON() ([]byte, error) { + b1, err := json.Marshal(r.ResponseProps) + if err != nil { + return nil, err + } + b2, err := json.Marshal(r.Refable) + if err != nil { + return nil, err + } + b3, err := json.Marshal(r.VendorExtensible) + if err != nil { + return nil, err + } + return swag.ConcatJSON(b1, b2, b3), nil +} + +// NewResponse creates a new response instance +func NewResponse() *Response { + return new(Response) +} + +// ResponseRef creates a response as a json reference +func ResponseRef(url string) *Response { + resp := NewResponse() + resp.Ref = MustCreateRef(url) + return resp +} + +// WithDescription sets the description on this response, allows for chaining +func (r *Response) WithDescription(description string) *Response { + r.Description = description + return r +} + +// WithSchema sets the schema on this response, allows for chaining. +// Passing a nil argument removes the schema from this response +func (r *Response) WithSchema(schema *Schema) *Response { + r.Schema = schema + return r +} + +// AddHeader adds a header to this response +func (r *Response) AddHeader(name string, header *Header) *Response { + if header == nil { + return r.RemoveHeader(name) + } + if r.Headers == nil { + r.Headers = make(map[string]Header) + } + r.Headers[name] = *header + return r +} + +// RemoveHeader removes a header from this response +func (r *Response) RemoveHeader(name string) *Response { + delete(r.Headers, name) + return r +} + +// AddExample adds an example to this response +func (r *Response) AddExample(mediaType string, example interface{}) *Response { + if r.Examples == nil { + r.Examples = make(map[string]interface{}) + } + r.Examples[mediaType] = example + return r +} diff --git a/go/vendor/github.com/go-openapi/spec/responses.go b/go/vendor/github.com/go-openapi/spec/responses.go new file mode 100644 index 0000000..4efb6f8 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/responses.go @@ -0,0 +1,127 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import ( + "encoding/json" + "fmt" + "reflect" + "strconv" + + "github.com/go-openapi/swag" +) + +// Responses is a container for the expected responses of an operation. +// The container maps a HTTP response code to the expected response. +// It is not expected from the documentation to necessarily cover all possible HTTP response codes, +// since they may not be known in advance. However, it is expected from the documentation to cover +// a successful operation response and any known errors. +// +// The `default` can be used a default response object for all HTTP codes that are not covered +// individually by the specification. +// +// The `Responses Object` MUST contain at least one response code, and it SHOULD be the response +// for a successful operation call. +// +// For more information: http://goo.gl/8us55a#responsesObject +type Responses struct { + VendorExtensible + ResponsesProps +} + +// JSONLookup implements an interface to customize json pointer lookup +func (r Responses) JSONLookup(token string) (interface{}, error) { + if token == "default" { + return r.Default, nil + } + if ex, ok := r.Extensions[token]; ok { + return &ex, nil + } + if i, err := strconv.Atoi(token); err == nil { + if scr, ok := r.StatusCodeResponses[i]; ok { + return scr, nil + } + } + return nil, fmt.Errorf("object has no field %q", token) +} + +// UnmarshalJSON hydrates this items instance with the data from JSON +func (r *Responses) UnmarshalJSON(data []byte) error { + if err := json.Unmarshal(data, &r.ResponsesProps); err != nil { + return err + } + if err := json.Unmarshal(data, &r.VendorExtensible); err != nil { + return err + } + if reflect.DeepEqual(ResponsesProps{}, r.ResponsesProps) { + r.ResponsesProps = ResponsesProps{} + } + return nil +} + +// MarshalJSON converts this items object to JSON +func (r Responses) MarshalJSON() ([]byte, error) { + b1, err := json.Marshal(r.ResponsesProps) + if err != nil { + return nil, err + } + b2, err := json.Marshal(r.VendorExtensible) + if err != nil { + return nil, err + } + concated := swag.ConcatJSON(b1, b2) + return concated, nil +} + +// ResponsesProps describes all responses for an operation. +// It tells what is the default response and maps all responses with a +// HTTP status code. +type ResponsesProps struct { + Default *Response + StatusCodeResponses map[int]Response +} + +// MarshalJSON marshals responses as JSON +func (r ResponsesProps) MarshalJSON() ([]byte, error) { + toser := map[string]Response{} + if r.Default != nil { + toser["default"] = *r.Default + } + for k, v := range r.StatusCodeResponses { + toser[strconv.Itoa(k)] = v + } + return json.Marshal(toser) +} + +// UnmarshalJSON unmarshals responses from JSON +func (r *ResponsesProps) UnmarshalJSON(data []byte) error { + var res map[string]Response + if err := json.Unmarshal(data, &res); err != nil { + return nil + } + if v, ok := res["default"]; ok { + r.Default = &v + delete(res, "default") + } + for k, v := range res { + if nk, err := strconv.Atoi(k); err == nil { + if r.StatusCodeResponses == nil { + r.StatusCodeResponses = map[int]Response{} + } + r.StatusCodeResponses[nk] = v + } + } + return nil +} diff --git a/go/vendor/github.com/go-openapi/spec/schema.go b/go/vendor/github.com/go-openapi/spec/schema.go new file mode 100644 index 0000000..b9481e2 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/schema.go @@ -0,0 +1,636 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import ( + "encoding/json" + "fmt" + "net/url" + "strings" + + "github.com/go-openapi/jsonpointer" + "github.com/go-openapi/swag" +) + +// BooleanProperty creates a boolean property +func BooleanProperty() *Schema { + return &Schema{SchemaProps: SchemaProps{Type: []string{"boolean"}}} +} + +// BoolProperty creates a boolean property +func BoolProperty() *Schema { return BooleanProperty() } + +// StringProperty creates a string property +func StringProperty() *Schema { + return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}}} +} + +// CharProperty creates a string property +func CharProperty() *Schema { + return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}}} +} + +// Float64Property creates a float64/double property +func Float64Property() *Schema { + return &Schema{SchemaProps: SchemaProps{Type: []string{"number"}, Format: "double"}} +} + +// Float32Property creates a float32/float property +func Float32Property() *Schema { + return &Schema{SchemaProps: SchemaProps{Type: []string{"number"}, Format: "float"}} +} + +// Int8Property creates an int8 property +func Int8Property() *Schema { + return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int8"}} +} + +// Int16Property creates an int16 property +func Int16Property() *Schema { + return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int16"}} +} + +// Int32Property creates an int32 property +func Int32Property() *Schema { + return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int32"}} +} + +// Int64Property creates an int64 property +func Int64Property() *Schema { + return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int64"}} +} + +// StrFmtProperty creates a property for the named string format +func StrFmtProperty(format string) *Schema { + return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: format}} +} + +// DateProperty creates a date property +func DateProperty() *Schema { + return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: "date"}} +} + +// DateTimeProperty creates a date time property +func DateTimeProperty() *Schema { + return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: "date-time"}} +} + +// MapProperty creates a map property +func MapProperty(property *Schema) *Schema { + return &Schema{SchemaProps: SchemaProps{Type: []string{"object"}, AdditionalProperties: &SchemaOrBool{Allows: true, Schema: property}}} +} + +// RefProperty creates a ref property +func RefProperty(name string) *Schema { + return &Schema{SchemaProps: SchemaProps{Ref: MustCreateRef(name)}} +} + +// RefSchema creates a ref property +func RefSchema(name string) *Schema { + return &Schema{SchemaProps: SchemaProps{Ref: MustCreateRef(name)}} +} + +// ArrayProperty creates an array property +func ArrayProperty(items *Schema) *Schema { + if items == nil { + return &Schema{SchemaProps: SchemaProps{Type: []string{"array"}}} + } + return &Schema{SchemaProps: SchemaProps{Items: &SchemaOrArray{Schema: items}, Type: []string{"array"}}} +} + +// ComposedSchema creates a schema with allOf +func ComposedSchema(schemas ...Schema) *Schema { + s := new(Schema) + s.AllOf = schemas + return s +} + +// SchemaURL represents a schema url +type SchemaURL string + +// MarshalJSON marshal this to JSON +func (r SchemaURL) MarshalJSON() ([]byte, error) { + if r == "" { + return []byte("{}"), nil + } + v := map[string]interface{}{"$schema": string(r)} + return json.Marshal(v) +} + +// UnmarshalJSON unmarshal this from JSON +func (r *SchemaURL) UnmarshalJSON(data []byte) error { + var v map[string]interface{} + if err := json.Unmarshal(data, &v); err != nil { + return err + } + return r.fromMap(v) +} + +func (r *SchemaURL) fromMap(v map[string]interface{}) error { + if v == nil { + return nil + } + if vv, ok := v["$schema"]; ok { + if str, ok := vv.(string); ok { + u, err := url.Parse(str) + if err != nil { + return err + } + + *r = SchemaURL(u.String()) + } + } + return nil +} + +// type ExtraSchemaProps map[string]interface{} + +// // JSONSchema represents a structure that is a json schema draft 04 +// type JSONSchema struct { +// SchemaProps +// ExtraSchemaProps +// } + +// // MarshalJSON marshal this to JSON +// func (s JSONSchema) MarshalJSON() ([]byte, error) { +// b1, err := json.Marshal(s.SchemaProps) +// if err != nil { +// return nil, err +// } +// b2, err := s.Ref.MarshalJSON() +// if err != nil { +// return nil, err +// } +// b3, err := s.Schema.MarshalJSON() +// if err != nil { +// return nil, err +// } +// b4, err := json.Marshal(s.ExtraSchemaProps) +// if err != nil { +// return nil, err +// } +// return swag.ConcatJSON(b1, b2, b3, b4), nil +// } + +// // UnmarshalJSON marshal this from JSON +// func (s *JSONSchema) UnmarshalJSON(data []byte) error { +// var sch JSONSchema +// if err := json.Unmarshal(data, &sch.SchemaProps); err != nil { +// return err +// } +// if err := json.Unmarshal(data, &sch.Ref); err != nil { +// return err +// } +// if err := json.Unmarshal(data, &sch.Schema); err != nil { +// return err +// } +// if err := json.Unmarshal(data, &sch.ExtraSchemaProps); err != nil { +// return err +// } +// *s = sch +// return nil +// } + +// SchemaProps describes a JSON schema (draft 4) +type SchemaProps struct { + ID string `json:"id,omitempty"` + Ref Ref `json:"-"` + Schema SchemaURL `json:"-"` + Description string `json:"description,omitempty"` + Type StringOrArray `json:"type,omitempty"` + Format string `json:"format,omitempty"` + Title string `json:"title,omitempty"` + Default interface{} `json:"default,omitempty"` + Maximum *float64 `json:"maximum,omitempty"` + ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` + Minimum *float64 `json:"minimum,omitempty"` + ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` + MaxLength *int64 `json:"maxLength,omitempty"` + MinLength *int64 `json:"minLength,omitempty"` + Pattern string `json:"pattern,omitempty"` + MaxItems *int64 `json:"maxItems,omitempty"` + MinItems *int64 `json:"minItems,omitempty"` + UniqueItems bool `json:"uniqueItems,omitempty"` + MultipleOf *float64 `json:"multipleOf,omitempty"` + Enum []interface{} `json:"enum,omitempty"` + MaxProperties *int64 `json:"maxProperties,omitempty"` + MinProperties *int64 `json:"minProperties,omitempty"` + Required []string `json:"required,omitempty"` + Items *SchemaOrArray `json:"items,omitempty"` + AllOf []Schema `json:"allOf,omitempty"` + OneOf []Schema `json:"oneOf,omitempty"` + AnyOf []Schema `json:"anyOf,omitempty"` + Not *Schema `json:"not,omitempty"` + Properties map[string]Schema `json:"properties,omitempty"` + AdditionalProperties *SchemaOrBool `json:"additionalProperties,omitempty"` + PatternProperties map[string]Schema `json:"patternProperties,omitempty"` + Dependencies Dependencies `json:"dependencies,omitempty"` + AdditionalItems *SchemaOrBool `json:"additionalItems,omitempty"` + Definitions Definitions `json:"definitions,omitempty"` +} + +// SwaggerSchemaProps are additional properties supported by swagger schemas, but not JSON-schema (draft 4) +type SwaggerSchemaProps struct { + Discriminator string `json:"discriminator,omitempty"` + ReadOnly bool `json:"readOnly,omitempty"` + XML *XMLObject `json:"xml,omitempty"` + ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` + Example interface{} `json:"example,omitempty"` +} + +// Schema the schema object allows the definition of input and output data types. +// These types can be objects, but also primitives and arrays. +// This object is based on the [JSON Schema Specification Draft 4](http://json-schema.org/) +// and uses a predefined subset of it. +// On top of this subset, there are extensions provided by this specification to allow for more complete documentation. +// +// For more information: http://goo.gl/8us55a#schemaObject +type Schema struct { + VendorExtensible + SchemaProps + SwaggerSchemaProps + ExtraProps map[string]interface{} `json:"-"` +} + +// JSONLookup implements an interface to customize json pointer lookup +func (s Schema) JSONLookup(token string) (interface{}, error) { + if ex, ok := s.Extensions[token]; ok { + return &ex, nil + } + + if ex, ok := s.ExtraProps[token]; ok { + return &ex, nil + } + + r, _, err := jsonpointer.GetForToken(s.SchemaProps, token) + if r != nil || (err != nil && !strings.HasPrefix(err.Error(), "object has no field")) { + return r, err + } + r, _, err = jsonpointer.GetForToken(s.SwaggerSchemaProps, token) + return r, err +} + +// WithID sets the id for this schema, allows for chaining +func (s *Schema) WithID(id string) *Schema { + s.ID = id + return s +} + +// WithTitle sets the title for this schema, allows for chaining +func (s *Schema) WithTitle(title string) *Schema { + s.Title = title + return s +} + +// WithDescription sets the description for this schema, allows for chaining +func (s *Schema) WithDescription(description string) *Schema { + s.Description = description + return s +} + +// WithProperties sets the properties for this schema +func (s *Schema) WithProperties(schemas map[string]Schema) *Schema { + s.Properties = schemas + return s +} + +// SetProperty sets a property on this schema +func (s *Schema) SetProperty(name string, schema Schema) *Schema { + if s.Properties == nil { + s.Properties = make(map[string]Schema) + } + s.Properties[name] = schema + return s +} + +// WithAllOf sets the all of property +func (s *Schema) WithAllOf(schemas ...Schema) *Schema { + s.AllOf = schemas + return s +} + +// WithMaxProperties sets the max number of properties an object can have +func (s *Schema) WithMaxProperties(max int64) *Schema { + s.MaxProperties = &max + return s +} + +// WithMinProperties sets the min number of properties an object must have +func (s *Schema) WithMinProperties(min int64) *Schema { + s.MinProperties = &min + return s +} + +// Typed sets the type of this schema for a single value item +func (s *Schema) Typed(tpe, format string) *Schema { + s.Type = []string{tpe} + s.Format = format + return s +} + +// AddType adds a type with potential format to the types for this schema +func (s *Schema) AddType(tpe, format string) *Schema { + s.Type = append(s.Type, tpe) + if format != "" { + s.Format = format + } + return s +} + +// CollectionOf a fluent builder method for an array parameter +func (s *Schema) CollectionOf(items Schema) *Schema { + s.Type = []string{"array"} + s.Items = &SchemaOrArray{Schema: &items} + return s +} + +// WithDefault sets the default value on this parameter +func (s *Schema) WithDefault(defaultValue interface{}) *Schema { + s.Default = defaultValue + return s +} + +// WithRequired flags this parameter as required +func (s *Schema) WithRequired(items ...string) *Schema { + s.Required = items + return s +} + +// AddRequired adds field names to the required properties array +func (s *Schema) AddRequired(items ...string) *Schema { + s.Required = append(s.Required, items...) + return s +} + +// WithMaxLength sets a max length value +func (s *Schema) WithMaxLength(max int64) *Schema { + s.MaxLength = &max + return s +} + +// WithMinLength sets a min length value +func (s *Schema) WithMinLength(min int64) *Schema { + s.MinLength = &min + return s +} + +// WithPattern sets a pattern value +func (s *Schema) WithPattern(pattern string) *Schema { + s.Pattern = pattern + return s +} + +// WithMultipleOf sets a multiple of value +func (s *Schema) WithMultipleOf(number float64) *Schema { + s.MultipleOf = &number + return s +} + +// WithMaximum sets a maximum number value +func (s *Schema) WithMaximum(max float64, exclusive bool) *Schema { + s.Maximum = &max + s.ExclusiveMaximum = exclusive + return s +} + +// WithMinimum sets a minimum number value +func (s *Schema) WithMinimum(min float64, exclusive bool) *Schema { + s.Minimum = &min + s.ExclusiveMinimum = exclusive + return s +} + +// WithEnum sets a the enum values (replace) +func (s *Schema) WithEnum(values ...interface{}) *Schema { + s.Enum = append([]interface{}{}, values...) + return s +} + +// WithMaxItems sets the max items +func (s *Schema) WithMaxItems(size int64) *Schema { + s.MaxItems = &size + return s +} + +// WithMinItems sets the min items +func (s *Schema) WithMinItems(size int64) *Schema { + s.MinItems = &size + return s +} + +// UniqueValues dictates that this array can only have unique items +func (s *Schema) UniqueValues() *Schema { + s.UniqueItems = true + return s +} + +// AllowDuplicates this array can have duplicates +func (s *Schema) AllowDuplicates() *Schema { + s.UniqueItems = false + return s +} + +// AddToAllOf adds a schema to the allOf property +func (s *Schema) AddToAllOf(schemas ...Schema) *Schema { + s.AllOf = append(s.AllOf, schemas...) + return s +} + +// WithDiscriminator sets the name of the discriminator field +func (s *Schema) WithDiscriminator(discriminator string) *Schema { + s.Discriminator = discriminator + return s +} + +// AsReadOnly flags this schema as readonly +func (s *Schema) AsReadOnly() *Schema { + s.ReadOnly = true + return s +} + +// AsWritable flags this schema as writeable (not read-only) +func (s *Schema) AsWritable() *Schema { + s.ReadOnly = false + return s +} + +// WithExample sets the example for this schema +func (s *Schema) WithExample(example interface{}) *Schema { + s.Example = example + return s +} + +// WithExternalDocs sets/removes the external docs for/from this schema. +// When you pass empty strings as params the external documents will be removed. +// When you pass non-empty string as one value then those values will be used on the external docs object. +// So when you pass a non-empty description, you should also pass the url and vice versa. +func (s *Schema) WithExternalDocs(description, url string) *Schema { + if description == "" && url == "" { + s.ExternalDocs = nil + return s + } + + if s.ExternalDocs == nil { + s.ExternalDocs = &ExternalDocumentation{} + } + s.ExternalDocs.Description = description + s.ExternalDocs.URL = url + return s +} + +// WithXMLName sets the xml name for the object +func (s *Schema) WithXMLName(name string) *Schema { + if s.XML == nil { + s.XML = new(XMLObject) + } + s.XML.Name = name + return s +} + +// WithXMLNamespace sets the xml namespace for the object +func (s *Schema) WithXMLNamespace(namespace string) *Schema { + if s.XML == nil { + s.XML = new(XMLObject) + } + s.XML.Namespace = namespace + return s +} + +// WithXMLPrefix sets the xml prefix for the object +func (s *Schema) WithXMLPrefix(prefix string) *Schema { + if s.XML == nil { + s.XML = new(XMLObject) + } + s.XML.Prefix = prefix + return s +} + +// AsXMLAttribute flags this object as xml attribute +func (s *Schema) AsXMLAttribute() *Schema { + if s.XML == nil { + s.XML = new(XMLObject) + } + s.XML.Attribute = true + return s +} + +// AsXMLElement flags this object as an xml node +func (s *Schema) AsXMLElement() *Schema { + if s.XML == nil { + s.XML = new(XMLObject) + } + s.XML.Attribute = false + return s +} + +// AsWrappedXML flags this object as wrapped, this is mostly useful for array types +func (s *Schema) AsWrappedXML() *Schema { + if s.XML == nil { + s.XML = new(XMLObject) + } + s.XML.Wrapped = true + return s +} + +// AsUnwrappedXML flags this object as an xml node +func (s *Schema) AsUnwrappedXML() *Schema { + if s.XML == nil { + s.XML = new(XMLObject) + } + s.XML.Wrapped = false + return s +} + +// MarshalJSON marshal this to JSON +func (s Schema) MarshalJSON() ([]byte, error) { + b1, err := json.Marshal(s.SchemaProps) + if err != nil { + return nil, fmt.Errorf("schema props %v", err) + } + b2, err := json.Marshal(s.VendorExtensible) + if err != nil { + return nil, fmt.Errorf("vendor props %v", err) + } + b3, err := s.Ref.MarshalJSON() + if err != nil { + return nil, fmt.Errorf("ref prop %v", err) + } + b4, err := s.Schema.MarshalJSON() + if err != nil { + return nil, fmt.Errorf("schema prop %v", err) + } + b5, err := json.Marshal(s.SwaggerSchemaProps) + if err != nil { + return nil, fmt.Errorf("common validations %v", err) + } + var b6 []byte + if s.ExtraProps != nil { + jj, err := json.Marshal(s.ExtraProps) + if err != nil { + return nil, fmt.Errorf("extra props %v", err) + } + b6 = jj + } + return swag.ConcatJSON(b1, b2, b3, b4, b5, b6), nil +} + +// UnmarshalJSON marshal this from JSON +func (s *Schema) UnmarshalJSON(data []byte) error { + props := struct { + SchemaProps + SwaggerSchemaProps + }{} + if err := json.Unmarshal(data, &props); err != nil { + return err + } + + sch := Schema{ + SchemaProps: props.SchemaProps, + SwaggerSchemaProps: props.SwaggerSchemaProps, + } + + var d map[string]interface{} + if err := json.Unmarshal(data, &d); err != nil { + return err + } + + _ = sch.Ref.fromMap(d) + _ = sch.Schema.fromMap(d) + + delete(d, "$ref") + delete(d, "$schema") + for _, pn := range swag.DefaultJSONNameProvider.GetJSONNames(s) { + delete(d, pn) + } + + for k, vv := range d { + lk := strings.ToLower(k) + if strings.HasPrefix(lk, "x-") { + if sch.Extensions == nil { + sch.Extensions = map[string]interface{}{} + } + sch.Extensions[k] = vv + continue + } + if sch.ExtraProps == nil { + sch.ExtraProps = map[string]interface{}{} + } + sch.ExtraProps[k] = vv + } + + *s = sch + + return nil +} diff --git a/go/vendor/github.com/go-openapi/spec/security_scheme.go b/go/vendor/github.com/go-openapi/spec/security_scheme.go new file mode 100644 index 0000000..9f1b454 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/security_scheme.go @@ -0,0 +1,143 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import ( + "encoding/json" + + "github.com/go-openapi/jsonpointer" + "github.com/go-openapi/swag" +) + +const ( + basic = "basic" + apiKey = "apiKey" + oauth2 = "oauth2" + implicit = "implicit" + password = "password" + application = "application" + accessCode = "accessCode" +) + +// BasicAuth creates a basic auth security scheme +func BasicAuth() *SecurityScheme { + return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{Type: basic}} +} + +// APIKeyAuth creates an api key auth security scheme +func APIKeyAuth(fieldName, valueSource string) *SecurityScheme { + return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{Type: apiKey, Name: fieldName, In: valueSource}} +} + +// OAuth2Implicit creates an implicit flow oauth2 security scheme +func OAuth2Implicit(authorizationURL string) *SecurityScheme { + return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ + Type: oauth2, + Flow: implicit, + AuthorizationURL: authorizationURL, + }} +} + +// OAuth2Password creates a password flow oauth2 security scheme +func OAuth2Password(tokenURL string) *SecurityScheme { + return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ + Type: oauth2, + Flow: password, + TokenURL: tokenURL, + }} +} + +// OAuth2Application creates an application flow oauth2 security scheme +func OAuth2Application(tokenURL string) *SecurityScheme { + return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ + Type: oauth2, + Flow: application, + TokenURL: tokenURL, + }} +} + +// OAuth2AccessToken creates an access token flow oauth2 security scheme +func OAuth2AccessToken(authorizationURL, tokenURL string) *SecurityScheme { + return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ + Type: oauth2, + Flow: accessCode, + AuthorizationURL: authorizationURL, + TokenURL: tokenURL, + }} +} + +// SecuritySchemeProps describes a swagger security scheme in the securityDefinitions section +type SecuritySchemeProps struct { + Description string `json:"description,omitempty"` + Type string `json:"type"` + Name string `json:"name,omitempty"` // api key + In string `json:"in,omitempty"` // api key + Flow string `json:"flow,omitempty"` // oauth2 + AuthorizationURL string `json:"authorizationUrl,omitempty"` // oauth2 + TokenURL string `json:"tokenUrl,omitempty"` // oauth2 + Scopes map[string]string `json:"scopes,omitempty"` // oauth2 +} + +// AddScope adds a scope to this security scheme +func (s *SecuritySchemeProps) AddScope(scope, description string) { + if s.Scopes == nil { + s.Scopes = make(map[string]string) + } + s.Scopes[scope] = description +} + +// SecurityScheme allows the definition of a security scheme that can be used by the operations. +// Supported schemes are basic authentication, an API key (either as a header or as a query parameter) +// and OAuth2's common flows (implicit, password, application and access code). +// +// For more information: http://goo.gl/8us55a#securitySchemeObject +type SecurityScheme struct { + VendorExtensible + SecuritySchemeProps +} + +// JSONLookup implements an interface to customize json pointer lookup +func (s SecurityScheme) JSONLookup(token string) (interface{}, error) { + if ex, ok := s.Extensions[token]; ok { + return &ex, nil + } + + r, _, err := jsonpointer.GetForToken(s.SecuritySchemeProps, token) + return r, err +} + +// MarshalJSON marshal this to JSON +func (s SecurityScheme) MarshalJSON() ([]byte, error) { + b1, err := json.Marshal(s.SecuritySchemeProps) + if err != nil { + return nil, err + } + b2, err := json.Marshal(s.VendorExtensible) + if err != nil { + return nil, err + } + return swag.ConcatJSON(b1, b2), nil +} + +// UnmarshalJSON marshal this from JSON +func (s *SecurityScheme) UnmarshalJSON(data []byte) error { + if err := json.Unmarshal(data, &s.SecuritySchemeProps); err != nil { + return err + } + if err := json.Unmarshal(data, &s.VendorExtensible); err != nil { + return err + } + return nil +} diff --git a/go/vendor/github.com/go-openapi/spec/spec.go b/go/vendor/github.com/go-openapi/spec/spec.go new file mode 100644 index 0000000..0bb045b --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/spec.go @@ -0,0 +1,86 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import "encoding/json" + +//go:generate curl -L --progress -o ./schemas/v2/schema.json http://swagger.io/v2/schema.json +//go:generate curl -L --progress -o ./schemas/jsonschema-draft-04.json http://json-schema.org/draft-04/schema +//go:generate go-bindata -pkg=spec -prefix=./schemas -ignore=.*\.md ./schemas/... +//go:generate perl -pi -e s,Json,JSON,g bindata.go + +const ( + // SwaggerSchemaURL the url for the swagger 2.0 schema to validate specs + SwaggerSchemaURL = "http://swagger.io/v2/schema.json#" + // JSONSchemaURL the url for the json schema schema + JSONSchemaURL = "http://json-schema.org/draft-04/schema#" +) + +var ( + jsonSchema *Schema + swaggerSchema *Schema +) + +func init() { + jsonSchema = MustLoadJSONSchemaDraft04() + swaggerSchema = MustLoadSwagger20Schema() +} + +// MustLoadJSONSchemaDraft04 panics when Swagger20Schema returns an error +func MustLoadJSONSchemaDraft04() *Schema { + d, e := JSONSchemaDraft04() + if e != nil { + panic(e) + } + return d +} + +// JSONSchemaDraft04 loads the json schema document for json shema draft04 +func JSONSchemaDraft04() (*Schema, error) { + b, err := Asset("jsonschema-draft-04.json") + if err != nil { + return nil, err + } + + schema := new(Schema) + if err := json.Unmarshal(b, schema); err != nil { + return nil, err + } + return schema, nil +} + +// MustLoadSwagger20Schema panics when Swagger20Schema returns an error +func MustLoadSwagger20Schema() *Schema { + d, e := Swagger20Schema() + if e != nil { + panic(e) + } + return d +} + +// Swagger20Schema loads the swagger 2.0 schema from the embedded assets +func Swagger20Schema() (*Schema, error) { + + b, err := Asset("v2/schema.json") + if err != nil { + return nil, err + } + + schema := new(Schema) + if err := json.Unmarshal(b, schema); err != nil { + return nil, err + } + return schema, nil +} diff --git a/go/vendor/github.com/go-openapi/spec/swagger.go b/go/vendor/github.com/go-openapi/spec/swagger.go new file mode 100644 index 0000000..4586a21 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/swagger.go @@ -0,0 +1,318 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import ( + "encoding/json" + "fmt" + "strconv" + + "github.com/go-openapi/jsonpointer" + "github.com/go-openapi/swag" +) + +// Swagger this is the root document object for the API specification. +// It combines what previously was the Resource Listing and API Declaration (version 1.2 and earlier) together into one document. +// +// For more information: http://goo.gl/8us55a#swagger-object- +type Swagger struct { + VendorExtensible + SwaggerProps +} + +// JSONLookup look up a value by the json property name +func (s Swagger) JSONLookup(token string) (interface{}, error) { + if ex, ok := s.Extensions[token]; ok { + return &ex, nil + } + r, _, err := jsonpointer.GetForToken(s.SwaggerProps, token) + return r, err +} + +// MarshalJSON marshals this swagger structure to json +func (s Swagger) MarshalJSON() ([]byte, error) { + b1, err := json.Marshal(s.SwaggerProps) + if err != nil { + return nil, err + } + b2, err := json.Marshal(s.VendorExtensible) + if err != nil { + return nil, err + } + return swag.ConcatJSON(b1, b2), nil +} + +// UnmarshalJSON unmarshals a swagger spec from json +func (s *Swagger) UnmarshalJSON(data []byte) error { + var sw Swagger + if err := json.Unmarshal(data, &sw.SwaggerProps); err != nil { + return err + } + if err := json.Unmarshal(data, &sw.VendorExtensible); err != nil { + return err + } + *s = sw + return nil +} + +// SwaggerProps captures the top-level properties of an Api specification +type SwaggerProps struct { + ID string `json:"id,omitempty"` + Consumes []string `json:"consumes,omitempty"` + Produces []string `json:"produces,omitempty"` + Schemes []string `json:"schemes,omitempty"` // the scheme, when present must be from [http, https, ws, wss] + Swagger string `json:"swagger,omitempty"` + Info *Info `json:"info,omitempty"` + Host string `json:"host,omitempty"` + BasePath string `json:"basePath,omitempty"` // must start with a leading "/" + Paths *Paths `json:"paths"` // required + Definitions Definitions `json:"definitions,omitempty"` + Parameters map[string]Parameter `json:"parameters,omitempty"` + Responses map[string]Response `json:"responses,omitempty"` + SecurityDefinitions SecurityDefinitions `json:"securityDefinitions,omitempty"` + Security []map[string][]string `json:"security,omitempty"` + Tags []Tag `json:"tags,omitempty"` + ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` +} + +// Dependencies represent a dependencies property +type Dependencies map[string]SchemaOrStringArray + +// SchemaOrBool represents a schema or boolean value, is biased towards true for the boolean property +type SchemaOrBool struct { + Allows bool + Schema *Schema +} + +// JSONLookup implements an interface to customize json pointer lookup +func (s SchemaOrBool) JSONLookup(token string) (interface{}, error) { + if token == "allows" { + return s.Allows, nil + } + r, _, err := jsonpointer.GetForToken(s.Schema, token) + return r, err +} + +var jsTrue = []byte("true") +var jsFalse = []byte("false") + +// MarshalJSON convert this object to JSON +func (s SchemaOrBool) MarshalJSON() ([]byte, error) { + if s.Schema != nil { + return json.Marshal(s.Schema) + } + + if s.Schema == nil && !s.Allows { + return jsFalse, nil + } + return jsTrue, nil +} + +// UnmarshalJSON converts this bool or schema object from a JSON structure +func (s *SchemaOrBool) UnmarshalJSON(data []byte) error { + var nw SchemaOrBool + if len(data) >= 4 { + if data[0] == '{' { + var sch Schema + if err := json.Unmarshal(data, &sch); err != nil { + return err + } + nw.Schema = &sch + } + nw.Allows = !(data[0] == 'f' && data[1] == 'a' && data[2] == 'l' && data[3] == 's' && data[4] == 'e') + } + *s = nw + return nil +} + +// SchemaOrStringArray represents a schema or a string array +type SchemaOrStringArray struct { + Schema *Schema + Property []string +} + +// JSONLookup implements an interface to customize json pointer lookup +func (s SchemaOrStringArray) JSONLookup(token string) (interface{}, error) { + r, _, err := jsonpointer.GetForToken(s.Schema, token) + return r, err +} + +// MarshalJSON converts this schema object or array into JSON structure +func (s SchemaOrStringArray) MarshalJSON() ([]byte, error) { + if len(s.Property) > 0 { + return json.Marshal(s.Property) + } + if s.Schema != nil { + return json.Marshal(s.Schema) + } + return []byte("null"), nil +} + +// UnmarshalJSON converts this schema object or array from a JSON structure +func (s *SchemaOrStringArray) UnmarshalJSON(data []byte) error { + var first byte + if len(data) > 1 { + first = data[0] + } + var nw SchemaOrStringArray + if first == '{' { + var sch Schema + if err := json.Unmarshal(data, &sch); err != nil { + return err + } + nw.Schema = &sch + } + if first == '[' { + if err := json.Unmarshal(data, &nw.Property); err != nil { + return err + } + } + *s = nw + return nil +} + +// Definitions contains the models explicitly defined in this spec +// An object to hold data types that can be consumed and produced by operations. +// These data types can be primitives, arrays or models. +// +// For more information: http://goo.gl/8us55a#definitionsObject +type Definitions map[string]Schema + +// SecurityDefinitions a declaration of the security schemes available to be used in the specification. +// This does not enforce the security schemes on the operations and only serves to provide +// the relevant details for each scheme. +// +// For more information: http://goo.gl/8us55a#securityDefinitionsObject +type SecurityDefinitions map[string]*SecurityScheme + +// StringOrArray represents a value that can either be a string +// or an array of strings. Mainly here for serialization purposes +type StringOrArray []string + +// Contains returns true when the value is contained in the slice +func (s StringOrArray) Contains(value string) bool { + for _, str := range s { + if str == value { + return true + } + } + return false +} + +// JSONLookup implements an interface to customize json pointer lookup +func (s SchemaOrArray) JSONLookup(token string) (interface{}, error) { + if _, err := strconv.Atoi(token); err == nil { + r, _, err := jsonpointer.GetForToken(s.Schemas, token) + return r, err + } + r, _, err := jsonpointer.GetForToken(s.Schema, token) + return r, err +} + +// UnmarshalJSON unmarshals this string or array object from a JSON array or JSON string +func (s *StringOrArray) UnmarshalJSON(data []byte) error { + var first byte + if len(data) > 1 { + first = data[0] + } + + if first == '[' { + var parsed []string + if err := json.Unmarshal(data, &parsed); err != nil { + return err + } + *s = StringOrArray(parsed) + return nil + } + + var single interface{} + if err := json.Unmarshal(data, &single); err != nil { + return err + } + if single == nil { + return nil + } + switch single.(type) { + case string: + *s = StringOrArray([]string{single.(string)}) + return nil + default: + return fmt.Errorf("only string or array is allowed, not %T", single) + } +} + +// MarshalJSON converts this string or array to a JSON array or JSON string +func (s StringOrArray) MarshalJSON() ([]byte, error) { + if len(s) == 1 { + return json.Marshal([]string(s)[0]) + } + return json.Marshal([]string(s)) +} + +// SchemaOrArray represents a value that can either be a Schema +// or an array of Schema. Mainly here for serialization purposes +type SchemaOrArray struct { + Schema *Schema + Schemas []Schema +} + +// Len returns the number of schemas in this property +func (s SchemaOrArray) Len() int { + if s.Schema != nil { + return 1 + } + return len(s.Schemas) +} + +// ContainsType returns true when one of the schemas is of the specified type +func (s *SchemaOrArray) ContainsType(name string) bool { + if s.Schema != nil { + return s.Schema.Type != nil && s.Schema.Type.Contains(name) + } + return false +} + +// MarshalJSON converts this schema object or array into JSON structure +func (s SchemaOrArray) MarshalJSON() ([]byte, error) { + if len(s.Schemas) > 0 { + return json.Marshal(s.Schemas) + } + return json.Marshal(s.Schema) +} + +// UnmarshalJSON converts this schema object or array from a JSON structure +func (s *SchemaOrArray) UnmarshalJSON(data []byte) error { + var nw SchemaOrArray + var first byte + if len(data) > 1 { + first = data[0] + } + if first == '{' { + var sch Schema + if err := json.Unmarshal(data, &sch); err != nil { + return err + } + nw.Schema = &sch + } + if first == '[' { + if err := json.Unmarshal(data, &nw.Schemas); err != nil { + return err + } + } + *s = nw + return nil +} + +// vim:set ft=go noet sts=2 sw=2 ts=2: diff --git a/go/vendor/github.com/go-openapi/spec/tag.go b/go/vendor/github.com/go-openapi/spec/tag.go new file mode 100644 index 0000000..25256c4 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/tag.go @@ -0,0 +1,74 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +import ( + "encoding/json" + + "github.com/go-openapi/jsonpointer" + "github.com/go-openapi/swag" +) + +// TagProps describe a tag entry in the top level tags section of a swagger spec +type TagProps struct { + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` + ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` +} + +// NewTag creates a new tag +func NewTag(name, description string, externalDocs *ExternalDocumentation) Tag { + return Tag{TagProps: TagProps{description, name, externalDocs}} +} + +// Tag allows adding meta data to a single tag that is used by the [Operation Object](http://goo.gl/8us55a#operationObject). +// It is not mandatory to have a Tag Object per tag used there. +// +// For more information: http://goo.gl/8us55a#tagObject +type Tag struct { + VendorExtensible + TagProps +} + +// JSONLookup implements an interface to customize json pointer lookup +func (t Tag) JSONLookup(token string) (interface{}, error) { + if ex, ok := t.Extensions[token]; ok { + return &ex, nil + } + + r, _, err := jsonpointer.GetForToken(t.TagProps, token) + return r, err +} + +// MarshalJSON marshal this to JSON +func (t Tag) MarshalJSON() ([]byte, error) { + b1, err := json.Marshal(t.TagProps) + if err != nil { + return nil, err + } + b2, err := json.Marshal(t.VendorExtensible) + if err != nil { + return nil, err + } + return swag.ConcatJSON(b1, b2), nil +} + +// UnmarshalJSON marshal this from JSON +func (t *Tag) UnmarshalJSON(data []byte) error { + if err := json.Unmarshal(data, &t.TagProps); err != nil { + return err + } + return json.Unmarshal(data, &t.VendorExtensible) +} diff --git a/go/vendor/github.com/go-openapi/spec/xml_object.go b/go/vendor/github.com/go-openapi/spec/xml_object.go new file mode 100644 index 0000000..945a467 --- /dev/null +++ b/go/vendor/github.com/go-openapi/spec/xml_object.go @@ -0,0 +1,68 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 spec + +// XMLObject a metadata object that allows for more fine-tuned XML model definitions. +// +// For more information: http://goo.gl/8us55a#xmlObject +type XMLObject struct { + Name string `json:"name,omitempty"` + Namespace string `json:"namespace,omitempty"` + Prefix string `json:"prefix,omitempty"` + Attribute bool `json:"attribute,omitempty"` + Wrapped bool `json:"wrapped,omitempty"` +} + +// WithName sets the xml name for the object +func (x *XMLObject) WithName(name string) *XMLObject { + x.Name = name + return x +} + +// WithNamespace sets the xml namespace for the object +func (x *XMLObject) WithNamespace(namespace string) *XMLObject { + x.Namespace = namespace + return x +} + +// WithPrefix sets the xml prefix for the object +func (x *XMLObject) WithPrefix(prefix string) *XMLObject { + x.Prefix = prefix + return x +} + +// AsAttribute flags this object as xml attribute +func (x *XMLObject) AsAttribute() *XMLObject { + x.Attribute = true + return x +} + +// AsElement flags this object as an xml node +func (x *XMLObject) AsElement() *XMLObject { + x.Attribute = false + return x +} + +// AsWrapped flags this object as wrapped, this is mostly useful for array types +func (x *XMLObject) AsWrapped() *XMLObject { + x.Wrapped = true + return x +} + +// AsUnwrapped flags this object as an xml node +func (x *XMLObject) AsUnwrapped() *XMLObject { + x.Wrapped = false + return x +} diff --git a/go/vendor/github.com/go-openapi/strfmt/.editorconfig b/go/vendor/github.com/go-openapi/strfmt/.editorconfig new file mode 100644 index 0000000..3152da6 --- /dev/null +++ b/go/vendor/github.com/go-openapi/strfmt/.editorconfig @@ -0,0 +1,26 @@ +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true + +# Set default charset +[*.{js,py,go,scala,rb,java,html,css,less,sass,md}] +charset = utf-8 + +# Tab indentation (no size specified) +[*.go] +indent_style = tab + +[*.md] +trim_trailing_whitespace = false + +# Matches the exact files either package.json or .travis.yml +[{package.json,.travis.yml}] +indent_style = space +indent_size = 2 diff --git a/go/vendor/github.com/go-openapi/strfmt/.gitignore b/go/vendor/github.com/go-openapi/strfmt/.gitignore new file mode 100644 index 0000000..dd91ed6 --- /dev/null +++ b/go/vendor/github.com/go-openapi/strfmt/.gitignore @@ -0,0 +1,2 @@ +secrets.yml +coverage.out diff --git a/go/vendor/github.com/go-openapi/strfmt/.golangci.yml b/go/vendor/github.com/go-openapi/strfmt/.golangci.yml new file mode 100644 index 0000000..4029779 --- /dev/null +++ b/go/vendor/github.com/go-openapi/strfmt/.golangci.yml @@ -0,0 +1,19 @@ +linters-settings: + govet: + check-shadowing: true + golint: + min-confidence: 0 + gocyclo: + min-complexity: 25 + maligned: + suggest-new: true + dupl: + threshold: 100 + goconst: + min-len: 2 + min-occurrences: 2 + +linters: + enable-all: true + disable: + - maligned diff --git a/go/vendor/github.com/go-openapi/strfmt/.travis.yml b/go/vendor/github.com/go-openapi/strfmt/.travis.yml new file mode 100644 index 0000000..613ee97 --- /dev/null +++ b/go/vendor/github.com/go-openapi/strfmt/.travis.yml @@ -0,0 +1,20 @@ +after_success: +- bash <(curl -s https://codecov.io/bash) +go: +- '1.9' +- 1.10.x +- 1.11.x +install: +- go get -u github.com/stretchr/testify/assert +- go get -u github.com/pborman/uuid +- go get -u github.com/asaskevich/govalidator +- go get -u github.com/mailru/easyjson +- go get -u github.com/go-openapi/errors +- go get -u github.com/mitchellh/mapstructure +- go get -u github.com/globalsign/mgo/bson +language: go +notifications: + slack: + secure: zE5AtIYTpYfQPnTzP+EaQPN7JKtfFAGv6PrJqoIZLOXa8B6zGb6+J1JRNNxWi7faWbyJOxa4FSSsuPsKZMycUK6wlLFIdhDxwqeo7Ew8r6rdZKdfUHQggfNS9wO79ARoNYUDHtmnaBUS+eWSM1YqSc4i99QxyyfuURLOeAaA/q14YbdlTlaw3lrZ0qT92ot1FnVGNOx064zuHtFeUf+jAVRMZ6Q3rvqllwIlPszE6rmHGXBt2VoJxRaBetdwd7FgkcYw9FPXKHhadwC7/75ZAdmxIukhxNMw4Tr5NuPcqNcnbYLenDP7B3lssGVIrP4BRSqekS1d/tqvdvnnFWHMwrNCkSnSc065G5+qWTlXKAemIclgiXXqE2furBNLm05MDdG8fn5epS0UNarkjD+zX336RiqwBlOX4KbF+vPyqcO98CsN0lnd+H6loc9reiTHs37orFFpQ+309av9be2GGsHUsRB9ssIyrewmhAccOmkRtr2dVTZJNFQwa5Kph5TNJuTjnZEwG/xUkEX2YSfwShOsb062JWiflV6PJdnl80pc9Tn7D5sO5Bf9DbijGRJwwP+YiiJtwtr+vsvS+n4sM0b5eqm4UoRo+JJO8ffoJtHS7ItuyRbVQCwEPJ4221WLcf5PquEEDdAPwR+K4Gj8qTXqTDdxOiES1xFUKVgmzhI= +script: +- ./hack/coverage diff --git a/go/vendor/github.com/go-openapi/strfmt/CODE_OF_CONDUCT.md b/go/vendor/github.com/go-openapi/strfmt/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..9322b06 --- /dev/null +++ b/go/vendor/github.com/go-openapi/strfmt/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at ivan+abuse@flanders.co.nz. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/go/vendor/github.com/go-openapi/strfmt/LICENSE b/go/vendor/github.com/go-openapi/strfmt/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/go/vendor/github.com/go-openapi/strfmt/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/go/vendor/github.com/go-openapi/strfmt/README.md b/go/vendor/github.com/go-openapi/strfmt/README.md new file mode 100644 index 0000000..55f8804 --- /dev/null +++ b/go/vendor/github.com/go-openapi/strfmt/README.md @@ -0,0 +1,71 @@ +# Strfmt [![Build Status](https://travis-ci.org/go-openapi/strfmt.svg?branch=master)](https://travis-ci.org/go-openapi/strfmt) [![codecov](https://codecov.io/gh/go-openapi/strfmt/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/strfmt) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) + +[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/strfmt/master/LICENSE) +[![GoDoc](https://godoc.org/github.com/go-openapi/strfmt?status.svg)](http://godoc.org/github.com/go-openapi/strfmt) +[![GolangCI](https://golangci.com/badges/github.com/go-openapi/strfmt.svg)](https://golangci.com) +[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/strfmt)](https://goreportcard.com/report/github.com/go-openapi/strfmt) + +This package exposes a registry of data types to support string formats in the go-openapi toolkit. + +strfmt represents a well known string format such as credit card or email. The go toolkit for OpenAPI specifications knows how to deal with those. + +## Supported data formats +go-openapi/strfmt follows the swagger 2.0 specification with the following formats +defined [here](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types). + +It also provides convenient extensions to go-openapi users. + +- [x] JSON-schema draft 4 formats + - date-time + - email + - hostname + - ipv4 + - ipv6 + - uri +- [x] swagger 2.0 format extensions + - binary + - byte (e.g. base64 encoded string) + - date (e.g. "1970-01-01") + - password +- [x] go-openapi custom format extensions + - bsonobjectid (BSON objectID) + - creditcard + - duration (e.g. "3 weeks", "1ms") + - hexcolor (e.g. "#FFFFFF") + - isbn, isbn10, isbn13 + - mac (e.g "01:02:03:04:05:06") + - rgbcolor (e.g. "rgb(100,100,100)") + - ssn + - uuid, uuid3, uuid4, uuid5 + +> NOTE: as the name stands for, this package is intended to support string formatting only. +> It does not provide validation for numerical values with swagger format extension for JSON types "number" or +> "integer" (e.g. float, double, int32...). + +## Format types +Types defined in strfmt expose marshaling and validation capabilities. + +List of defined types: +- Base64 +- CreditCard +- Date +- DateTime +- Duration +- Email +- HexColor +- Hostname +- IPv4 +- IPv6 +- ISBN +- ISBN10 +- ISBN13 +- MAC +- ObjectId +- Password +- RGBColor +- SSN +- URI +- UUID +- UUID3 +- UUID4 +- UUID5 diff --git a/go/vendor/github.com/go-openapi/strfmt/bson.go b/go/vendor/github.com/go-openapi/strfmt/bson.go new file mode 100644 index 0000000..be8ae2d --- /dev/null +++ b/go/vendor/github.com/go-openapi/strfmt/bson.go @@ -0,0 +1,127 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 strfmt + +import ( + "database/sql/driver" + "errors" + "fmt" + + "github.com/globalsign/mgo/bson" + "github.com/mailru/easyjson/jlexer" + "github.com/mailru/easyjson/jwriter" +) + +func init() { + var id ObjectId + // register this format in the default registry + Default.Add("bsonobjectid", &id, IsBSONObjectID) +} + +// IsBSONObjectID returns true when the string is a valid BSON.ObjectId +func IsBSONObjectID(str string) bool { + return bson.IsObjectIdHex(str) +} + +// ObjectId represents a BSON object ID (alias to github.com/globalsign/mgo/bson.ObjectId) +// +// swagger:strfmt bsonobjectid +type ObjectId bson.ObjectId + +// NewObjectId creates a ObjectId from a Hex String +func NewObjectId(hex string) ObjectId { + return ObjectId(bson.ObjectIdHex(hex)) +} + +// MarshalText turns this instance into text +func (id *ObjectId) MarshalText() ([]byte, error) { + return []byte(bson.ObjectId(*id).Hex()), nil +} + +// UnmarshalText hydrates this instance from text +func (id *ObjectId) UnmarshalText(data []byte) error { // validation is performed later on + *id = ObjectId(bson.ObjectIdHex(string(data))) + return nil +} + +// Scan read a value from a database driver +func (id *ObjectId) Scan(raw interface{}) error { + var data []byte + switch v := raw.(type) { + case []byte: + data = v + case string: + data = []byte(v) + default: + return fmt.Errorf("cannot sql.Scan() strfmt.URI from: %#v", v) + } + + return id.UnmarshalText(data) +} + +// Value converts a value to a database driver value +func (id *ObjectId) Value() (driver.Value, error) { + return driver.Value(string(*id)), nil +} + +func (id *ObjectId) String() string { + return string(*id) +} + +// MarshalJSON returns the ObjectId as JSON +func (id *ObjectId) MarshalJSON() ([]byte, error) { + var w jwriter.Writer + id.MarshalEasyJSON(&w) + return w.BuildBytes() +} + +// MarshalEasyJSON writes the ObjectId to a easyjson.Writer +func (id *ObjectId) MarshalEasyJSON(w *jwriter.Writer) { + w.String(bson.ObjectId(*id).Hex()) +} + +// UnmarshalJSON sets the ObjectId from JSON +func (id *ObjectId) UnmarshalJSON(data []byte) error { + l := jlexer.Lexer{Data: data} + id.UnmarshalEasyJSON(&l) + return l.Error() +} + +// UnmarshalEasyJSON sets the ObjectId from a easyjson.Lexer +func (id *ObjectId) UnmarshalEasyJSON(in *jlexer.Lexer) { + if data := in.String(); in.Ok() { + *id = NewObjectId(data) + } +} + +// GetBSON returns the hex representation of the ObjectId as a bson.M{} map. +func (id *ObjectId) GetBSON() (interface{}, error) { + return bson.M{"data": bson.ObjectId(*id).Hex()}, nil +} + +// SetBSON sets the ObjectId from raw bson data +func (id *ObjectId) SetBSON(raw bson.Raw) error { + var m bson.M + if err := raw.Unmarshal(&m); err != nil { + return err + } + + if data, ok := m["data"].(string); ok { + *id = NewObjectId(data) + return nil + } + + return errors.New("couldn't unmarshal bson raw value as ObjectId") +} diff --git a/go/vendor/github.com/go-openapi/strfmt/date.go b/go/vendor/github.com/go-openapi/strfmt/date.go new file mode 100644 index 0000000..ccdba44 --- /dev/null +++ b/go/vendor/github.com/go-openapi/strfmt/date.go @@ -0,0 +1,150 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 strfmt + +import ( + "database/sql/driver" + "errors" + "fmt" + "time" + + "github.com/globalsign/mgo/bson" + "github.com/mailru/easyjson/jlexer" + "github.com/mailru/easyjson/jwriter" +) + +func init() { + d := Date{} + // register this format in the default registry + Default.Add("date", &d, IsDate) +} + +// IsDate returns true when the string is a valid date +func IsDate(str string) bool { + _, err := time.Parse(RFC3339FullDate, str) + return err == nil +} + +const ( + // RFC3339FullDate represents a full-date as specified by RFC3339 + // See: http://goo.gl/xXOvVd + RFC3339FullDate = "2006-01-02" +) + +// Date represents a date from the API +// +// swagger:strfmt date +type Date time.Time + +// String converts this date into a string +func (d Date) String() string { + return time.Time(d).Format(RFC3339FullDate) +} + +// UnmarshalText parses a text representation into a date type +func (d *Date) UnmarshalText(text []byte) error { + if len(text) == 0 { + return nil + } + dd, err := time.Parse(RFC3339FullDate, string(text)) + if err != nil { + return err + } + *d = Date(dd) + return nil +} + +// MarshalText serializes this date type to string +func (d Date) MarshalText() ([]byte, error) { + return []byte(d.String()), nil +} + +// Scan scans a Date value from database driver type. +func (d *Date) Scan(raw interface{}) error { + switch v := raw.(type) { + case []byte: + return d.UnmarshalText(v) + case string: + return d.UnmarshalText([]byte(v)) + case time.Time: + *d = Date(v) + return nil + case nil: + *d = Date{} + return nil + default: + return fmt.Errorf("cannot sql.Scan() strfmt.Date from: %#v", v) + } +} + +// Value converts Date to a primitive value ready to written to a database. +func (d Date) Value() (driver.Value, error) { + return driver.Value(d.String()), nil +} + +// MarshalJSON returns the Date as JSON +func (d Date) MarshalJSON() ([]byte, error) { + var w jwriter.Writer + d.MarshalEasyJSON(&w) + return w.BuildBytes() +} + +// MarshalEasyJSON writes the Date to a easyjson.Writer +func (d Date) MarshalEasyJSON(w *jwriter.Writer) { + w.String(time.Time(d).Format(RFC3339FullDate)) +} + +// UnmarshalJSON sets the Date from JSON +func (d *Date) UnmarshalJSON(data []byte) error { + if string(data) == jsonNull { + return nil + } + l := jlexer.Lexer{Data: data} + d.UnmarshalEasyJSON(&l) + return l.Error() +} + +// UnmarshalEasyJSON sets the Date from a easyjson.Lexer +func (d *Date) UnmarshalEasyJSON(in *jlexer.Lexer) { + if data := in.String(); in.Ok() { + tt, err := time.Parse(RFC3339FullDate, data) + if err != nil { + in.AddError(err) + return + } + *d = Date(tt) + } +} + +// GetBSON returns the Date as a bson.M{} map. +func (d *Date) GetBSON() (interface{}, error) { + return bson.M{"data": d.String()}, nil +} + +// SetBSON sets the Date from raw bson data +func (d *Date) SetBSON(raw bson.Raw) error { + var m bson.M + if err := raw.Unmarshal(&m); err != nil { + return err + } + + if data, ok := m["data"].(string); ok { + rd, err := time.Parse(RFC3339FullDate, data) + *d = Date(rd) + return err + } + + return errors.New("couldn't unmarshal bson raw value as Date") +} diff --git a/go/vendor/github.com/go-openapi/strfmt/default.go b/go/vendor/github.com/go-openapi/strfmt/default.go new file mode 100644 index 0000000..13235ec --- /dev/null +++ b/go/vendor/github.com/go-openapi/strfmt/default.go @@ -0,0 +1,1853 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 strfmt + +import ( + "database/sql/driver" + "encoding/base64" + "errors" + "fmt" + "net/mail" + "regexp" + "strings" + + "github.com/asaskevich/govalidator" + "github.com/globalsign/mgo/bson" + "github.com/mailru/easyjson/jlexer" + "github.com/mailru/easyjson/jwriter" +) + +const ( + // HostnamePattern http://json-schema.org/latest/json-schema-validation.html#anchor114 + // A string instance is valid against this attribute if it is a valid + // representation for an Internet host name, as defined by RFC 1034, section 3.1 [RFC1034]. + // http://tools.ietf.org/html/rfc1034#section-3.5 + // ::= any one of the ten digits 0 through 9 + // var digit = /[0-9]/; + // ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case + // var letter = /[a-zA-Z]/; + // ::= | + // var letDig = /[0-9a-zA-Z]/; + // ::= | "-" + // var letDigHyp = /[-0-9a-zA-Z]/; + // ::= | + // var ldhStr = /[-0-9a-zA-Z]+/; + //